.PLY file output

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

.PLY file output

Seck
Hello,

I have no prior mapping experience but I am using RTAB-Map to create a 3D image of a room. I have exported the cloud as a .ply format. I am then using Python Ply reader (pip install plyfile) to give me an output of the coordinates. It gives the following output:

code/ply code')
ply
format binary_little_endian 1.0
comment PCL generated
element vertex 2188310
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float nx
property float ny
property float nz
property float curvature
element camera 1
property float view_px
property float view_py
property float view_pz
property float x_axisx
property float x_axisy
property float x_axisz
property float y_axisx
property float y_axisy
property float y_axisz
property float z_axisx
property float z_axisy
property float z_axisz
property float focal
property float scalex
property float scaley
property float centerx
property float centery
property int viewportx
property int viewporty
property float k1
property float k2
end_header
[(4.210025 , -3.9631934, -0.38369063, 169, 169, 181, -0.26939332, -0.05563965, -0.96142155, 0.09232759)
 (1.6137965, -7.0459375, -0.34251526,  20,  15,  22, -0.5860401 ,  0.2150358 , -0.7812277 , 0.11243399)
 (4.0508547, -4.6344094, -0.34251526, 122, 119, 128, -0.5842595 ,  0.8115669 ,  0.        , 0.00064412)
 (4.097522 , -4.600813 , -0.34251526, 110, 109, 115, -0.7712584 ,  0.61405885,  0.16760689, 0.11311602)]



My goal is to get the coordinates of the individual points in the point cloud. My problem is I don't understand what the reference frame has been used to measure these points. Is it based on a global reference frame that gets updated when the robot relocalizes? The robot base link? I don't understand the relationship between the robot and the point cloud coordinates.

Also on the PLY data output above, what are the coordinate outputs? Is it (X,Y,Z, R, P, Y, ?, ?, ?, ?)

Thank you for your assistance! If you need any more information, please don't hesitate to ask. I don't know what I don't know at this point and am learning as I go.
Reply | Threaded
Open this post in threaded view
|

Re: .PLY file output

matlabbe
Administrator
Hi,

To visualize the PLY file, use CloudCompare or MeshLab. The point properties are defined in the header:
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float nx
property float ny
property float nz
property float curvature 

When you map, the origin of the map would be where you start mapping. Then the coordinates would be in meters. Did you use RTAB-Map Tango for scanning? or what is your setup/camera?

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: .PLY file output

Seck
Thank you for the quick response! I’ll have to look into the point properties a bit more as I’m not familiar with the terminology. (Like I said, very new and nothing makes sense yet) I have a turtlebot 2 with Kinetic and an Astra Orbec camera that I’m using to map my area. I’m following the mapping instructions on this tutorial:

http://wiki.ros.org/rtabmap_ros/Tutorials/MappingAndNavigationOnTurtlebot 

I can see the map in rviz but it doesn’t give me the coordinates of the points, only the robot poses. Are the robot poses based on a different coordinate system as well or is it also the origin of the map starting? I’ll definitely check out CloudCompare or Meshlab for getting the coordinates of the point cloud, thank you for that!
Reply | Threaded
Open this post in threaded view
|

Re: .PLY file output

matlabbe
Administrator

If you want the map's cloud, show cloud_map topic (PointCloud2 type) in rviz. You could then subscribe to that topic if you need to process the point cloud.

The points in cloud_map are in /map frame origin. Well for any point cloud topics, look at the frame_id in the header of the topic, then you will know in which frame the points are.

Show also TF in rviz if you didn't, it will show the frames used with turtlebot.

Reply | Threaded
Open this post in threaded view
|

Re: .PLY file output

Seck
Hello, does anyone have any information on the coordinates (property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float nx
property float ny
property float nz
property float curvature)

And what the use/which are used for what purpose?

Appreciate the responses and help!
Reply | Threaded
Open this post in threaded view
|

Re: .PLY file output

matlabbe
Administrator
These are properties of each point: X Y Z RGB NormalX NormalY NormalZ Curvature.

The XYZ are in meters, it is the position of the 3D point. RGB is the color of the point. The normalXYZ is a unit vector. Surface curvature, not sure exactly it means, but given by pcl https://pointclouds.org (it would tell how much the surface is curvy or a plane).