当前位置:网站首页>Rosbag use command

Rosbag use command

2022-06-22 15:50:00 Wang bupian

rosbag It's based on ros The topic data recording and playback tool of the system , in application , have access to bag File to save and restore the running state of the system , It is often used for initial data acquisition and DEBUG.
Commonly used instructions include :
1 - record: Record a with the specified topic bag package
2 - info: Display a bag Basic information about the package , For example, what topics are included
3 - play: Play back one or more bag package
4 - reindex: Re index one or more corruption bag package

One 、bag Recording

(1) Record all topic data
rosbag record -a
(2) Record the data of the specified topic
rosbag record <topic_name1> <topic_name2> <topic_name3> …
(3) Specify package name
rosbag record -O <topic_name1> <topic_name2> <topic_name3> …
Be careful :-O Need to be capitalized
Use it with your own camera commands **************

1. Use ros Turn on the camera and IMU :roslaunch realsense2_camera lee_test.launch

2. adjustment IMU Frequency of release :rosrun topic_tools throttle messages /camera/imu 150.0 /imu

3. The recording command is :rosbag record -O D455 /imu /camera/color/image_raw


Two 、bag Information view

rosbag info The instruction can be the topic name contained in the packet , Number of topics , Topic message type and other information :

(1)rosbag info

# 3、 ... and 、bag Play
(1) Playback assignment bag

rosbag play

(2) Play back all the files in the current directory bag
rosbag play *
(3) From the specified time (n = Specify time s) Start playback bag

rosbag play -s n
(4) Delay for a specified time (n = Delay Time s) Start playback bag

rosbag play -d n
(5) Play the specified time (n = Specify the number of seconds ) Of bag

rosbag play -u n
(6) From the specified time (n = Starting time s) Start playing at the specified time (m = Specify the playback time s) Of bag

rosbag play -s n -u m
(7) At the specified magnification (n = Magnification ) The playback bag

rosbag play -r n

3、 ... and 、bag Repair

Playback failed , Tips reindex , be :

rosbag reindex

Link to the original text :https://blog.csdn.net/chen_mp/article/details/123381936

原网站

版权声明
本文为[Wang bupian]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221432280404.html