ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Conversion of PointCloud2 back to VelodyneScan

asked 2018-11-18 07:31:00 -0500

Cicilia gravatar image

Hi friends, I am new for ROS. I am using Ubuntu 14.04 and ROS Indigo (Ubuntu 16.06 + ROS Kinetic as well) for sensor Velodyne VLP16 to modulate and simulate the sensor signal.

Now, I have used the ROS package velodyne_simulator to generate the simulated ideal sensor signal, and the data format is PointCloud2, with the ROS package pointcloud_to_laserscan the data format could be transformed as LaserScan.

My aim is to transform the simulated data PointCloud2 to the format of raw sensor signal, namely VelodyneScan.

I found the package velodyne_driver and velodyne_pointcloud, that could transform the VelodyneScan to PointCloud2.

So cloud anyone help to told me that how can I transform or convert the PointCloud2 back to VelodyneScan? Or is there already any ROS package or codes could do this conversion?

I really appreciate your answers and best wishes for you all.

edit retag flag offensive close merge delete

Comments

Can you please explain why it is you want to create such a setup? Are you interested in PointClouds at all, or would you rather work with simulated laserscans?

gvdhoorn gravatar image gvdhoorn  ( 2018-11-18 09:26:16 -0500 )edit

Thanks for your replay. I would like to work with simulated laserscans and compare them with the real laserscans. So I need to generate simulated laserscans with same format of the raw sensor data. But it seems like a big project and I don´t know how to implement it. Do you have any ideas? Thank you

Cicilia gravatar image Cicilia  ( 2018-11-18 09:44:29 -0500 )edit

What is the reason you want to use velodyne_pointcloud? There are Gazebo plugins that publish LaserScan msgs directly, and can "scan" arbitrary objects. If you could clarify why you want to use point clouds specifically, perhaps that could help providing you with alternatives.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-18 10:01:19 -0500 )edit

Yes you are right, I wanted to use PointCloud2 just because I thought there is already a package for the conversion of VelodyneScan to PointCloud2 , maybe it will be possible to convert it back. (but according to the answer of kmhallen below it seems unrealistic)

Cicilia gravatar image Cicilia  ( 2018-11-19 05:51:42 -0500 )edit

And the reason why I´m not sure I can use LaserScan is that firstly I don´t know how to order the data from 16 layers(lasers) together instead of data only from one ring, secondly the angular resolution isn´t enough, and thirdly it contains no info for reflective intensity. Sorry for the questions

Cicilia gravatar image Cicilia  ( 2018-11-19 05:54:54 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-11-18 20:41:24 -0500

kmhallen gravatar image

The VelodyneScan is just raw UDP packets, and the interpretation depends on which type of sensor generated the packets. There is nothing in ROS to convert backwards from PointCloud2 to VelodyneScan because that's not really useful.

I am not aware of anything that simulates the Velodyne laser scanners at the UDP packet level. It is much simpler to simulate the PointCloud2 directly, and that is the standard format for 3D data. I recommend comparing real and simulated data using the PointCloud2 format.

edit flag offensive delete link more

Comments

Thanks for your replay and advice. In order to combine the works with other colleagues I should bring this simulated signal into MATLAB (in the data format as similar as possible of raw data). So should I use rosbag to record and then process them in MATLAB or there are some wiser ways? Thank you.

Cicilia gravatar image Cicilia  ( 2018-11-19 06:11:09 -0500 )edit

I'm not familiar with MATLAB. I know MATLAB can read rosbag files, and MATLAB can communicate to a live roscore. I recommend asking a new question about MATLAB.

kmhallen gravatar image kmhallen  ( 2018-11-19 11:37:04 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-11-18 07:26:50 -0500

Seen: 450 times

Last updated: Nov 18 '18