
Can RVIZ read lidar data directly?
No.
The 'only' thing RViz does is visualise dataflows that publishers are already publishing.
If you want to visualise your lidar data, you'll have to write a node that reads in the CSVs, transforms the data into the appropriate ROS msg (typically a sensor_msgs/LaserScan
or sensor_msgs/PointCloud2
) and then publishes those. In RViz, add the corresponding display (for laser scans or pointclouds), select your topic and you should see the scans visualised.
Another approach could be to convert the CSV files into rosbags (using the Python API fi) and use rosbag play ..
to publish everything. That way you wouldn't have to write a node, but only a (small?) conversion script. You would still use the same messages, but only write them out to the bag file.
Originally posted by gvdhoorn with karma: 86574 on 2016-11-27
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by chenbao on 2016-11-29:
I really appreciate your help.
I started RVIZ online tutorial recently, they use c++ to creat markers or graphs. If you wan to display the marker or graph in rviz, you need to publish the message first, and I think you also to need to set frame_id and marker topic. But how to do them in Python? Th
Comment by chenbao on 2016-11-29:
For example, the way to define the frame_id is to use the c++ command " points.heafer.fram_id="/my_frame" " and set marker topic using command " points.ns="points_and_lines" ". In this case the framID is called /my_frame and you can insert it in rviz fix fram blanket.
Comment by gvdhoorn on 2016-11-30:
I'm not sure I'd use Markers for this. The rosbag approach seems like the least amount of work, unless you are only interested in a static visualisation (of a single scan).