1. roscore
xxx@xxx-Lenovo-2019:~$ roscore
2. 打开rviz
ctrl+shift+T,新建命令行窗口,输入:
xxx@xxx-Lenovo-2019:~$ rosrun rviz rviz
3. 配置rviz的参数
一定要先配置rviz的参数,不然 rosbag run的时候会报错。
选择左下角Add,选择pointcloud2, ok
设置Global Options - Fixed Frame为livox_frame;
设置PointCloud2 - Topic为/livox/lidar;
设置PointCloud2 - Style为Points。
4. 在bag所在的空间play
我把我的bag放在了工作空间里。
ctrl+shift+T,新建命令行窗口,进入工作空间
xxx@xxx-Lenovo-2019:~$ cd ~/catkin_ws
catkin_make
xxx@xxx-Lenovo-2019:~/catkin_ws$ catkin_make
play rosbag数据,可以在rviz看到可视化效果。
xxx@xxx-Lenovo-2019:~/catkin_ws$ rosbag play xxxxx.bag
