-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Sensor Configuration File #427
Merged
Merged
Conversation
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
enumeration to indicate whether information is cartesian and requires a OSM map or is a georeference string.
paulbourelly999
changed the title
Add update sensor configuration file and parsing to include an
Update Sensor Configuration File
Aug 27, 2024
dan-du-car
reviewed
Aug 28, 2024
dan-du-car
reviewed
Aug 28, 2024
dan-du-car
reviewed
Aug 28, 2024
dan-du-car
reviewed
Aug 28, 2024
sensor_data_sharing_service/include/sensor_configuration_parser.hpp
Outdated
Show resolved
Hide resolved
sensor_data_sharing_service/include/sensor_configuration_parser.hpp
Outdated
Show resolved
Hide resolved
sensor_data_sharing_service/src/sensor_configuration_parser.cpp
Outdated
Show resolved
Hide resolved
sensor_data_sharing_service/src/sensor_configuration_parser.cpp
Outdated
Show resolved
Hide resolved
sensor_data_sharing_service/src/sensor_data_sharing_service.cpp
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
dan-du-car
approved these changes
Aug 29, 2024
9 tasks
dan-du-car
pushed a commit
to usdot-fhwa-OPS/V2X-Hub
that referenced
this pull request
Sep 5, 2024
<!-- Thanks for the contribution, this is awesome. --> # PR Details ## Description ### Background (Related changes) This PR was created to accommodate changes in the Sensor Configuration file introduced by this PR (usdot-fhwa-stol/carma-streets#427). To summarize, the sensor configuration file format was changed to allow for reference location to be specified in WGS84 coordinates or cartesian coordinates. For Simulation cartesian coordinates work well since many simulation environments do not have real-world equivalents and cartesian coordinates are easy to pull from different map editors and viewers like [JSOM](https://josm.openstreetmap.de/). For real world deployments however WGS84 coordinates are far easier to use since using cartesian coordinates introduces a dependency on an lanlet2 map for the area. It is far easier to use built in or separate GPS devices to get a reference location for a mounted sensor. #### Old Format of Sensor Configuration JSON: ```json [ { "sensorId": "SomeID", "type": "SemanticLidar", "location": { "x": 1.0, /* in meters */ "y": 2.0, /* in meters */ "z": -3.2 /* in meters */ }, "orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 } } ] ``` #### New Format of Sensor Configuration JSON: ```json [ { "sensorId": "sensor_1", "type": "SemanticLidar", "ref": { "type": "CARTESIAN", "location": { "x": 1.0, /* in meters */ "y": 2.0, /* in meters */ "z": -3.2 /* in meters */ }, "orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 } } } ] ``` ### Changes This change in Sensor Configuration file means that we need to change how we read and populate the registration message that goes out from the CDASim Adapter Plugin to CDASim. The content of this registration remains unchanged, we just need to read this information from the new `ref` element in the Sensor Configuration JSON and populate the existing registration. Lastly, we added logic for the registration to ignore any sensor with a WGS84 reference location since we currently only have support ```json { "infrastructureId": "id_123", "location": { "x": 0, "y": 0, "z": 0 }, "rxMessageIpAddress": "127.0.0.1", "rxMessagePort": 8686, "sensors": { "sensorId": "sensor1", "type": "SemanticLidar", "location": { "x": 0.0, "y": 0.0, "z": 0.0 }, "orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 } }, "simulatedInteractionPort": 7576, "timeSyncPort": 7575 } ``` <!--- Describe your changes in detail --> ## Related Issue [FCP-37 ](https://usdot-carma.atlassian.net/browse/FCP-37)<!--- 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 See description <!--- Why is this change required? What problem does it solve? --> ## How Has This Been Tested? Local Integration Testing and unit testing <!--- 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: --> - [x] Defect fix (non-breaking change that fixes an issue) - [ ] 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 - [x] My change requires a change to the documentation. - [x] 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) - [x] I have added tests to cover my changes. - [x] All new and existing tests passed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Details
Description
The changes recommended in this PR are to modify the Sensor Configuration file to be able to provide either a cartesian offset or a WGS84 location based on a type enumeration. The new format of the sensor configuration file is described below
Note
Sensor reference or "ref" can either be defined as a "CARTESIAN" offset from a provided lanelet2 osm map (first example) or a "WGS84" location (second example). The "CARTESIAN" offset is only recommended for simulation testing as it adds a dependency on a lanelet2 map. For real-world deployments it is recommended that the "WGS84" location is provided.
CARTESIAN(SIMULATION):
The orientation information provided here is not used by the Sensor Data Sharing Service, but it used by other parts for the CARMA Streets system (V2X-Hub/CDASimAdapterPlugin) in simulation to provide orientation information for spawning a requested sensor.
or
WGS84(REAL-WORLD):
I opted to use WGS84 coordinates since we do not need the orientation or offsets included in a geo refence projection string in real world deployment. The detection data has a assumed ENU coordinate frame so all we need is the reference sensor location from which this detection data is measured.
Warning
The changes to the Sensor Configuration file format do break some of the existing CARMA-Streets/Simulation integration. An additional PR will be introduced into CDASim to account for the format difference in the Sensor Configuration information
Related GitHub Issue
Related Jira Key
FCP-37
Motivation and Context
Currently the Sensor Data Sharing Services reads geo-reference information from lanelet2 osm map and then reads cartesian position for a sensor from the sensor configuration file to generate an SDSM WSG84 reference location.
Example Geo reference string included in lanelet2 osm map
Example Sensor Config
Geo reference + sensor config cartesian offset = sdsm reference location
This is a problem because it unnecessarily introduces a dependency on an lanlet2 OSM map for SDSM functionality. It is also not practical to attempt to configure a real-world sensor based on a cartesian offset in a lanelet2 map. This implementation was created because conversely it is not practical to generate a sensor in simulation with WGS 84 coordinate location since many simulation environments do not have real world counter parts.
As a result we offer two different ways to configure sensor's in simulation and for real world outlined above. This removes unnecessary dependency on a lanelet2 osm map for real world sensors, while still allowing easy configuration of sensor in simulation.
How Has This Been Tested?
Current testing is limited to unit testing. It is recommended that this change set is integration tested #426 PR is closed.
Types of changes
Checklist: