astrobee icon indicating copy to clipboard operation
astrobee copied to clipboard

PointCloud2 messages from Pico Flexx should have "fields" metadata describing all fields of the point

Open trey0 opened this issue 3 years ago • 0 comments

Currently, the fields metadata in Pico Flexx PointCloud2 messages describes only the fields x, y, and z, all with float32 type. That adds up to only 12 bytes, but the point_step is 20 bytes.

Presumably the full 20-byte point is described by this data structure from libroyale (/usr/include/royale/DepthData.hpp):

struct DepthPoint
    {
        float x;                 //!< X coordinate [meters]
        float y;                 //!< Y coordinate [meters]
        float z;                 //!< Z coordinate [meters]
        float noise;             //!< noise value [meters]
        uint16_t grayValue;      //!< 16-bit gray value
        uint8_t depthConfidence; //!< value from 0 (invalid) to 255 (full confidence)
    };

The field sizes in the struct add up to 19 bytes, and a final pad byte for 4-byte alignment would bring it up to 20.

Assuming this interpretation is correct, the missing data fields noise, grayValue, and depthConfidence should be added to the fields metadata, documenting their presence and making them easier to extract using standard point-cloud processing tools.

This is not a high-priority task, because nobody is actively using the fields. Ryan mentioned he might want to use the depthConfidence field to improve depth-based localization.

trey0 avatar Feb 08 '22 00:02 trey0