The HeadlightController module creates handle of type dwHeadlightControllerHandle_t
. This handle is owned by the application and must be released by the application when not needed anymore.
Before you contruct your headlight controller, you need to know your camera type in advance, at this moment, only type DW_CAMERA_GMSL_AR0231 is supported.
Headlight controller has very simple APIs, an exmple below shows how to use it.
where ctx
is an initialized instance of dwContextHandle_t
.
Control value is a float number within range [0.0, 1.0], the value was fine tuned to make sure when control signal level >=0.5, car should turn on headlight.
Function dwHeadlightController_computeControlLevel()
should be called for each camera frame within in the main loop, a low pass filter was exploited to reduce flickering which requires consective function call to maintain the updates.
For more details see Headlight Controller Sample.