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
Field | datatype | Description |
---|---|---|
utime | string | Local machine time when this list was generated |
distance | int32 | distance 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_type | SignalType | Configuration of traffic light |
status_straight_turn | Status | Estimate of the light status |
status_right_turn | Status | Estimate of the light status |
status_left_turn | Status | Estimate of the light status |
SignalType
Field | Description |
---|---|
SIGNAL_TYPE_UNKNOWN | Default value for traffic light. This is the most commonly found vertical 3 segment traffic light with red on top |
SIGNAL_TYPE_DEFAULT_STANDARD | Default value for traffic light. This is the most commonly found vertical 3 segment traffic light with red on top |
SIGNAL_TYPE_5_SEGMENT | 5 segment light with straight and left directions |
SIGNAL_TYPE_NONE | This is empty signal. Placeholder for traffic lights |
SIGNAL_TYPE_VALID_UNKNOWN | This is unknown signal . Placeholder for traffic lights |
Status
Field | Possible Value |
---|---|
STATUS_UNKNOWN | 0 |
STATUS_RED_FLASH | 0x11 |
STATUS_RED_SOLID | 0x21 |
STATUS_YELLOW_FLASH | 0x12 |
STATUS_YELLOW_SOLID | 0x22 |
STATUS_GREEN_FLASH | 0x14 |
STATUS_GREEN_SOLID | 0x24 |
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"
}