Skip to Content

4.5 Build And Run ROS1-ROS2 Bridge


Step 4.5.1 First install Docker if it is not installed on your system by following an official documentation here. Make sure that you made docker run without a sudo.

ROS1-ROS2 bridge for Ubuntu 22.04 is an unofficial way based on solution from TommyChangUMD Github repo. If something is not working, check the repo's readme source, because it is updated constantly.

Step 4.5.2 Clone the repo

cd ~
git clone https://github.com/TommyChangUMD/ros-humble-ros1-bridge-builder.git

Step 4.5.3 Now launch docker image build, it will take around one hour.

cd ~/ros-humble-ros1-bridge-builder
docker build . -t ros-humble-ros1-bridge-builder

Step 4.5.4 After a successful build, next step is to run your new image in a container

cd ~
docker run --rm ros-humble-ros1-bridge-builder | tar xvzf -

Step 4.5.5 Delete builder image

docker rmi ros-humble-ros1-bridge-builder

Step 4.5.6 Delete builder image

Open script, and update IP address with you Raspberry local IP address that you set, and also Raspberry computer name.

cd mikrik_robotics_sdk/scripts
vi mikrik_bridge_launch.sh

Like this

export ROS_IP=172.72.2.2
export ROS_MASTER_URI=http://rosrobot:11311

Step 4.5.7 Make launch bridge script executable

cd ~/mikrik_robotics_sdk/scripts/
sudo chmod u+x bridge_launch.sh

Step 4.5.8 Launch script to start the bridge. Make sure that ROS1 nodes on Raspberry are already running!

./mikrik_bridge_launch.sh

If everything works, there will be no errors, and in the terminal window you will see redirected topics like that:

[INFO] [1717447209.481296013] [ros_bridge]: Passing message from ROS 1 std_msgs/Float64 to ROS 2 std_msgs/msg/Float64 (showing msg only once per type)
[INFO] [1717447209.481600281] [ros_bridge]: Passing message from ROS 1 std_msgs/Float64MultiArray to ROS 2 std_msgs/msg/Float64MultiArray (showing msg only once per type)
[INFO] [1717447209.482872942] [ros_bridge]: Passing message from ROS 1 sensor_msgs/Joy to ROS 2 sensor_msgs/msg/Joy (showing msg only once per type)
[INFO] [1717447209.484723585] [ros_bridge]: Passing message from ROS 1 sensor_msgs/JointState to ROS 2 sensor_msgs/msg/JointState (showing msg only once per type)
[INFO] [1717447209.587996301] [ros_bridge]: Passing message from ROS 1 tf2_msgs/TFMessage to ROS 2 tf2_msgs/msg/TFMessage (showing msg only once per type)
[INFO] [1717447209.588910535] [ros_bridge]: Passing message from ROS 1 nav_msgs/Odometry to ROS 2 nav_msgs/msg/Odometry (showing msg only once per type)
[INFO] [1717447209.589016420] [ros_bridge]: Passing message from ROS 1 tf/tfMessage to ROS 2 tf2_msgs/msg/TFMessage (showing msg only once per type)
created 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log'

Step 4.5.9 Open a second terminal window on LattePanda, and then run

source /opt/ros/humble/setup.bash
ros2 topic list

Output of the command must be like, it will print all topics redirected from Raspberry ROS1 to the ROS2 running on LattePanda

ros2 topic list
/battery
/imu
/joint_states
/joy
/mikrik/left_wheel/angle
/mikrik/left_wheel/current_velocity
/mikrik/left_wheel/pid_debug
/mikrik/left_wheel/pwm
/mikrik/left_wheel/target_velocity
/mikrik/right_wheel/angle
/mikrik/right_wheel/current_velocity
/mikrik/right_wheel/pid_debug
/mikrik/right_wheel/pwm
/mikrik/right_wheel/target_velocity
/mobile_mikrik/cmd_vel
/mobile_mikrik/odom
/parameter_events
/rosout
/tf
/tf_static
Rating
0 0

There are no comments for now.

to be the first to leave a comment.