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
Add MAKE_ORGANIZED parameter #789
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good! But please, take a look at my review comments. If possible, please do a git rebase so the changes all appear as one single commit (the mrpt git tree is quite large already...)
@@ -1200,6 +1200,10 @@ class PointCloudAdapter<mrpt::maps::CPointsMap> | |||
inline size_t size() const { return m_obj.size(); } | |||
/** Set number of points (to uninitialized values) */ | |||
inline void resize(const size_t N) { m_obj.resize(N); } | |||
/** Does nothing as of now */ | |||
inline void setDimensions(const size_t& height, const size_t& width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method does NOT need to be added here... it's enough to have the empty setDimensions() method in the PointCloudAdapter specialization for all MRPT classes, and only make it to have a real effect in the PCL specialization, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add the method to other specializations too because project3DPointsFromDepthImageInto
gets instantiated using the non-pcl types too. For instance, here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because project3DPointsFromDepthImageInto gets instantiated using the non-pcl types too.
Sure... but if I recall it right, it internally instantiates a PointCloudAdapter (PCA) of the required target type as template argument. Then, my point is: shouldn't it be setDimensions()
a method of the PCA instead of the base, target types? In this way, only one PCA should be modified to add a dummy (empty) setDimensions()
method, the version for all MRPT classes. Only the specialization for PCL should have a setDimensions()
method with real stuff inside.
Let me know if this makes now sense to you...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes sense. I did try to do that at first, but I couldn't actually find the definition for the class template PointCloudAdapter
adapter anywhere... The class declaration is here, but only specialization specific definitions have been written, I think.
Or maybe I'm wrong..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I try to write the base template definition by myself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! It's done like that to avoid the need for an actual base virtual class. In this way, all methods are perfectly known at build time, and can even be inlined (typically).
Please, just add the new method to the specializations (I may have missed some, please do a search):
mrpt/libs/maps/include/mrpt/maps/CPointsMap.h
Line 1178 in 46d80fc
class PointCloudAdapter<mrpt::maps::CPointsMap> class PointCloudAdapterHelperNoRGB class PointCloudAdapter<mrpt::maps::CColouredPointsMap> class PointCloudAdapter<mrpt::maps::CWeightedPointsMap>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: my fault. I didn't realize you added the methods to PointCloudAdapter<mrpt::maps::CPointsMap>
, it seemed to me that the method was added to CPointsMap
directly! So, it's good!
@@ -177,6 +177,10 @@ class PointCloudAdapter<mrpt::maps::CSimplePointsMap> | |||
inline size_t size() const { return m_obj.size(); } | |||
/** Set number of points (to uninitialized values) */ | |||
inline void resize(const size_t N) { m_obj.resize(N); } | |||
/** Does nothing as of now */ | |||
inline void setDimensions(const size_t& height, const size_t& width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here...
T3DPointsProjectionParams() | ||
: takeIntoAccountSensorPoseOnRobot(false), | ||
robotPoseInTheWorld(nullptr), | ||
PROJ3D_USE_LUT(true), | ||
USE_SSE2(true), | ||
MAKE_DENSE(true) | ||
MAKE_DENSE(true), | ||
MAKE_ORGANIZED(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to add this,
MAKE_DENSE does not actually preserve the "organization" of the point cloud. It is only used to control whether or not the points can have nan / undefined values. If MAKE_DENSE is true, the cloud simply cannot contain undefined points and all the points contain finite values.
@@ -828,6 +832,11 @@ class PointCloudAdapter<mrpt::obs::CObservation3DRangeScan> | |||
if (N) m_obj.hasPoints3D = true; | |||
m_obj.resizePoints3DVectors(N); | |||
} | |||
/** Does nothing as of now */ | |||
inline void setDimensions(const size_t& height, const size_t& width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here...
@@ -334,6 +334,10 @@ class PointCloudAdapter<mrpt::opengl::CPointCloud> | |||
inline size_t size() const { return m_obj.size(); } | |||
/** Set number of points (to uninitialized values) */ | |||
inline void resize(const size_t N) { m_obj.resize(N); } | |||
/** Does nothing as of now */ | |||
inline void setDimensions(const size_t& height, const size_t& width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here...
@@ -299,6 +299,10 @@ class PointCloudAdapter<mrpt::opengl::CPointCloudColoured> | |||
inline size_t size() const { return m_obj.size(); } | |||
/** Set number of points (to uninitialized values) */ | |||
inline void resize(const size_t N) { m_obj.resize(N); } | |||
/** Does nothing as of now */ | |||
inline void setDimensions(const size_t& height, const size_t& width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah! Please, add this change to the docs/doxygen-pages/changelog.h list of changes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the changes you requested!
And did a git commit --amend, to make it one commit. Hope that's okay.
b5267af
to
e8df091
Compare
@@ -11,6 +11,9 @@ | |||
|
|||
#include <mrpt/core/round.h> // round() | |||
|
|||
#include <pcl/point_cloud.h> | |||
#include <pcl/point_types.h> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ey! Red alarm here! :-)
We can't assume PCL is installed, since PCL is an optional dependency for MRPT.
I think you could remove those headers and all should build nice. Why did you add them?
For the templates for build, it's enough to have forward declarations, and in any case, the PCL headers included in the user code (the caller that includes this file).
So, please, remove those two includes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry. Removed those two includes and checked the build. No issues.
Pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the PCL includes are removed, this can be merged.
* Added MAKE_ORGANIZED parameter to T3DPointsProjectionParams to be able to generate an organized pcl point cloud from a 2D range image * Appropriately set pcl cloud dimensions
Good. Let's wait for the travis result... |
@jlblancoc Travis isn't passing in env variables to PR. That's a setting on travis. I'm not so worried about leaking docker hub credentials in this way because that account is only used for builds. It's just a risk if we enable builds for PR from outside of the main repo. |
PR Description
I acknowledge to have:
CONTRIBUTING
page(Notify: @MRPT/owners )