DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Headlight Controller Sample
SW Release Applicability: This sample is available in NVIDIA DRIVE Software releases.


The Headlight Controller sample demonstrates the usage of dwHeadlightController related APIs. Headlight Controller is an module to provide the feature that automatically turn on/off the headlight(low beam) according to environment ambient intensity change without driver's intervention.

The video file is expected to be an RCCB RAW/LRAW file.

Running the Sample

The command line for the sample application is:

./sample_headlight_controller --input-type=[video|camera]


        Defines if the input is from live camera or from a recorded video.
        Live camera is supported only on NVIDIA DRIVE(tm) platforms.
        It is not supported on Linux (x86 architecture) host systems.
        Default value: video

        Specifies the absolute or relative path of a raw, lraw or h264 recording.
        Only applicable if --input-type=video
        Default value: path/to/data/samples/headlight/into-tunnel.lraw

        Only applicable if --input-type=camera.
        Default value: ar0231-rccb-bae-sf3324

        Is the group where the camera is connected to.
        Only applicable if --input-type=camera.
        Default value: a

        Indicates the camera index on the given port.
        Default value: 0


To run the sample on a video

./sample_headlight_controller --input-type=video --video=<video file.raw>

To run the sample on a camera on NVIDIA DRIVE platforms

./sample_headlight_controller --input-type=camera --camera-type=<camera type> --camera-group=<camera group> --camera-index=<camera idx on camera group>


The output of the sample code is a video window, on the right side, it will display current control level and headlight control status.

headlight controller sample screenshot

For headlight device without intensity output control, threshold 0.5 should be used for the indicator of on/off, value greater equal with 0.5 should be treated as turn on signal.

For headlight device with intensity output control, you could choose the mapping range from [0.5, 1] to your can message control signal value according to fit you calibration requirement.

Additional Information

For more information, see Camera-based Headlight Controller.