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

RJD-1336/fix_request_speed_change_throws #1404

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

robomic
Copy link
Contributor

@robomic robomic commented Oct 1, 2024

Abstract

Please refer to this issue.

Details

  1. Inversion of order in if statements

if (!continuous && isTargetSpeedReached(target_speed)) --->
if (isTargetSpeedReached(target_speed) && !continuous)
this forces calculation of relative_target_speed, which throws immediately, if invalid.
2. Numerous const qualifiers added.
3. A single cpp_mock_scenario has been modified in order to update other_status variable.

References

issue
jira ticket

Copy link

github-actions bot commented Oct 1, 2024

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@robomic robomic added bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 wait for regression test labels Oct 8, 2024
@robomic
Copy link
Contributor Author

robomic commented Oct 10, 2024

Regression results: OK

@robomic robomic marked this pull request as ready for review October 10, 2024 13:30
@@ -67,6 +67,7 @@ class RequestSpeedChangeRelativeScenario : public cpp_mock_scenarios::CppScenari
34741, 10.0, 0.0, api_.getHdmapUtils()),
getVehicleParameters());
api_.setLinearVelocity("front", 3);
api_.updateFrame();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function is intended to be called on the base type and is not expected to be called within scenarios. Access rights modifications will be implemented in a separate PR, so no changes are needed in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line is needed in order to pass this particular test. Without it other_status_ variable is not updated and does not contain other entities. Empty other_status_ results in a throw when calculating the absolute speed from speed_change::RelativeTargetSpeed variable.

simulation/traffic_simulator/src/entity/entity_base.cpp Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 15, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 wait for regression test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants