Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Jul 18, 2024
1 parent 0330cfd commit e9ee34a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 28 deletions.
22 changes: 3 additions & 19 deletions src/v2i-hub/SpatPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
project( SpatPlugin VERSION 7.6.0 LANGUAGES CXX )

set(TMX_PLUGIN_NAME "SPAT")
set(CMAKE_CXX_STANDARD 17)

find_package(carma-clock REQUIRED)

BuildTmxPlugin()

target_link_libraries(${PROJECT_NAME} tmxutils ::carma-clock)



add_library(${PROJECT_NAME}_lib src/NTCIP1202.cpp
src/SignalControllerConnection.cpp)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC
tmxutils ::carma-clock )
target_link_libraries(${PROJECT_NAME}_lib PUBLIC tmxutils ::carma-clock )
#############
## Testing ##
#############
enable_testing()

set(BINARY ${PROJECT_NAME}_test)

file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false test/*.h test/*.cpp)

set(SOURCES ${TEST_SOURCES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test)

set(SOURCES ${TEST_SOURCES} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test)
add_executable(${BINARY} ${TEST_SOURCES})

add_test(NAME ${BINARY} COMMAND ${BINARY})
target_include_directories(${BINARY} PUBLIC src/)

target_link_libraries(${BINARY} PUBLIC ${PROJECT_NAME}_lib
gtest)
target_link_libraries(${BINARY} PUBLIC ${PROJECT_NAME}_lib gtest)
43 changes: 43 additions & 0 deletions src/v2i-hub/SpatPlugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPaT Plugin Documentation

## Introduction
The SPaT Plugin is responsible for receiving information from the Traffic Signal Controller (TSC or SC) necessary for broadcasting Signal Phase and Timing (SPaT) messages. This includes querying any SNMP objects to determine TSC state and listen for any broadcast SPaT information from the TSC.

## Related Plugins

A list of plugins related to the SPaT Plugin.

### Immediate Forward Plugin

For RSU Immediate Message Forwarding (IMF) functionality forward SPaT (Signal Phase and Timing Messages).

## Configuration/Deployment

This plugin has several configuration parameters. Below these are listed out as together with descriptions on how to set them.

**Intersection_ID**: The intersection id for SPAT generated by this plugin (Note Only used in SPAT MODE = BINARY).

**Intersection_Name**: The intersection name for SPAT generated by this plugin (Note Only used in SPAT MODE = BINARY).

**SignalGroupMapping**: JSON data defining a list of SignalGroups and phases (Note Only used in SPAT MODE = BINARY).

**Local_IP**: The IPv4 address of the local computer for receiving Traffic Signal Controller Broadcast Messages.

**Local_UDP_Port**: The local UDP port for reception of Traffic Signal Controller Broadcast Messages from the TSC.

**TSC_IP**: The IPv4 address of the destination Traffic Signal Controller (TSC).

**TSC_Remote_SNMP_Port**: The destination port on the Traffic Signal Controller (TSC) for SNMP NTCIP communication."

**SPAT_Mode**: The format of received SPAT from Traffic Signal Controller (TSC). Acceptance values are BINARY and J2735_HEX.

## Design


### Messages


## Functionality Testing



13 changes: 4 additions & 9 deletions src/v2i-hub/SpatPlugin/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"SPAT",
"description":"Plugin that reads PTLM data from a configuration file, receives live data from the signal controller, and publishes a J2735 SPAT message.",
"description":"The SPaT plugin receives live Signal Phase and Timing data from the Traffic Signal Controller and publishes a J2735 SPAT message.",
"version":"@PROJECT_VERSION@",
"exeLocation":"/bin/SpatPlugin",
"coreIpAddr":"127.0.0.1",
Expand All @@ -10,28 +10,23 @@
"type":"J2735",
"subtype":"SPAT-P",
"description":"Signal Phase and Timing (SPAT) status for the signalized intersection."
},
{
"type":"SIGCONT",
"subtype":"ACT",
"description":"Current signal controller action"
}
],
"configuration":[
{
"key":"Intersection_Id",
"default":"1",
"description":"The intersection id for SPAT generated by this plugin."
"description":"The intersection id for SPAT generated by this plugin (Note Only used in SPAT MODE = BINARY)."
},
{
"key":"Intersection_Name",
"default":"Intersection",
"description":"The intersection name for SPAT generated by this plugin."
"description":"The intersection name for SPAT generated by this plugin (Note Only used in SPAT MODE = BINARY)."
},
{
"key":"SignalGroupMapping",
"default":"{\"SignalGroups\":[{\"SignalGroupId\":1,\"Phase\":1,\"Type\":\"vehicle\"},{\"SignalGroupId\":2,\"Phase\":2,\"Type\":\"vehicle\"},{\"SignalGroupId\":3,\"Phase\":3,\"Type\":\"vehicle\"},{\"SignalGroupId\":4,\"Phase\":4,\"Type\":\"vehicle\"},{\"SignalGroupId\":5,\"Phase\":5,\"Type\":\"vehicle\"},{\"SignalGroupId\":6,\"Phase\":6,\"Type\":\"vehicle\"},{\"SignalGroupId\":7,\"Phase\":7,\"Type\":\"vehicle\"},{\"SignalGroupId\":8,\"Phase\":8,\"Type\":\"vehicle\"},{\"SignalGroupId\":22,\"Phase\":2,\"Type\":\"pedestrian\"},{\"SignalGroupId\":24,\"Phase\":4,\"Type\":\"pedestrian\"},{\"SignalGroupId\":26,\"Phase\":6,\"Type\":\"pedestrian\"},{\"SignalGroupId\":28,\"Phase\":8,\"Type\":\"pedestrian\"}]}",
"description":"JSON data defining a list of SignalGroups and phases."
"description":"JSON data defining a list of SignalGroups and phases (Note Only used in SPAT MODE = BINARY)."
},
{
"key":"Local_IP",
Expand Down

0 comments on commit e9ee34a

Please sign in to comment.