改变ros bag 中消息的frame_id 和话题名

1. 改变话题名 参考链接:https://blog.youkuaiyun.com/ethan_guo/article/details/80262650

rosbag play file.bag /foo:=/bar    #/foo是原topic,/bar是新topic

 2. 改变frame_id 参考链接:http://wiki.ros.org/bag_tools#change_frame_id.py

(1) 参考说明下载包含bag_tools的srv_tools http://wiki.ros.org/srv_tools

(2) 建立ros工程, 编译项目, source devel/setup.bash

(3) 参考wiki说明

usage: change_frame_id.py [-h] -o OUTPUT_BAGFILE -i INPUT_BAGFILE -f FRAME_ID
                          -t TOPIC [TOPIC ...]

reate a new bagfile from an existing one replacing the frame id of requested
topics.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT_BAGFILE     output bagfile
  -i INPUT_BAGFILE      input bagfile
  -f FRAME_ID           desired frame_id name in the topics
  -t TOPIC [TOPIC ...]  topic(s) to change

终端运行: rosrun bag_tools change_frame_id.py -t /要改的话题 -f 新的frame_id -i 旧.bag -o 新.bag

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值