Skip to content
Vehicle properties
ADAS & driver assistance

ULTRASONICS_SENSOR_MEASURED_DISTANCE

What it is

The distance reading of the nearest detected object per sensor in millimeters.

Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's measured distance formatted as [distance, distance_error] where:

    int32Values[0] = distance, the measured distance of the nearest object in millimeters.
                     If only a range is supported, this value must be set to the minimum
                     supported distance in the detected range as specified in
                     ULTRASONICS_SENSOR_SUPPORTED_RANGES.
    int32Values[1] = distance_error, the error of the measured distance value in
                     millimeters.

If no object is detected, an empty vector must be returned. If distance_error is not available then an array of only the measured distance must be returned.

If the data is aggregated by another ECU, then OEMs have the option of reporting the same reading across all included sensors or reporting a virtual representation of all the included sensors as if they were one sensor.

How the ID is built

A property ID is a 32-bit value packing four fields. Reading 0x18410c25 apart:

FieldMaskValueMeans
Group0xf00000000x10000000SYSTEM
Area0x0f0000000x08000000VENDOR
Type0x00ff00000x00410000INT32_VEC
Ordinal0x0000ffff0x00000c250xc25

Reading it from an app

CarPropertyManager mgr = (CarPropertyManager)
        car.getCarManager(Car.PROPERTY_SERVICE);

mgr.registerCallback(callback,
        VehiclePropertyIds.ULTRASONICS_SENSOR_MEASURED_DISTANCE,
        CarPropertyManager.SENSOR_RATE_ONCHANGE);

This property is read-only — writes are rejected. It changes continuously, so subscribe at a sample rate rather than polling.