-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streets MOSAIC integration: CDASimAdapter register with Simulation am…
…bassador and send sensors information (#554) <!-- Thanks for the contribution, this is awesome. --> # PR Details ## Description Update the CDASimAdapter registration message to include the sensors information. Read the sensors information from local file and store the sensors information in the CDASimAdapter plugin. <!--- Describe your changes in detail --> ## Related Issue NA <!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: --> ## Motivation and Context CDA research <!--- Why is this change required? What problem does it solve? --> ## How Has This Been Tested? unit test local integration test <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Defect fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have added any new packages to the sonar-scanner.properties file - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [x] I have read the **CONTRIBUTING** document. [V2XHUB Contributing Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md) - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed.
- Loading branch information
1 parent
77127e2
commit 678784c
Showing
8 changed files
with
149 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import socket | ||
''' | ||
Purpose: This script is to launch a UDP server and used to test the CDASimAdapter simulation registration. | ||
Usage: Run this script first, it shall open a socket listenning to port 6767. | ||
Launch the v2xhub and enable the CDASimAdapter plugin. Upon the plugin startup, | ||
it sends registration message to port 6767. This UDP server shall receive the registration message, | ||
and print this message on the terminal. | ||
Run command: python3 udp_socket_server.py | ||
''' | ||
UDP_IP = "127.0.0.1" | ||
UDP_SOCKET_PORT_SIM_REGISTRATION = 6767 | ||
|
||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||
sock.bind((UDP_IP, UDP_SOCKET_PORT_SIM_REGISTRATION)) | ||
print("Server Listenning on port: %s" % UDP_SOCKET_PORT_SIM_REGISTRATION) | ||
|
||
while True: | ||
data, addr = sock.recvfrom(1024) | ||
print("recevied message: %s" % data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[ | ||
{ | ||
"sensorId": "SomeID", | ||
"type": "SematicLidar", | ||
"location": { | ||
"x": 0.0, | ||
"y": 0.0, | ||
"z": 0.0 | ||
}, | ||
"orientation": { | ||
"yaw": 0.0, | ||
"pitch": 0.0, | ||
"roll": 0.0 | ||
} | ||
}, | ||
{ | ||
"sensorId": "SomeID2", | ||
"type": "SematicLidar", | ||
"location": { | ||
"x": 1.0, | ||
"y": 2.0, | ||
"z": 0.0 | ||
}, | ||
"orientation": { | ||
"yaw": 23.0, | ||
"pitch": 0.0, | ||
"roll": 0.0 | ||
} | ||
} | ||
] |