Issue using ros1_bridge in real robot simulation for ROS2 Basics in 5 Days (C++) Project

I am working on the real robot project for the ROS2 Basics in 5 Days (C++) course. In the rosject, I have created my wall following and it works well in simulation, so I tried to test on the real robot. However, as shown below, I was not able to use the robot using my code and the instructions provided in the course project notebook.

Test 1:

  • Upon launching the real robot simulation, I opened a new terminal, and ran the following in the terminal to use ros1_bridge:
source ~/catkin_ws/devel/setup.bash
roslaunch load_params load_params.launch
source /opt/ros/foxy/setup.bash
ros2 run ros1_bridge parameter_bridge
  • However, after running the last line, I get these errors:
[ERROR] [1700329495.689358465]: [registerPublisher] Failed to contact master at [10.8.0.1:11311].  Retrying...
[ INFO] [1700329510.931532520]: Connected to master at [10.8.0.1:11311]
The parameter 'topics' either doesn't exist or isn't an array
The parameter 'services_1_to_2' either doesn't exist or isn't an array
The parameter 'services_2_to_1' either doesn't exist or isn't an array
  • I then run my wall following node in a new terminal, but nothing happens. Also at this point, the joystick in the video feed of the real robot stops working and the robot cannot be controlled.

Test 2: (in a new instance of the real robot sim)

  • Launch my wall following node first (maybe it needs to be publishing first for ros1_bridge to pick up the topics? Note sure)…
  • Then run the same lines in terminal again, to try to start ros1_bridge.
  • Get the same erorrs as above.

Please let me know how I can properly use ros1_bridge with my ros2 code. More detailed instructions and explanations would be appreciated.

That command should work. However, if you launch that in a terminal where you have previously sourced a workspace, it will give you issues.

The output of the terminal should eventually show the ROS - ROS 2 connections being made.

Try in a different terminal, and check that all the commands return something: Were the parameters loaded with the second comand?

Thank you for the reply. The keys was to use a new terminal as I must have sourced another workspace in the one I Was trying to use previously.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.