Adaptive Brake Lights

Summary

The adaptive brakelight controller allows to have brake lights that flash during very hard braking, as found on many modern cars.

It waits for the ABS starts to affect the braking and then starts to flash the lights. Additionally, it can also show when the ESC intervenes via the brakelights.


File Info

Filename adaptiveBrakeLights.lua
Path /lua/vehicle/controller/adaptiveBrakeLights.lua
Type Auxiliary
Usage type Multiple (Not useful)

JBeam Properties

Name
Default
Unit
Description
Name
electricsName
Default
brakelights
Unit
string
Description
The output electrics name, to be used as the source for the brakelights
Name
indicateESCUsageWithBrakelights
Default
true
Unit
bool
Description
Whether to display ESC actions with active brake lights
Name
activateHazardsAfterEmergencyBraking
Default
true
Unit
bool
Description
Automatically turns on the hazards when coming to an emergency stop
Name
hazardArmSpeed
Default
10
Unit
m/s
Description
The minimum speed the vehicle has to travel at for the hazard function to be armed
Name
hazardActivateSpeed
Default
3
Unit
m/s
Description
The speed at which the hazard actually comes on when braking
Name
hazardDeactivateThrottle
Default
0.3
Unit
number
Description
Hazards are automatically deactivated again if the throttle input is above the deactivate throttle value and the vehicle speed exceeds the deactivate speed
Name
hazardDeactivateSpeed
Default
3
Unit
m/s
Description
Hazards are automatically deactivated again if the throttle input is above the deactivate throttle value and the vehicle speed exceeds the deactivate speed
Name
blinkOnTime
Default
0.1
Unit
s
Description
Time the lights are on while flashing
Name
blinkOffTime
Default
0.1
Unit
s
Description
Time the lights are off while flashing

Example Usage

"controller": [
  ["fileName"],
  ["adaptiveBrakeLights"]
],
"adaptiveBrakeLights": {
  "indicateESCUsageWithBrakelights":false,
  "activateHazardsAfterEmergencyBraking":false,
  "blinkOnTime": 0.25,
  "blinkOnffTime": 0.05,
}

Last modified: 26 November 2021, at 20:44

Any further questions?

Join our discord