ROS2 galactic生成的bag包里的MarkerArray在humble下播放不正常

文章讲述了在ROS2Galactic和Humble版本中,由于bag文件格式的细微差异,导致MarkerArray消息在不同版本间的回放问题。作者通过SQLite分析发现,Humble版本写入的binary数据格式与Galactic不同,影响了消息的正确读取。

近期发现ROS2 galactic下生成的bag包在humble下回放时使用rviz可视化,bag里的点云可以正常看到,但是使用Marker和MarkerArray画的box却死活看不到,感觉很纳闷,看网上有人报告说foxy下生成的bag包在galactic下播放会报SQL错误,推断ROS2不同版本之间关于bag的实现可能有一些差异导致不兼容。

考虑道ROS2生成的bag包实际上是个sqlite db文件,于是下载sqlite3的可执行文件和给VS code安装Sqlite3 Editor插件

使用Sqlite3 Editor对比了一下写入同样的message的galactic下生成的bag和humble下生成的bag里的数据区别,发现humble生成的bag比galactic生成的bag里多schema等两张表,剩下两张表topics和messages的表结构是一样的,里面存储的数据里除用binary方式存储的message的内容列外的其他文本方式显示的列的值看上去是一样的,于是先怀疑是不是因为少了schema那两张表导致humble不认识galactic生成的bag,于是手工把humble生成的bag里的多的两张表连数据都导入galactic生成的bag里,然后在humble下播放,发现rviz里还是看不到box,用echo接收那个topic也收不到消息,这才感觉应该应该是humble生成的bag里的messages表里data列用binary方式存储的message数据的格式和galactic下生成的bag里的messages表里的对应的data列的数据的格式根据就不同了

As an AI language model, I cannot perform any actions beyond providing information. However, I can provide you with some guidance on how to convert a ROS1 bag file to a ROS2 bag file. There are different approaches to converting ROS1 bag files to ROS2 bag files. One of the simplest ways is to use the ROS1-ROS2 bridge, which allows communication between ROS1 and ROS2 systems. To convert a ROS1 bag file to a ROS2 bag file using the bridge, you can follow these steps: 1. Install the ROS1-ROS2 bridge package on your ROS2 system. You can do this by running the following command in your terminal: ``` sudo apt-get install ros-<distro>-ros1-bridge ``` Make sure to replace `<distro>` with the ROS2 distribution you are using (e.g., foxy, galactic). 2. Source the ROS1 and ROS2 environments in separate terminal windows: ``` source /opt/ros/<distro>/setup.bash # for ROS1 source /opt/ros/<distro>/setup.bash # for ROS2 ``` 3. Launch the ROS1-ROS2 bridge node in one terminal window: ``` ros2 run ros1_bridge dynamic_bridge ``` 4. In another terminal window, use the rosbag tool to play the ROS1 bag file and publish its messages to the ROS2 bridge: ``` ros1bag play <ros1_bag_file> --clock --pause --loop ``` 5. In a third terminal window, use the ROS2 bag tool to record the messages published by the bridge: ``` ros2 bag record -a ``` This will record all the messages published by the ROS1-ROS2 bridge and save them to a ROS2 bag file. Note that the conversion process may take some time, depending on the size of the ROS1 bag file and the complexity of the messages it contains. Also, not all message types are currently supported by the ROS1-ROS2 bridge, so you may encounter some errors or limitations during the conversion process.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Arnold-FY-Chen

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值