RangeFinder PC2 Data meaning

Typically: "How do I... ", "How can I... " questions
Post Reply
formica
Posts: 60
Joined: 13 Mar 2013, 12:13

RangeFinder PC2 Data meaning

Post by formica »

Hi Coppelia,
looking at the PointCloud2 sent by the Hokuyo through a ROS topic I do not understand the meaning of the values in the cloud.
They are formatted in this way: every 12 values there is a point. The first three value are interesting for me since they are the x,y,z coordinates.
The question is about the type/range of the values: they seems to be CHARS (from 0 to 255)
How is it possible to record a coordinate of the VREP scenario in a char? Should they be floats?

Thanks in advance
Roberto

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: RangeFinder PC2 Data meaning

Post by coppelia »

Hello Roberto,

are you referring to the simros_strmcmd_get_range_finder_data message? That message is generated by reading string data, prepared by a child script. Basically the point data will be packed into a string, then unpacked by the ROS plugin and sent to the ROS world as a PointCloud2 message.

So, each 3D point, normally represented by 3 float values, will be represented by 3*sizeof(float)=12 chars in the string.

Cheers

formica
Posts: 60
Joined: 13 Mar 2013, 12:13

Re: RangeFinder PC2 Data meaning

Post by formica »

Thanks coppelia.
I just discovered that is it possible to convert the message to pcl::PointCloud<pcl::PointXYZ> using pcl::fromROSMsg().

Regards
formica

Post Reply