rosbag操作

1.截取

(1)按照时间截取

rosbag filter 原始包名.bag 截取后的包名.bag  "t.to_sec() > 开始时间 and t.to_sec() < 结束时间"

for example

rosbag filter lidar_zed4.bag lidar_zed4_filter.bag "t.to_sec() > 1641196460.608130 and t.to_sec() < 1641196485.7"

注意:时间是Bag Time,可以在回放rosbag包的时候看到。

(2)按照时间和多个topic进行截取

rosbag filter input.bag output.bag "(topic == '/velodyne_point_cloud' or topic =='/visensor/imu' or topic == '/visensor/left/image_raw') and (t.to_sec() >= 1506117983.884751 and t.to_sec() <= 1506118069.884751)"
 

2.bag转为txt

rostopic echo -b bagfiles_name.bag /topic_name > txt_name.txt

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值