ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

How to plot LIDAR data in RVIZ

asked 2016-11-26 19:28:06 -0500

chenbao gravatar image

Right now what I have are some csv lidar scan files. I also using Python to extract the csv file to be able to plot all the cloud data in Python. Can RVIZ read lidar data directly? Is there any tutorial that I can check?

I really appreciate the help from anyone who can provide any information.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-11-27 03:59:56 -0500

gvdhoorn gravatar image

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.

edit flag offensive delete link more

Comments

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

chenbao gravatar image chenbao  ( 2016-11-29 19:07:22 -0500 )edit

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.

chenbao gravatar image chenbao  ( 2016-11-29 19:14:57 -0500 )edit

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).

gvdhoorn gravatar image gvdhoorn  ( 2016-11-30 04:06:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-11-26 19:28:06 -0500

Seen: 2,208 times

Last updated: Nov 27 '16