NDT Map format validation
Description
Purpose
A simple helper function to validate a PointCloud2
's fields should be implemented.
This function should ensure that a point cloud intended to serve as a NDT reference map has the following format:
// PointCloud2
fields = {
// centroid
PointField{"x", 8, FLOAT64, 1},
PointField{"y", 8, FLOAT64, 1},
PointField{"z", 8, FLOAT64, 1},
// covariance, row major
PointField{"cov_xx", 8, FLOAT64, 1},
PointField{"cov_xy", 8, FLOAT64, 1},
PointField{"cov_xz", 8, FLOAT64, 1},
PointField{"cov_yy", 8, FLOAT64, 1},
PointField{"cov_yz", 8, FLOAT64, 1},
PointField{"cov_zz", 8, FLOAT64, 1},
}
In addition, this function should also ensure that the meta-data (i.e. length, height, row_step, etc.) is consistent with the data and the fields.
Desired Behavior
This function should:
- Check that the appropriate fields exist and are in order (with no extraneous fields)
- Check that metadata is consistent
- (Optional) provide an index or iterator to last safe point (in case the
data
member is unexpectedly long or short)
Definition of Done
-
Tests are written for function -
Function is implemented
Edited by Yunus Emre Çalışkan