Skip to main content

Traffic Light

Description

Provides current status of the Traffic Light and also the distance to the next traffic light per the May's Planner

traffic_light_t

FielddatatypeDescription
utimestringLocal machine time when this list was generated
distanceint32distance to the next traffic light that we plan to wait for. Use -1 if no traffic light is currently relevant, for example if we have another intersection before this light
signal_typeSignalTypeConfiguration of traffic light
status_straight_turnStatusEstimate of the light status
status_right_turnStatusEstimate of the light status
status_left_turnStatusEstimate of the light status

SignalType

FieldDescription
SIGNAL_TYPE_UNKNOWNDefault value for traffic light. This is the most commonly found vertical 3 segment traffic light with red on top
SIGNAL_TYPE_DEFAULT_STANDARDDefault value for traffic light. This is the most commonly found vertical 3 segment traffic light with red on top
SIGNAL_TYPE_5_SEGMENT5 segment light with straight and left directions
SIGNAL_TYPE_NONEThis is empty signal. Placeholder for traffic lights
SIGNAL_TYPE_VALID_UNKNOWNThis is unknown signal . Placeholder for traffic lights

Status

FieldPossible Value
STATUS_UNKNOWN0
STATUS_RED_FLASH0x11
STATUS_RED_SOLID0x21
STATUS_YELLOW_FLASH0x12
STATUS_YELLOW_SOLID0x22
STATUS_GREEN_FLASH0x14
STATUS_GREEN_SOLID0x24

Topic/channel string

For Realtime API

Pass the comma seperated topic name as a query param

/.vehicle.{vehiclename}.TRAFFIC_LIGHT

JSON Output

Order of fields might differ

{
"distance": 1.0,
"estimate": {
"signalType": "SIGNAL_TYPE_DEFAULT_STANDARD",
"statusLeftTurn": "STATUS_UNKNOWN",
"statusRightTurn": "STATUS_UNKNOWN",
"statusStraightTurn": "STATUS_GREEN_SOLID",
"utime": "1718744308162650"
},
"topic": "TRAFFIC_LIGHT",
"utime": "1718744308241909",
"vehicle": "vehiclename"
}