Skip to content
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

MOSAIC-CARMA-Streets: CDASimAdapter listens on port for incoming Simulated Object Dectections and publish the serialized object to Kafka #552

Merged
merged 37 commits into from
Jul 28, 2023

Conversation

dan-du-car
Copy link
Collaborator

@dan-du-car dan-du-car commented Jul 18, 2023

PR Details

Description

Implement the design from https://usdot-carma.atlassian.net/browse/CDAR-148
Part 2.B: Implement the logic in CDASimAdapter to listen to UDP socket and receive DetectedObject. Then serialize this C++ object to TMX bus so that CARMAStreetPlugin can receive it form the TMX bus.

As a V2X-Hub user, I need the CDASimAdapter to listen for Simulated Object Detection Messages on an open port and broadcast received messages on the TMX message bus.

Related Issue

#590

Related Jira Key

https://usdot-carma.atlassian.net/browse/CDAR-191
https://usdot-carma.atlassian.net/browse/CDAR-184

Motivation and Context

CDA research

How Has This Been Tested?

Unit test
Local integration test

Types of changes

  • 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:

  • 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.
  • I have read the CONTRIBUTING document.
    V2XHUB Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@dan-du-car dan-du-car changed the title MOSAIC-CARMA-Streets: CDASimAdapter listens on port for incoming Simulated Object Dectections MOSAIC-CARMA-Streets: CDASimAdapter listens on port for incoming Simulated Object Dectections and publish the serialized object to Kafka Jul 19, 2023
- SIM_INTERACTION_PORT=7576
- V2X_PORT=8686
- INFRASTRUCTURE_ID=1
- KAFKA_BROKER_ADDRESS=127.0.0.1:9092
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no required. Also we do not want our default docker-compose file to assume simulation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed. Which docker-compose file is used for simulation other than the devcontainer?


void CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage(simulation::SensorDetectedObject &msg, routeable_message &routeableMsg)
{
PLOG(logINFO) << "Produce sensor detected message in JSON format: " << msg.to_string() <<std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make this debug.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

"payload": {
"sensor": {
"id": "SomeID",
"type": "SematicLidar",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about removing sensor type and location from this message. The message should now only include sensor id and projection string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we only have proj_string for sensor? or this proj_string is for both sensor and detected object?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about removing sensor type and location from this message. The message should now only include sensor id and projection string.

addressed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess technically we do not need it for sensor registration. We definitely need it for sensor detected object.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know the location (x,y,z) of the sensor if no proj_string is applied to sensor?

},
"payload": {
"sensor": {
"id": "SomeID",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also maybe we should rename this field everywhere to sensorId instead of id which may be ambiguous. We can also avoid the nested sensor JSON altogether.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ "sensorId": "sensor1",
 "proj_string": "asdlasdkasd",
...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

@paulbourelly999
Copy link
Contributor

A test case is still failing so we are not getting any sonar scanner report.

}
}//End lambda
, std::chrono::milliseconds(100));
external_bject_detection_thread_timer->Start();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like there may be a type in this variable name. Not a big deal,just in case you didnt notice

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@@ -22,9 +22,9 @@ namespace CDASimAdapter {
class TestCARMASimulationConnection : public ::testing::Test {
protected:
void SetUp() override {
// Initialize CARMA Simulation connection with (0,0,0) location.
// Initialize CARMA Simulation connection with (0,0,0) location and mock kafka producer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no mock kafka producer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@paulbourelly999 paulbourelly999 merged commit d4a370f into develop Jul 28, 2023
7 of 8 checks passed
@paulbourelly999 paulbourelly999 deleted the add_external_object branch July 28, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants