Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created shape generator in simulation module #895

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mschoeler
Copy link
Contributor

This pull-request is the second part of my GSOC 2014 project.

  • Adds the shape generator to PCL within the simulation module.
  • Added simulation to doxygen generation
  • Added an example under pcl_example_shape_generator.
  • Added two tools, generate_shape and convert2pcd
    • generate_shape uses instructions found in text files to assemble scenes and objects
    • convert2pcd can read stl and obj file and samples on the faces with a given point density and saves a pcd file (unlike obj2pcd it samples on faces rather than on the vertices, allowing constant point density).

comparison_obj2pcd_convert2pcd

@mschoeler mschoeler force-pushed the shape_generator branch 2 times, most recently from 151816e to 0911f66 Compare September 10, 2014 15:35
@taketwo taketwo added this to the pcl-1.8.0 milestone Sep 10, 2014
* \author Markus Schoeler ([email protected])
* \ingroup simulation
*/
struct EIGEN_ALIGN16 PointXYZLNormal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jspricke Would it make sense to promote this to the default collection of point types?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense :).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have PointXYZLNormal or PointXYZRGBLNormal as a common point type? The latter will get quite large, although the RGB fields could proof useful in other scenarios.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see PCL uses a float[4] padding in PointXYZINormal for the data anyway. So I guess using curvature, label and rgb would actually take the same amount of space as curvature and label?!?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess using curvature, label and rgb would actually take the same amount of space as curvature and label

Yes, you are right. Though the fact that it is possible to add other fields does not necessarily mean that this is ought to be done. I would say let's wait until we face those other scenarios that need the complex type. But this particular contribution only needs PointXYZLNormal.

@mschoeler mschoeler force-pushed the shape_generator branch 2 times, most recently from 9e07ed9 to 5e15e11 Compare October 14, 2014 09:05
@mschoeler mschoeler force-pushed the shape_generator branch 2 times, most recently from ae8add6 to fc20a32 Compare October 16, 2014 08:06
* \note Templated function which copies only the fields available in out_cloud. Possible fields are x, y, z, label and normals.
*/
template <typename PointOutType> inline void
getCloud (typename pcl::PointCloud<PointOutType> &out_cloud) const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't getCloudConstPtr() already sufficient? Someone who needs a deep copy can always invoke copyPointCloud() by himself...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taketwo: Actually I reconsidered your comment about generate returning the cloud. I think it would make the interface much more comprehensive and also save memory as the shape classes would just consist of lighweight functions instead of dynamically allocated objects like pointclouds . Also that way we do not need the getCloud.. and copyPointCloud functions at all.
However this would prevent transforming the generated clouds afterwards, which I guess is not so important anyway. It should not be too much work to do this.

@taketwo
Copy link
Member

taketwo commented Oct 16, 2014

Could you please change the type of uint variables (breaks compilation on VS, see #955)? For example, in loops like for (uint cs1 = 0; cs1 < shapes_ptrs_.size (); ++cs1) it's appropriate to use size_t, because this is precisely what size() returns.

@mschoeler mschoeler force-pushed the shape_generator branch 2 times, most recently from 8bd7a83 to c0d44cb Compare October 16, 2014 13:33
@mschoeler mschoeler force-pushed the shape_generator branch 2 times, most recently from d13ac1c to c75ba9f Compare December 5, 2014 13:16
Added the tool generate_shape and the example pcl_example_shape_generator
Added simulation to doxygen generation
Added ply, obj and stl file sampler under tools convert2pcd

Changed the interface to the shape generator. generate will return a shared pointer. Removed other pointcloud getter functions.
Shapes are now lightweight classes (mainly functions) and pointclouds are generated, but not stored in the class.
@taketwo taketwo removed this from the pcl-1.8.0 milestone Oct 11, 2015
@Comonk
Copy link

Comonk commented Jun 16, 2016

There may be an error while generating the surface normals of the torus. I used the algorithm to create a test dataset and attached at each point the normal. The result is seen in the picture below.
torus_normals_false

By changing the two values of y and z of the normals. The result seems to be more accurate:
torus_normals

@SergioRAgostinho SergioRAgostinho added the needs: code review Specify why not closed/merged yet label Aug 22, 2016
@SergioRAgostinho SergioRAgostinho added this to the pcl-1.9.0 milestone Aug 22, 2016
@SergioRAgostinho
Copy link
Member

This is a nice "hidden gem" in the closet. :) I know it's been some time since you contributed this, but I still have to ask,

Merge conflict (mandatory)

Can you rebase this post our 1.8.1 release?

Unit tests (mandatory)

I've noticed you haven't submitted any unit tests with your code, although I'm sure you must have used something to validade its output. Could you please submit that as well.

Tutorial (optional)

Although not required and fully aware that you already submitted an example, it would be great if you could submit also a tutorial similar to this, very very briefly explaining the purpose of the simulation module and showcasing the capabilities of the functionalities you added. It really helps to promote your contribution as users tend to explore the tutorials, not really the repository. Especially considering it's probably going to be the first simulation tutorial :)

Thanks a lot for this 👍

@SergioRAgostinho SergioRAgostinho added needs: author reply Specify why not closed/merged yet and removed needs: code review Specify why not closed/merged yet labels Aug 22, 2016
@mschoeler
Copy link
Contributor Author

Hey Sergio, sorry for not replying earlier. I will try to work on it when I get some time. When is the release date for 1.9?
Cheers,
Markus

@SergioRAgostinho
Copy link
Member

Hey Markus. I'm really sorry for replying so late! I didn't reply the moment I received the notification and since this PR is so old and I don't come to "this section" very often, I forgot about it. :(

We released 1.8.1 in June this year and now we're incorporating all new features for 1.9.0. If you feel like you have some extra time at some point, we can now start working slowly into merging this.

@stale
Copy link

stale bot commented Jan 22, 2018

This pull request has been automatically marked as stale because it hasn't had
any activity in the past 60 days. Commenting or adding a new commit to the
pull request will revert this.

Come back whenever you have time. We look forward to your contribution.

@stale stale bot added the status: stale label Jan 22, 2018
@SergioRAgostinho SergioRAgostinho removed this from the pcl-1.9.0 milestone Jan 25, 2018
@stale stale bot removed the status: stale label Jan 25, 2018
@stale
Copy link

stale bot commented Mar 26, 2018

This pull request has been automatically marked as stale because it hasn't had
any activity in the past 60 days. Commenting or adding a new commit to the
pull request will revert this.

Come back whenever you have time. We look forward to your contribution.

@stale stale bot added the status: stale label Mar 26, 2018
@stale
Copy link

stale bot commented Feb 21, 2020

This pull request has been automatically marked as stale because it hasn't had
any activity in the past 60 days. Commenting or adding a new commit to the
pull request will revert this.

Come back whenever you have time. We look forward to your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: author reply Specify why not closed/merged yet status: stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants