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
。。。持续更新。。。