Bootstrap

使用ros1_bridge将ROS的消息和服务接入ROS2

1.安装

系统需要同时安装ROS和ROS2(我这里安装的版本是noetic和foxy,安装方法不在这里赘述)

新建ROS2的工作空间并下载ros1_bridge源码

mkdir -p ~/colcon_ws/src
cd ~/colcon_ws/src
git clone https://github.com/ros2/ros1_bridge

编译源码

cd ~/colcon_ws
colcon build

2.测试

(1)启动ros的master节点

source /opt/ros/noetic/setup.bash
roscore

(2)启动bridge

source /opt/ros/noetic/setup.bash
source ~/colcon_ws/install/setup.bash
export ROS_MASTER_URI=http://localhost:11311
ros2 run ros1_bridge dynamic_bridge

(3)ROS发布话题

source /opt/ros/noetic/setup.bash
rosrun rospy_tutorials talker

(4)ROS2接收话题


                
      
;