Robot Operating System ROS learning the actual articles ------ playback rosbag package

ROS research continues, today's content is played back rosbag package.

1: Recording rosbag

1  cd catkin_ws into the working space #
 2 mkdir bagfile / # Create a folder bagfile
 3 sudo chmod -R 777 ~ / catkin_ws / bagfile / modify folder permissions #
 4 cd bagfile / # folder into the bagfile
 5 rosbag the Record record release -a # the topics

2: Start topic node, the news release continues to spend a written, there are ambiguities can point here to see the message publisher and subscriber

1 cd ~ / catkin_ws into the working space #
 2 rosrun pub_sub_test pub_string # topic to start publishing

 

3: Playback rosbag

1 rosbag info 2019-08-23-02-18-48.bag # View playback information
path:        2019-08-23-02-18-48.bag
version:     2.0
duration:    21.4s
start:       Aug 23 2019 02:18:48.00 (1566551929.00)
end:         Aug 23 2019 02:19:10.41 (1566551950.41)
size:        113.9 KB
messages:    639
compression: none [1/1 chunks]
types:       rosgraph_msgs/Log [acffd30cd6b6de30f120938c17c593fb]
             std_msgs/String   [992ce8a1687cec8c8bd883ec73ca41d1]
topics:      /chatter      212 msgs    : std_msgs/String  
             / rosout 215 msgs: rosgraph_msgs / Log (2 connections)
              / 212 rosout_agg msgs: rosgraph_msgs / Log
1 rosbag Play 2019-08-23-02-18-48.bag # topics Playback

 Even more than the completion of the easiest recording and playback functions, and other complex scenarios only after free and then slowly toss ......

Guess you like

Origin www.cnblogs.com/chxuyuan/p/11401740.html