-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues building the ros1_bridge from source #22
Comments
The current solution found for now is the one you suggest above (source the ROS1 env before the ROS2 env). @mlautman btw, what is the current ROS2 release you are using? |
I have tested with both bouncy and crystal |
I think you will still need to set |
So you were able to build the |
Yep, that's something I will rearrange so it's not required (this was assuming an automation script before). |
I actually haven't been building ros1_bridge in Crystal since my goal is to build a pure ROS2 system. These notes were from when I was following the documentation line by line. |
Alright fair point. Thanks |
Actually, I lied. Here is how I build it 😝 In a fresh terminal, I run these commands: export FASTRTPSGEN_DIR=/usr/local/bin
export ROS1_DISTRO="melodic"
export ROS2_DISTRO="crystal"
export ROS1_PATH="/opt/ros/$ROS1_DISTRO/setup.bash"
export ROS2_PATH="/opt/ros/$ROS2_DISTRO/local_setup.bash"
export ROS1_WS=$HOME/ws_ros1/
export ROS2_WS=$HOME/ws_ros2/
cd $ROS2_WS
colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure --event-handlers console_direct+ Not all of the above is necessary but it works so I haven't been messing with it 🤷♂️ |
@mlautman thanks! The only difference I actually see from what I was trying is the |
I'm 99% sure that was the fix. I'm currently stuck trying to get the topics to show up when I run In 3 fresh shells I run: export FASTRTPSGEN_DIR=/usr/local/bin
export ROS1_DISTRO="melodic"
export ROS2_DISTRO="crystal"
export ROS1_PATH="/opt/ros/$ROS1_DISTRO/setup.bash"
export ROS2_PATH="/opt/ros/$ROS2_DISTRO/setup.bash"
export ROS1_WS=$HOME/ws_tom1/
export ROS2_WS=$HOME/ws_tom2/
export ROS_MASTER_URI=http://localhost:11311 then in the FIRST shell I run: cd $HOME/src/Firmware
make px4_sitl_rtps gazebo then in the SECOND shell I run: source $ROS1_PATH
source $ROS2_PATH
source $ROS2_WS/install/local_setup.bash
micrortps_agent -t UDP This outputs: CameraCapture subscriber started
CameraTrigger subscriber started
CollisionReport subscriber started
DebugArray subscriber started
DebugKeyValue subscriber started
DebugValue subscriber started
DebugVect subscriber started
ObstacleDistance subscriber started
OpticalFlow subscriber started
PositionSetpoint subscriber started
PositionSetpointTriplet subscriber started
TrajectoryWaypoint subscriber started
VehicleTrajectoryWaypoint subscriber started
AdcReport publisher started
Airspeed publisher started
BatteryStatus publisher started
Cpuload publisher started
DistanceSensor publisher started
EstimatorStatus publisher started
HomePosition publisher started
IridiumsbdStatus publisher started
RadioStatus publisher started
SatelliteInfo publisher started
SensorBaro publisher started
SensorCombined publisher started
SensorSelection publisher started
VehicleAttitude publisher started
VehicleOdometry publisher started
VtolVehicleStatus publisher started
WindEstimate publisher started
CollisionConstraints publisher started Then in the FIRST shell, in micrortps_client start -t UDP Then in the THIRD shell I run: source $ROS1_PATH
source $ROS2_PATH
source $ROS2_WS/install/local_setup.bash
ros2 topic list I would expect to see all of the topics from the agent but all I see is: /parameter_events
/rosout |
What issues are you actually facing at this point? When you issue those, you should be able to get |
When I run |
What does this mean exactly? Do you get "matches" when you start the micrortps client and agent? |
When I run |
Well that shouldn't be the first thing you have to debug. If you don't have a connection on the micrortps bridge, you won't have data on the ROS2 side. |
For sure. Let me know if you run into the same micrortps bridge issue |
How are you sure this is an micrortps bridge issue? Last time I tried this on my system (like a week ago) this was working perfectly fine. |
What version of PX4 are you using? |
Better: Can you please bring this to the #messaging channel of PX4 Slack? This is already out of scope ot this issue. Thanks |
For sure! I was just thinking the same thing. I just DM'd you on slack and posted in #messaging |
@mlautman evaluating the list above, I have to remove what I said yesterday. I don't really get how it is working. Firstly you are exporting the paths for the environments, but you are not sourcing them in any way. Also, you are not sourcing the workspace env, so that the |
My bad. I missed some lines. Here are the full instructions: Open 3 Terminals ( export FASTRTPSGEN_DIR=/usr/local/bin
export ROS1_DISTRO="melodic"
export ROS2_DISTRO="crystal"
export ROS1_PATH="/opt/ros/$ROS1_DISTRO/setup.bash"
export ROS2_PATH="/opt/ros/$ROS2_DISTRO/local_setup.bash"
export ROS1_WS=$HOME/ws_ros1/
export ROS2_WS=$HOME/ws_ros2/ In source $ROS1_PATH && \
source $ROS2_PATH && \
cd $ROS2_WS && \
colcon build --symlink-install --packages-skip ros1_bridge --event-handlers console_direct+ In source $ROS1_PATH && \
cd $ROS1_WS && \
colcon build --cmake-args --symlink-install --event-handlers console_direct+ In source $ROS1_WS/install/setup.bash && \
source $ROS2_PATH && \
source $ROS2_WS/install/local_setup.bash
cd $ROS2_WS
colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure --event-handlers console_direct+ |
Note that you shouldn't have any environments being sourced in your bashrc. |
Yep I know. |
This still does not work to me.... CMake Error at CMakeLists.txt:70 (message):
Failed to find ROS 2 package 'diagnostic_msgs'
-- Configuring incomplete, errors occurred!
See also "/home/nuno/PX4/px4_ros_com_ros2/build/ros1_bridge/CMakeFiles/CMakeOutput.log".
--- stderr: ros1_bridge
CMake Error at CMakeLists.txt:70 (message):
Failed to find ROS 2 package 'diagnostic_msgs'
---
Failed <<< ros1_bridge [ Exited with code 1 ]
Summary: 0 packages finished [4.96s]
1 package failed: ros1_bridge
1 package had stderr output: ros1_bridge |
@mlautman I was finally able to build |
Following the installation instructions in the documentation, the command
colcon build --symlink-install --packages-skip ros1_bridge --event-handlers console_direct+
in the "Building the workspaces" section fails becausepython3
fails to findgenmsg
. This is discussed here but it is never resolved. I have been runningsource /opt/ros/$ROS1_DISTRO/setup.bash
beforesource /opt/ros/$ROS2_DISTRO/setup.bash
to get colcon to build the ros2 workspace.Before building ros1_bridge, you must manually set
FASTRTPSGEN_DIR
to the location offastrtpsgen
. (eg.export FASTRTPSGEN_DIR=/usr/local/bin
). Otherwise, the build will fail withgenerate_microRTPS_bridge.py: error: argument -f/--fastrtpsgen-dir: expected one argument
Also, you must set
export ROS2_DISTRO="bouncy" # or crystal
before building.The text was updated successfully, but these errors were encountered: