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

Optional SENSOR_CONFIG_JSON_FILE #616

Merged
merged 11 commits into from
Jun 12, 2024

Conversation

paulbourelly999
Copy link
Contributor

@paulbourelly999 paulbourelly999 commented Jun 10, 2024

PR Details

Description

This PR makes the SENSOR_JSON_FILE_PATH an optional environment variable in simulation since spawning sensors is not required for the base line functionality of V2X-Hub. Prior to this PR, the CDASimAdapter would accept empty SENSOR_JSON_FILE_PATH files but not missing ones.

Related Issue

VH-1320

Motivation and Context

Improve usability by making CDASimAdapterPlugin work without SENSOR_JSON_FILE_PATH optional environment variable

How Has This Been Tested?

Tested in CDASim Cloud deployment

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.

@paulbourelly999 paulbourelly999 marked this pull request as ready for review June 11, 2024 15:19
@paulbourelly999 paulbourelly999 self-assigned this Jun 11, 2024
{
PLOG(logWARNING) << "Sensors JSON is empty!" << std::endl;
}
message["sensors"] = sensors_json_v;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to set this sensors in message? I noticed that if the path to sensor json file is empty, this sensors is not set in message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep it is an optional part of the registration message. When included it configures simulated sensor for V2X-Hub/CARMA-Streets. Since V2X-Hub/CARMA-Streets basic functionality does not require sensors it is also not required.

Copy link
Contributor

Choose a reason for hiding this comment

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

I get the optional part. I am trying to make a note that whether we need to set message["sensors"] = sensors_json_v; when it is empty because I see it is not set when the path is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not need the that part when the sensor configuration file is empty or missing

* **V2X_PORT** – Environment variable for storing port for receiving v2x messages from CDASim
* **SIM_V2X_PORT** – Environment variable for storing port for sending v2x messages to CDASim
* **LOCAL_IP** – Environment variable for storing local IP of V2X Hub.
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently we are passing the "LOCAL_IP" as "V2XHUB_IP" from .env file. Not sure if we need to update all the files to use "V2XHUB_IP" everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update to V2X-Hub IP

Copy link

sonarcloud bot commented Jun 12, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
77.78% Line Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@paulbourelly999 paulbourelly999 merged commit cea762d into develop Jun 12, 2024
2 of 3 checks passed
@paulbourelly999 paulbourelly999 deleted the vh-1320-optional_sensor_config_json branch June 12, 2024 16:55
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.

3 participants