当前位置:网站首页>ROS2下使用ROS1 bag的方法
ROS2下使用ROS1 bag的方法
2022-08-05 05:22:00 【howtoloveyou】
- Galactic版本以上不适用的方法:
要求:同时拥有ROS1和ROS2
sudo apt install ros-<ros2-version>-rosbag2 ros-<ros2-version>-rosbag2*
source /opt/ros/<ros1-version>/setup.bash # eg: source /opt/ros/noetic/setup.bash
source /opt/ros/<ros2-version>/setup.bash # eg: source /opt/ros/foxy/setup.bash
ros2 bag info -s rosbag_v2 path/to/ros1bag.bag # eg: ros2 bag play -s rosbag_v2 ~/slam-dataset/rgbd.bag
ros2 bag play -s rosbag_v2 path/to/ros1bag.bag # eg: ros2 bag play -s rosbag_v2 ~/slam-dataset/rgbd.bag
- ROS2版本均适用的方法:
要求:了解topic在ROS2中的正确格式
pip install rosbags
rosbags-convert path/to/ros1bag.bag # eg: rosbags-convert ~/slam-dataset/rgbd.bag
# 会在bag目录下生成ROS2格式的bag文件夹
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # 默认的fastrtps中间件无法监听话题
ros2 bag play path/to/ros1bag # eg: rosbags-convert ~/slam-dataset/rgbd
转化过后可能会报错有的话题找不到正确的格式,所以需要自己对生成的metadata.yaml
进行手动修改,比如我对tf这个话题进行了修改:tf/msg/tfMessage
to tf2_msgs/msg/TFMessage
边栏推荐
- [Day5] Soft and hard links File storage, deletion, directory management commands
- RAID disk array
- Call the TensorFlow Objection Detection API for object detection and save the detection results locally
- ACLs and NATs
- In-depth Zabbix user guide - from the green boy
- spark operator-wholeTextFiles operator
- 深度 Zabbix 使用指南——来自惨绿少年
- The idea of commonly used shortcut key
- The highlight moment of operation and maintenance starts with intelligence
- 传输层协议
猜你喜欢
随机推荐
入门文档04 一个任务依赖另外一个任务时,需要按顺序执行
入门文档09 独立的watch
运维的高光时刻,从智能化开始
Logical volume creation
Xiaodu Xiaodu is here!
Small example of regular expression--remove spaces in the middle and on both sides of the string
Switch principle
network issue?Service packet loss?This is enough
idea 常用快捷键
spark source code - task submission process - 1-sparkSubmit
spark source code - task submission process - 2-YarnClusterApplication
wc、grep、tar、vi/vim
Getting Started 04 When a task depends on another task, it needs to be executed in sequence
Regular expression small example - get number character and repeated the most
markdown editor template
入门文档10 资源映射
云计算——osi七层与TCP\IP协议
账号与权限管理
技术分享杂七杂八技术
Unity realizes first-person roaming (nanny-level tutorial)