christianrauch / camera_ros

ROS 2 node for libcamera supported cameras (V4L2, Raspberry Pi Camera Modules)
https://libcamera.org
MIT License
69 stars 30 forks source link

handle dynamic extents #15

Closed christianrauch closed 3 months ago

christianrauch commented 1 year ago

Dynamic Spans have a maximum extent for the Control<Span<Type>> but a variable number of elements for the ControlValue in the ControlInfo. For dynamic Spans with a single element, this previously caused the exception std::length_error since a vector with "maximum extent" (dynamic_extent) elements was constructed. Additionally, libcamera allows controls to have default and min/max values of different types than the control.

This PR thus changes the behaviour of how libcamera controls are mapped and converted to ROS parameters in the following way:

Altogether, this will ensure that we do not attempt to convert controls that are typed with an unsupported type, such as arrays of complex types (e.g. Control<Span<const Rectangle>>), independently of the variable types in the ControlInfo which is set by the IPA or pipeline.

Fixes #13, Fixes #50.