Ubuntu 与 ROS 中不常用但非常好用的命令收集

ROS

1. 把 rosbag 记录的包中的话题保存成 csv 文件,运行后无输出等待结束即可。

rostopic echo -b map.bag -p /imu/data >imu.csv

map.bag: 替换成自己记录的包名。
/imu/data: 替换成想保存的话题名。
imu.csv: 体换成想保存的文件名。

2. rosbag回放指定话题

rosbag play <your bagfile name> --topics <topics>

3. rosbag过滤话题与分割

3.1 按时间过滤
# 截取一段时间
rosbag filter input.bag output.bag "t.to_sec() >= start time and t.to_sec() <= end time"
# 掐头去尾
rosbag filter input.bag output.bag "t.to_sec() >= start_time"
rosbag filter input.bag output.bag "t.to_sec() <= end_time"
3.2 按话题筛选想要的话题
rosbag filter input.bag output.bag "topic == '/topic1' or topic =='/topic2' or topic == '/topic3'"
3.3 同时筛选话题与时间段
rosbag filter input.bag output.bag "(topic == '/topic1' or topic =='/topic2' or topic == '/topic3') and (t.to_sec() >= start time and t.to_sec() <= end time)"

。。。持续更新。。。

Ubuntu

1.查看和更改默认python版本

1.1 检查可用python版本
$ ls /usr/bin/python*
/usr/bin/python2  /usr/bin/python2.7  /usr/bin/python3  /usr/bin/python3.8
1.2 查看确认可用备选方案
$ sudo update-alternatives --list python
/usr/bin/python2
/usr/bin/python3
1.3 选择可选python版本
$ sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).
  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3   2         auto mode
  1            /usr/bin/python2   1         manual mode
  2            /usr/bin/python3   2         manual mode
Press  to keep the current choice[*], or type selection number: 1

。。。持续更新。。。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值