ROS reads the bag package and converts it to a pcd file

1 Install ROS

For details, please refer to other tutorials

2 start ROS

Open terminal 1, enter roscore to start ros, as shown in the figure below

roscore

insert image description here

3 open rviz

Open terminal 2 and enter rosrun rviz rviz, as shown in the figure below

rosrun rviz rviz

insert image description here

4 View bag package information

Open terminal 3, execute rosbag info your_bag_file_name.bag to view topic information, as shown in the figure below

rosbag info yourbagname.bag

insert image description here

6 Locally publish the point cloud information of the bag package

As shown below

rosbag play yourbagname.bag

insert image description here

5 read bag package

1) Click the Add button in the lower left corner: Add, select PointCloud2 in by display type, and click ok;
insert image description here
2) Modify Fixed Feame to base_link;
3) Modify Topic to bag corresponding Topic;
4) Modify Style to Points. (in the form of a point cloud)
insert image description here

6 Convert bag data to pcd format

rosrun pcl_ros bag_to_pcd yourbagname.bag yourbagtopic outputpath

yourbagname.bag: your bag file
yourbagtopic: the topic corresponding to your bag file
outputpath: pcd point cloud save path

insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/weixin_44606139/article/details/130906415