Potential error in the guide book of Course Project: Navigate with a Real Robot

source /opt/ros/foxy/setup.bash
ros2 run ros1_bridge dynamic_bridge --bridge-all-topics

The above commands will not work.
Reported errors:

/home/simulations/ros2_sims_ws/install/ros1_bridge/lib/ros1_bridge/dynamic_bridge: error while loading shared libraries: librosconsole.so: cannot open shared object file: No such file or directory

Try to use:
user:~$ source ~/.bashrc_bridge

ROS_DISTRO was set to ‘foxy’ before. Please make sure that the environment does not mix paths from different distributions.
ROS_DISTRO was set to ‘noetic’ before. Please make sure that the environment does not mix paths from different distributions.
ROS_DISTRO was set to ‘foxy’ before. Please make sure that the environment does not mix paths from different distributions.
user:~$ ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
created 1to2 bridge for topic ‘/clock’ with ROS 1 type ‘rosgraph_msgs/Clock’ and ROS 2 type ‘rosgraph_msgs/msg/Clock’
created 1to2 bridge for topic ‘/cv_camera/camera_info’ with ROS 1 type ‘sensor_msgs/CameraInfo’ and ROS 2 type ‘sensor_msgs/msg/CameraInfo’
created 1to2 bridge for topic ‘/cv_camera/image_raw’ with ROS 1 type’sensor_msgs/Image’ and ROS 2 type ‘sensor_msgs/msg/Image’
created 1to2 bridge for topic ‘/cv_camera/image_raw/compressed’ withROS 1 type ‘sensor_msgs/CompressedImage’ and ROS 2 type ‘sensor_msgs/msg/CompressedImage’
created 1to2 bridge for topic '/cv_camera/image_raw/compressedDepth’with ROS 1 type ‘sensor_msgs/CompressedImage’ and ROS 2 type ‘sensor_msgs/msg/CompressedImage’
created 1to2 bridge for topic ‘/gazebo/link_states’ with ROS 1 type ‘gazebo_msgs/LinkStates’ and ROS 2 type ‘gazebo_msgs/msg/LinkStates’
created 1to2 bridge for topic

Thank you for sharing this solution, we’ll update the notebook.

Thank you, the notebook has been updated. To see them reflected, you’ll have to fork a new copy of the rosject.

Please let me know if you find any additional errors

Thanks for your fast response. I will fork the new copy of the rosject for Project 2. After I find the bug, I try to use the file bashrc_bridge. The result is that using the file bashrc_bridge alone will not work. I have to source the file bashrc_ros2, too. After that, the ROS1 bridge runs, and it seems to work. However, the cartographer complains that it cannot receive the information about the topic Scan. So, I start to wonder whether the bridge is working. I close the cartographer; then, try to use the teleop_keyboard to drive the robot. Certainly, I fail. So, I think the ROS1 bridge is broken.

Considering the time difference and the physical distance between us, I decide not to wait for help. So, I copy the world file from your server and run it on my local computer. Then, I finish Project 1.

When I come back, I find my question has been answered.
Thanks, again.

Processing: iShot_2022-05-27_16.03.57.png…

This is a screenshot from my local computer. It uses your world files with the official turtle bot simulation package. All the programs run on ROS2. The robot model in the turtlebot3 simulation simplifies the detail of the robot, which runs faster but looks ugly. I think you are using the model from the turtlebot3 package. Thanks for that because my computer does not have a GPU.

I definitely will return to your virtual system in Project 2.

Thank you for your feedback. I will take a look at those bash scripts.

The way you can make sure the bridge is working is to simply echo the scan topic.

Just to clarify, to launch the bridge you have to:

  1. Source ROS: source /opt/ros/noetic/setup.bash
  2. Source ROS2: source /opt/ros/foxy/setup.bash
  3. Launch the bridge: ros2 run ros1_bridge dynamic_bridge --bridge-all-topics

The reason we use the bridge instead of having everything in ROS 2 is because once you connect to the real TurtleBot3 to validate your project, the robot itself runs ROS, so the bridge is necessary. I’m glad to hear you got it working locally with a ROS2 simulation though.