Open spuetz opened 7 years ago
@tfoote I changed the things you commented. The PointCloud2Modifier::addPointCloud2Fields
as well as the whole PointCloud2Modifier
will only work at creation time of a PointCloud2. Once the buffer is filled, the step size is fixed. That should be clear for the developers using that class.
Having the PointCloud2Modifier::addPointCloud2Fields(const std::vector<PointFieldInfo>& fields)
method with a vector of PointFieldInfo
will enable dynamic point field and point cloud creation at run time. For example you could switch on and off some fields in a laser scanner driver.
The next thing I want to do here is working on the PointCloud2Iterator
to enable organized point structure access with something like a matrix access operation, e.g. cloud(i, j)
, which is very useful for organized clouds to enable a fast access of neighboring points in the cloud. However, it would be very good to finish this pull request fast, so that I could start the next one. ;)
@tfoote
Hi @tfoote we would need the pull request now for the Sick MRS1000 Driver to dynamically enable a intensity channel in the point cloud.
Thanks for resolving the direct comments. However it still does not have any test coverage of the new API, they would also provide examples of how it's designed to be used which would be helpful in checking the design.
We're approaching Melodic release and getting this in before then would be great.
Okay I'll add one or more tests in the next days. Thank you. Would be could to have it in Melodic.
Are there any news about this PR?
We are planning on writing some tests soonish. @ctieben Do you need the feature?
I’m interested in this PR and looking forward to using these changes in some future experiments. It would be great to have this in the default branch / repos.
This enhancement enables a dynamic creation of sensor_msgs::PointCloud2 messages with dynamic point fields at creation time of the cloud. This means a node or driver providing sensor_msgs::PointCloud2 clouds can now publish configurable clouds. That is useful for devices which provide much extra information to each point in the cloud. With this enhancement, e.g. the user of a high resolution laser scanner, could configure which extra information should be published within the cloud. This is useful to only publish necessary information and to keep the network communication load smaller.
With the method
bool PointCloud2Modifier::addPointCloud2Field(std::string name, std::string datatype)
it is now possible to dynamically add fields if a field was enabled in the config.