Skip to content

XR_EXT_plane_detection API

Christoph Haag requested to merge haagch/monado:plane_detection into main

This implementation flattens the polygon info and vertices of a plane detection result into a single array and stores indices in adjacent arrays, see the comment above xrt_plane_detections_ext for more details.

It uses a "clever" scheme of caller/owns/caller-may-allocate/callee-reallocs-if-necessary for the flat polygon and vertex arrays of a plane, which allows passing pointers to members of the oxr_plane_detector_ext directly to the xrt_device (initially NULL pointers, reallocated whenever a new plane detection result requires more space), as well as passing pointers to preallocated members of the ipc_plane_detections_ext to the xrt_device (a single set of polygon + vertex array preallocated with max size). Therefore it is the responsibility of the xrt_device, not to exceed those max limits found in xrt_limits.h and return an error instead (the arrays in the shared memory of the IPC layers can not be reallocated).

This accommodates current limitations of the IPC layer where shared memory can not be dynamically allocated.

This implementation will add a fixed amount of about 70 megabyte of shared memory (ram) use to monado-service. image

Merge request reports