ros1bag play and ros2 bridge recv

Environment:

- Linux Mint 20.1 (based on Ubuntu 20.04)
- I use zsh instead of bash, see oh-my-zsh.
- ROS1 Noetic installed according to http://wiki.ros.org/noetic/Installation/Ubuntu
- ROS2 Foxy installed according to https://docs.ros.org/en/foxy/Installation.html
- other versions should be ALMOST the same

setup the following shell functions for conveniency, this is totally optional. If you don’t do this, just replace the content later. Also note to replace the distro name of the correct version.

# in ~/.zshrc or ~/.zshenv or ~/.bashrc if you use bash
function activate_ros1 {
    source /opt/ros/noetic/setup.zsh
}
function activate_ros2 {
    source /opt/ros/foxy/setup.zsh
}

Steps

On 1st terminal (ROS1)

activate_ros1
roscore

On 2nd terminal (ROS1)

activate_ros1
rosbag play <blablabla.bag>

On 3rd terminal (ROS1) (optional)

activate_ros1
rostopic list # to list all messages
rostopic info <topic_name> # to show details of interested message, remember its message type for later use.

On 4th terminal (ROS1+ROS2)

sudo apt-get install ros-foxy-ros1-bridge # may need to change distro name; you only need to do this once.

then

activate_ros1 # first do this
activate_ros2 # then do this, ignore the warning
ros2 run ros1_bridge dynamic_bridge

On 5th terminal (ROS2)

activate_ros2
ros2 topic echo <topic_name> <message_type> # from the 3rd terminal, note the <message_type> is a must.

or run your own program.

More Infomation can be found here.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值