The ROS 1 Bridge
allows ROS 2 packages such as luos_ros2
to communicate with a ROS 1 ecosystem. However, both ROS 1 and 2 need to be installed and the bridge takes care of the translation.
This procedure has been tested with ROS 1 Noetic + ROS 2 Foxy and Python 3.8.2 in Ubuntu. It might work with older distributions although it hasn't been tested.
Make sure you have first installed ROS 2 and managed to run the broker in ROS 2 with the command ros2 launch luos_interface broker.launch.py
.
We assume your ROS 2 workspace is ~/ros2_ws
.
Then install ROS 1 Noetic on Ubuntu 20.04.
We assume your ROS 1 workspace is ~/ros_ws
.
The bridge has it own workspace that is to be compiled with colcon (ROS 2):
mkdir -p ~/ros1_bridge_ws/src
cd ~/ros1_bridge_ws/src
git clone -b foxy https://github.com/ros2/ros1_bridge.git
source ~/ros_ws/devel/setup.bash
source ~/ros2_ws/install/setup.bash
cd ~/ros1_bridge_ws
colcon build --packages-select ros1_bridge --cmake-force-configure --cmake-args -DBUILD_TESTING=FALSE
source ~/ros_ws/devel/setup.bash
roscore
source ~/ros1_bridge_ws/install/setup.bash
ros2 run ros1_bridge dynamic_bridge --bridge-all-2to1-topics
Plug some Luos modules before starting the broker.
source ~/ros2_ws/install/setup.bash
ros2 launch luos_interface broker.launch.py
Let's consider here that rostopic
is the ROS 1 app you want to run with Luos modules.
source ~/ros_ws/devel/setup.bash
rostopic list
You can then publish and subscribe to the available topics in ROS 1.