PCL library and binary format

Feel free to ask any question here
luke_penn
Posts: 13
Joined: Sun Oct 23, 2011 3:54 pm

Re: PCL library and binary format

Post by luke_penn »

daniel wrote: Hello,

LAS file is typically the example of what shouldn't be done in CC ;). It's quite a hassle to compile liblas (because of the boost dependency mainly) and we should definitely have opted for a purely plugin-based solution at that time (instead of putting it directly in the main CC executable as an I/O filter, bringing a lots of dependencies to third-party libraries). It is now deactivated by default and I only keep a working version of liblas to compile the official (Windows) release. As soon as the Cmake project for CC is ready (soon ?), it will be much easier to handle such cases (with check-boxes to enable or not liblas support, and the library installation path to setup if it's enabled).
I imagined this answer, I am really happy CloudCompare is migrating to CMake, this was another question I would ask. So I could write the plugin using cmake from now? Is there any problem doing this?
daniel wrote: - otherwise you create one big plugin that spawns a toolbar like dialog each time you click on it. It will then apply the user selected action (same list as above) on the currently selected cloud (as plugins have automatically access to the selected entities. And they can also output new clouds that are automatically added to CC main database). You just have one plugin project to handle and you can share a lot of code. I think it's definitely the solution to start with (waiting for a better integration, thanks to Cmake). It will also be easier to re-use the code as a separate class/library once a proper integration could be realized.
At now my plugin exactly does this! Happy to know this is a good solution.
daniel wrote: I looked at PCL code and tutorial and I couldn't see what is the problem with loading PCD files? If you check either the 'test' folder, or the tutorial (http://pointclouds.org/documentation/tu ... eading-pcd), you'll see that you first have to load the undefined PCD cloud in a "blob" structure:

Code: Select all

sensor_msgs::PointCloud2 cloud_blob;
pcl::io::loadPCDFile ("test_pcd.pcd", cloud_blob);
Then convert it to the type of cloud you are able to handle:

Code: Select all

pcl::fromROSMsg (cloud_blob, *cloud);

No is not a problem to load PCD files if PCL is installed on the system. I only need to write some functions to "translate" PCD files to CC format, in the various cases (and vice-versa).
daniel wrote: In the case of CC, 'cloud' will typically be of type pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr. I'm not sure how to handle scalar fields (I guess that PCL offers an equivalent concept?)
Scalars are included in the point type in PCL, for example if I want to store a scalar field called distance in a PointXYZI (euclidean coordinates + intensity value) I need to define a new point type in this way (a point is a structure):

struct PointIntDist //point strucure with just a distance value
{
float intensity;
float distance;
float x;
float y;
etc...
EIGEN_MAKE_ALIGNED_OPERATOR_NEW // make sure our new allocators are aligned
} EIGEN_ALIGN16; // enforce SSE padding for correct memory alignment

And then create a cloud in this way:
pcl::PointCloud<PointIntDist> cloud;

see for more info:
http://pointclouds.org/documentation/tu ... stom-ptype

daniel wrote: Don't hesitate to share your plugin project with me in order to work on all those points as most efficiently as possible (and contact me directly by mail also).
I would like to complete some basics of my plugin and to document it so you can have a look at this project in the most efficient way possible before send it to you. I'll begin migrating to CMake if you dont think this will cause problems.

Ill write directly to you (Ill use the mail in your CV) when ready

If you want you could have a look at what I have wrote here:
http://dl.dropbox.com/u/1581441/qPCL.tar.bz2

There are many thing that need to be fixed, but something is working :-)

Thank you Daniel
daniel
Site Admin
Posts: 7374
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: PCL library and binary format

Post by daniel »

Great work! As soon as you tell me, I'll add the plugin to the main trunk (or even better, I'll let yourself push it in with a personalized account - so you'll be able to do some maintenance ;). It will be also easier for me to do minor corrections (if necessary).

For CMake, let's wait a little bit (in order to get something harmonized with the other plugins).

Thank you for the great job,

Daniel
Post Reply