Skip to content

Test Event State Progression Event

Ivan Yourshaw edited this page Oct 11, 2024 · 2 revisions

Event State Progression Events and Notifications

Inputs

A few seconds of ProcessedSpat data for an intersection that transitions from:

ProtectedClearance [1,3]
StopAndRemain [2,4,5,7,8]
ProtectedMovementAllowed [6]

to

StopAndRemain [1,3,4,5,6,7,8]
ProtectedMovementAllowed [2]

Signal groups are indicated in brackets [].

The transition for signal group 6 is illegal: Protected Movement Allowed (green) -> Stop And Remain (red) without passing through Protected Clearance (yellow).

When the script is run repeatedly, the reverse phase transition also occurs which has three additional illegal transitions:

  • signal group 1: Stop And Remain -> Protected Clearance
  • signal group 2: Protected Movement Allowed -> Stop And Remain
  • signal group 3: Stop And Remian -> Protected Clearance

Test Script

SPAT_EventStateProgression.csv

TODO: Link to the file

Output Topics

  • topic.CmEventStateProgressionEvent
  • topic.CmEventStateProgressionNotification

Expected Output

Events

The first run produces one event for signal group 6:

Topic: topic.CmEventStateProgressionEvent
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":6}
Offset: 0
Timestamp: 1728617155786
Value: {
    "eventGeneratedAt": 1728617155556,
    "eventType": "EventStateProgression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "source": "10.11.81.13",
    "signalGroupID": 6,
    "eventStateA": "PROTECTED_MOVEMENT_ALLOWED",
    "timestampA": 1728617155681,
    "eventStateB": "STOP_AND_REMAIN",
    "timestampB": 1728617155786
}

The second and following runs produce four events for both forward and reverse transitions:

Topic: topic.CmEventStateProgressionEvent
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":1}
Offset: 1
Timestamp: 1728617807068
Value: {
    "eventGeneratedAt": 1728617807853,
    "eventType": "EventStateProgression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "source": "10.11.81.13",
    "signalGroupID": 1,
    "eventStateA": "STOP_AND_REMAIN",
    "timestampA": 1728617157806,
    "eventStateB": "PROTECTED_CLEARANCE",
    "timestampB": 1728617807068
}

Topic: topic.CmEventStateProgressionEvent
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":2}
Offset: 2
Timestamp: 1728617807068
Value: {
    "eventGeneratedAt": 1728617807856,
    "eventType": "EventStateProgression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "source": "10.11.81.13",
    "signalGroupID": 2,
    "eventStateA": "PROTECTED_MOVEMENT_ALLOWED",
    "timestampA": 1728617157806,
    "eventStateB": "STOP_AND_REMAIN",
    "timestampB": 1728617807068
}

Topic: topic.CmEventStateProgressionEvent
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":3}
Offset: 3
Timestamp: 1728617807068
Value: {
    "eventGeneratedAt": 1728617807857,
    "eventType": "EventStateProgression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "source": "10.11.81.13",
    "signalGroupID": 3,
    "eventStateA": "STOP_AND_REMAIN",
    "timestampA": 1728617157806,
    "eventStateB": "PROTECTED_CLEARANCE",
    "timestampB": 1728617807068
}

Topic: topic.CmEventStateProgressionEvent
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":6}
Offset: 4
Timestamp: 1728617809190
Value: {
    "eventGeneratedAt": 1728617809801,
    "eventType": "EventStateProgression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "source": "10.11.81.13",
    "signalGroupID": 6,
    "eventStateA": "PROTECTED_MOVEMENT_ALLOWED",
    "timestampA": 1728617809085,
    "eventStateB": "STOP_AND_REMAIN",
    "timestampB": 1728617809190
}

Notifications

One notification for every event.

First run, one notification:

Topic: topic.CmEventStateProgressionNotification
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":6}
Offset: 0
Timestamp: 1728617155786
Value: {
    "key": "EventStateProgressionNotification_10.11.81.13_-1_12110_6",
    "notificationGeneratedAt": 1728617155561,
    "notificationType": "EventStateProgressionNotification",
    "notificationText": "An illegal SPaT transition was detected",
    "notificationHeading": "Event State Progression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "event": {
        "eventGeneratedAt": 1728617155556,
        "eventType": "EventStateProgression",
        "intersectionID": 12110,
        "roadRegulatorID": -1,
        "source": "10.11.81.13",
        "signalGroupID": 6,
        "eventStateA": "PROTECTED_MOVEMENT_ALLOWED",
        "timestampA": 1728617155681,
        "eventStateB": "STOP_AND_REMAIN",
        "timestampB": 1728617155786
    },
    "uniqueId": "EventStateProgressionNotification_10.11.81.13_-1_12110_6"
}

Second and subsequent runs, four notifications:

Topic: topic.CmEventStateProgressionNotification
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":1}
Offset: 1
Timestamp: 1728617807068
Value: {
    "key": "EventStateProgressionNotification_10.11.81.13_-1_12110_1",
    "notificationGeneratedAt": 1728617807854,
    "notificationType": "EventStateProgressionNotification",
    "notificationText": "An illegal SPaT transition was detected",
    "notificationHeading": "Event State Progression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "event": {
        "eventGeneratedAt": 1728617807853,
        "eventType": "EventStateProgression",
        "intersectionID": 12110,
        "roadRegulatorID": -1,
        "source": "10.11.81.13",
        "signalGroupID": 1,
        "eventStateA": "STOP_AND_REMAIN",
        "timestampA": 1728617157806,
        "eventStateB": "PROTECTED_CLEARANCE",
        "timestampB": 1728617807068
    },
    "uniqueId": "EventStateProgressionNotification_10.11.81.13_-1_12110_1"
}

Topic: topic.CmEventStateProgressionNotification
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":2}
Offset: 2
Timestamp: 1728617807068
Value: {
    "key": "EventStateProgressionNotification_10.11.81.13_-1_12110_2",
    "notificationGeneratedAt": 1728617807856,
    "notificationType": "EventStateProgressionNotification",
    "notificationText": "An illegal SPaT transition was detected",
    "notificationHeading": "Event State Progression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "event": {
        "eventGeneratedAt": 1728617807856,
        "eventType": "EventStateProgression",
        "intersectionID": 12110,
        "roadRegulatorID": -1,
        "source": "10.11.81.13",
        "signalGroupID": 2,
        "eventStateA": "PROTECTED_MOVEMENT_ALLOWED",
        "timestampA": 1728617157806,
        "eventStateB": "STOP_AND_REMAIN",
        "timestampB": 1728617807068
    },
    "uniqueId": "EventStateProgressionNotification_10.11.81.13_-1_12110_2"
}

Topic: topic.CmEventStateProgressionNotification
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":3}
Offset: 3
Timestamp: 1728617807068
Value: {
    "key": "EventStateProgressionNotification_10.11.81.13_-1_12110_3",
    "notificationGeneratedAt": 1728617807857,
    "notificationType": "EventStateProgressionNotification",
    "notificationText": "An illegal SPaT transition was detected",
    "notificationHeading": "Event State Progression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "event": {
        "eventGeneratedAt": 1728617807857,
        "eventType": "EventStateProgression",
        "intersectionID": 12110,
        "roadRegulatorID": -1,
        "source": "10.11.81.13",
        "signalGroupID": 3,
        "eventStateA": "STOP_AND_REMAIN",
        "timestampA": 1728617157806,
        "eventStateB": "PROTECTED_CLEARANCE",
        "timestampB": 1728617807068
    },
    "uniqueId": "EventStateProgressionNotification_10.11.81.13_-1_12110_3"
}

Topic: topic.CmEventStateProgressionNotification
Key: {"rsuId":"10.11.81.13","intersectionId":12110,"region":-1,"signalGroup":6}
Offset: 4
Timestamp: 1728617809190
Value: {
    "key": "EventStateProgressionNotification_10.11.81.13_-1_12110_6",
    "notificationGeneratedAt": 1728617809801,
    "notificationType": "EventStateProgressionNotification",
    "notificationText": "An illegal SPaT transition was detected",
    "notificationHeading": "Event State Progression",
    "intersectionID": 12110,
    "roadRegulatorID": -1,
    "event": {
        "eventGeneratedAt": 1728617809801,
        "eventType": "EventStateProgression",
        "intersectionID": 12110,
        "roadRegulatorID": -1,
        "source": "10.11.81.13",
        "signalGroupID": 6,
        "eventStateA": "PROTECTED_MOVEMENT_ALLOWED",
        "timestampA": 1728617809085,
        "eventStateB": "STOP_AND_REMAIN",
        "timestampB": 1728617809190
    },
    "uniqueId": "EventStateProgressionNotification_10.11.81.13_-1_12110_6"
}

Comments

For testing, the debug flag, event.state.progression.debug can be set to true to view all SPAT transitions for all signal groups, including legal transitions, in the application log, which produces output similar to:

transition detected at timestamp 1727291772337 -> 1727291772442, signal group 1, PROTECTED_CLEARANCE -> STOP_AND_REMAIN 
transition detected at timestamp 1727291772337 -> 1727291772442, signal group 2, STOP_AND_REMAIN -> PROTECTED_MOVEMENT_ALLOWED 
transition detected at timestamp 1727291772337 -> 1727291772442, signal group 3, PROTECTED_CLEARANCE -> STOP_AND_REMAIN 
transition detected at timestamp 1727291772337 -> 1727291772442, signal group 6, PROTECTED_MOVEMENT_ALLOWED -> STOP_AND_REMAIN