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 roads sensor is to be attached

GFXUpdateTime(float): How often the Advanced IMU 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 Advanced IMU 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


The following three functions can be used to send ad-hoc polling requests to an ideal RADAR sensor. This is for when we need to first send a request using sendIdealRADARRequest, then wait for it. We can check it is complete using isVluaRequestComplete then retrieve it using collectIdealRADARRequest.

requestId = extensions.tech_sensors.sendIdealRADARRequest(sensorId)

Args:

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

vid(int): id number that helps get 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.collectIdealRADARRequest(requestId)

Args:

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

Returns: data(table): The ideal RADAR readings


extensions.tech_sensors.setIdealRADARUpdateTime(sensorId, vid, updateTime)

Args:

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

vid(int): the id number which leads to the vehicle id.

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

Returns: nil


extensions.tech_sensors.removeIdealRADARSensor(sensorId)

Args:

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

Returns: nil.

Last modified: October 4, 2023
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.