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.
Description
This PR fixes behavior of time-constrained SpeedAction like the one below:
Abstract
Time-constrained SpeedAction was not working properly because the conversion from the
openscenario_interpreter::syntax::DynamicDimension
type was not converted properly to thetraffic_simulator::speed_change::Constraint
type which is used deeper in thetraffic_simulator
.This PR corrects conversion between
openscenario_interpreter::syntax::DynamicDimension
totraffic_simulator::speed_change::Constraint
and solves the issue.Background
This issue was found during scenario development for the scenario_simulator_v2_scenarios repository. This is one of the failing scenarios.
It was found that the acceleration is incorrect when the vehicle's speed is changed. The scenario expects acceleration of 1m/s^2 but has 2m/s^2.
Destructive Changes
The change might change entity behavior if it uses time-based constraints to alter its speed.
Before the change, the code would accelerate the entity by 2.0 m/s2 until it reached 2 m/s. After the change, the vehicle would correctly accelerate 1 m/s2 for 2 s to reach 2 m/s.
If the scenario is tuned to work with time-based constrained SpeedAction working incorrectly, when SpeedAction starts working correctly the scenario will behave differently and might fail.