当前位置:网站首页>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
边栏推荐
- 单臂路由实验和三层交换机实验
- OpenCV3.0 is compatible with VS2010 and VS2013
- One-arm routing and 30% switch
- Regular expression small example - get number character and repeated the most
- The problem of redirecting to the home page when visiting a new page in dsf5.0
- 交换机原理
- 入门文档10 资源映射
- The problem come from line screening process
- What's the point of monitoring the involution of the system?
- Hugo搭建个人博客
猜你喜欢

Getting Started Doc 08 Conditional Plugins
时间复杂度和空间复杂度
![[Day1] VMware software installation](/img/24/20cc77e904dbe7dc1b5224c64d6329.png)
[Day1] VMware software installation

Getting Started Documentation 10 Resource Mapping

What's the point of monitoring the involution of the system?

What?CDN cache acceleration only works for accelerating static content?

RAID磁盘阵列

dsf5.0 弹框点确定没有返回值的问题

Transport layer protocol (TCP 3-way handshake)

入门文档07 分阶段输出
随机推荐
VRRP概述及实验
单臂路由实验和三层交换机实验
VLAN详解及实验
vim的三种模式
云计算——osi七层与TCP\IP协议
Hard Disk Partitioning and Permanent Mounting
LeetCode Interview Questions
Hugo builds a personal blog
入门文档10 资源映射
Getting Started Doc 08 Conditional Plugins
【Day8】Knowledge about disk and disk partition
智能运维会取代人工运维吗?
Disk management and file systems
The spark operator - repartition operator
路由器和静态路由的配置
Wechat applet page jump to pass parameters
idea 常用快捷键
Technology Sharing Miscellaneous Technologies
The problem of calling ds18b20 through a single bus
图片压缩失效问题