-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Thanks for the contribution, this is awesome. --> # PR Details ## Description ### MUST Sensor Driver Plugin Adding MUST Sensor Driver to V2X-Hub. Documentation on MUST Sensor Driver will be included in README. This new plugin is responsible for consuming UDP CSV (Comma Separated Values) string packets that represent detections from the MUST Sensor. These will be converted into SensorDetectedObject which can be forwarded to the **CARMA Streets** **Sensor Data Sharing Service** to create SDSMs (Sensor Data Sharing Messages). ### Sensor Detected Object This PR includes updates to the **SensorDetectedObject** TMX message including removing references to simulation since this message will no longer be exclusively used in simulation. This PR also includes adding fields and JSON serialization methods to the **SensorDetectedObject**. This was previously unnecessary since incoming messages from CDASim (our simulation environment) were already JSON strings and were just passed via payload. ### UDP Server This PR also includes updates to the UDPServer class in TMX Utils. It provides a method to directly consume string payloads from the UDPServer. Many users of the UDP Server have to write this logic when they use the UDP Server. Adding it to the class is in an effort to reduce duplication of this logic across V2X-Hub. ### Future Improvements This PR further highlights the needs to address/fix #561 which currently prevents from correct JSON serialization and deserialization of TMX messages and prevents defining messages with nested objects. <!--- Describe your changes in detail --> ## Related Issue [FCP-3](https://usdot-carma.atlassian.net/browse/FCP-3) <!--- 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 Freight Cooperative Perception <!--- Why is this change required? What problem does it solve? --> ## How Has This Been Tested? Unit testing and script based integration testing. For instructions for script based integration testing refer to **Functionality Testing** section of the README document. <!--- 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! --> - [x] 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.
- Loading branch information
1 parent
f933ff7
commit adfb5a8
Showing
29 changed files
with
844 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#ifndef INCLUDE_SIMULATED_SensorDetectedObject_H_ | ||
#define INCLUDE_SIMULATED_SensorDetectedObject_H_ | ||
|
||
#include <tmx/messages/message.hpp> | ||
#include <MessageTypes.h> | ||
#include <Vector3d.h> | ||
#include <Point.h> | ||
|
||
namespace tmx | ||
{ | ||
namespace messages | ||
{ | ||
|
||
/** | ||
* This SensorDetectedObject is used to communicate the sensor detected object information with various applications. | ||
* This message is the generic representation of a sensor detection. | ||
*/ | ||
class SensorDetectedObject : public tmx::message | ||
{ | ||
public: | ||
SensorDetectedObject(){}; | ||
SensorDetectedObject(const tmx::message_container_type &contents) : tmx::message(contents) {}; | ||
~SensorDetectedObject(){}; | ||
// Message type for routing this message through TMX core | ||
static constexpr const char *MessageType = MSGTYPE_APPLICATION_STRING; | ||
|
||
// // Message sub type for routing this message through TMX core | ||
static constexpr const char *MessageSubType = MSGSUBTYPE_SENSOR_DETECTED_OBJECT_STRING; | ||
|
||
// TODO: Convert this member variable to std::attributes and handle nested object and arrays. (see [CloudHeartbeatMessage.h](./CloudHearbeatMessage.h) array_attribute ) | ||
|
||
// Classification of detected object | ||
std::string type = ""; | ||
// Confidence of type classification | ||
double confidence = 0.0; | ||
// Unique indentifier of sensor reporting detection | ||
std::string sensorId = ""; | ||
// String describing projection used to convert cartesian data to WGS84 data | ||
std::string projString = ""; | ||
// Unique identifier of detected object | ||
int objectId = 0; | ||
// Cartesian positiion of object. Assumed to be ENU coordinate frame. | ||
tmx::utils::Point position = tmx::utils::Point(); | ||
// Cartesian velocity vector of object. Assumed to be ENU coordinate frame. | ||
tmx::utils::Vector3d velocity = tmx::utils::Vector3d(); | ||
// Epoch time in milliseconds | ||
long timestamp = 0; | ||
|
||
}; | ||
|
||
} | ||
|
||
}; // namespace tmx | ||
#endif |
35 changes: 0 additions & 35 deletions
35
src/tmx/Messages/include/simulation/SensorDetectedObject.h
This file was deleted.
Oops, something went wrong.
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 @@ | ||
#pragma once | ||
|
||
namespace tmx::utils { | ||
|
||
|
||
/// Three dimensional Vector | ||
using Vector3d = struct Vector3d | ||
{ | ||
Vector3d() : X(0), Y(0), Z(0) {} | ||
|
||
Vector3d(double x, double y, double z = 0.0): | ||
X(x), Y(y), Z(z) { } | ||
|
||
double X; | ||
double Y; | ||
double Z; | ||
}; | ||
|
||
} // namespace tmx::utils |
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
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,27 @@ | ||
PROJECT(MUSTSensorDriverPlugin VERSION 7.6.0 LANGUAGES CXX) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
set(TMX_PLUGIN_NAME "Must Sensor Driver Plugin") | ||
|
||
|
||
BuildTmxPlugin() | ||
|
||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC tmxutils ) | ||
|
||
############# | ||
## Testing ## | ||
############# | ||
enable_testing() | ||
add_library(${PROJECT_NAME}_lib src/MUSTSensorDetection.cpp) | ||
TARGET_LINK_LIBRARIES(${PROJECT_NAME}_lib PUBLIC tmxutils ) | ||
|
||
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) | ||
add_executable(${BINARY} ${TEST_SOURCES}) | ||
add_test(NAME ${BINARY} COMMAND ${BINARY}) | ||
TARGET_INCLUDE_DIRECTORIES(${BINARY} PUBLIC /usr/local/lib src/) | ||
|
||
target_link_libraries(${BINARY} PUBLIC | ||
${PROJECT_NAME}_lib | ||
gtest) |
Oops, something went wrong.