Ideal RADAR

Overview

The ideal RADAR sensor provides kinematic and other data of the closest vehicles within a predifined (or set by the user) distance. The number of closest vehicles of interest is easy to increase or decrease. The data that refers to each vehicle includes the vehicle ID, the length and width of the object, the relative distance, velocity and acceleration to the host vehicle.

Usage

The ideal RADAR sensor code is written in Lua code and has an API similar to the other sensors in our suite.


sensorId = extensions.tech_sensors.createIdealRADARSensor(vehicleId, args)

Args:

vehicleID(int): The vehicle ID, to which the ideal RADAR sensor is to be attached.

GFXUpdateTime(float): How often the ideal RADAR sensor should update its readings in the simulator (in seconds). This determines how often the user will be able to retrieve a new reading from the sensor.

physicsUpdateTime(float): How often in the simulator’s physics step, we should update the ideal RADAR readings (in seconds).

Returns: sensorId(int): The unique Id number of this sensor, useful to refer to it hereafter, for example when closing it.


readings = extensions.tech_sensors.getIdealRADARReadings(sensorId)

Args:

sensorId(int): The ID number of the ideal RADAR sensor.

Returns: readings(table): The latest readings from the sensor.


requestedUpdateTime = extensions.tech_sensors.getIdealRADARRequestedUpdateTime(sensorId)

Args:

sensorId(int): The ID number of the ideal RADAR sensor.

Returns: requestedUpdateTime(float): The current GFXUpdateTime used by this ideal RADAR sensor.


extensions.tech_sensors.setVluaSensorRequestedUpdateTime(extensions.tech_sensors.stype.tIdealRADAR, sensorId, vid, updateTime)

(Note: setIdealRADARUpdateTime(sensorId, vid, updateTime) is deprecated and logs a warning.)

Args:

sensorId(int): The ID number of the ideal RADAR sensor.

vid(int): The vehicle ID.

updateTime(float): The new update time (GFXUpdateTime) for this sensor.

Returns: nil


The following three functions can be used to send ad-hoc polling requests to an ideal RADAR sensor. We need to first send a request using sendVluaExtensionRequest, wait for isVluaRequestComplete, then retrieve it using collectVluaRequest. (Note: sendIdealRADARRequest and collectIdealRADARRequest are deprecated and log a warning.)

requestId = extensions.tech_sensors.sendVluaExtensionRequest(sensorId, vid, 'tech_idealRADARSensor')

Args:

sensorId(int): The ID number of the ideal RADAR sensor.

vid(int): The vehicle ID.

Returns: The unique Id number of the ad-hoc sensor polling request which is being sent.


isComplete = extensions.tech_sensors.isVluaRequestComplete(requestId)

Args:

requestId(int): The ID number of the ad-hoc sensor polling request to check on.

Returns: isComplete(bool): True if the ad-hoc polling request has been completed, otherwise false.


data = extensions.tech_sensors.collectVluaRequest(requestId)

Args:

requestId(int): The ID number of the ad-hoc sensor polling request.

Returns: data(table): The ideal RADAR readings.


extensions.tech_sensors.removeIdealRADARSensor(vid, sensorId)

Args:

vid(int): The vehicle ID.

sensorId(int): The ID number of the ideal RADAR sensor to remove.

Returns: nil.

Last modified: November 23, 2026

On this page:

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.