Draft: added distance dynamic dimension in speed action
Compare changes
Files
2+ 31
− 25
@@ -86,18 +86,10 @@ void SpeedAction::StartAction()
@@ -86,18 +86,10 @@ void SpeedAction::StartAction()
// TODO: Add CUBIC once it's clear how the shape should look like and how the coefficients can be calculated
@@ -120,12 +112,12 @@ bool SpeedAction::HasControlStrategyGoalBeenReached(const std::string& actor)
@@ -120,12 +112,12 @@ bool SpeedAction::HasControlStrategyGoalBeenReached(const std::string& actor)
units::velocity::meters_per_second_t SpeedAction::GetTargetSpeed(NET_ASAM_OPENSCENARIO::v1_1::ISpeedActionTarget* speed_action_target)
@@ -141,9 +133,9 @@ units::velocity::meters_per_second_t SpeedAction::GetTargetSpeed(NET_ASAM_OPENSC
@@ -141,9 +133,9 @@ units::velocity::meters_per_second_t SpeedAction::GetTargetSpeed(NET_ASAM_OPENSC
"Relative Entity with name \"" + relative_entity_name + "\" of SpeedAction does not exist. Please adjust the "
auto target_base = environment_->GetEntityRepository().Get(relative_entity_name).value().get().GetVelocity();
@@ -179,31 +171,45 @@ void SpeedAction::SetLinearVelocitySplineControlStrategy(
@@ -179,31 +171,45 @@ void SpeedAction::SetLinearVelocitySplineControlStrategy(
if (transition_dynamics->GetDynamicsDimension() == NET_ASAM_OPENSCENARIO::v1_1::DynamicsDimension::TIME)
std::get<2>(spline_section.polynomial) = (target_speed - entity.GetVelocity().Length()) / units::time::second_t(transition_dynamics->GetValue());
else if (transition_dynamics->GetDynamicsDimension() == NET_ASAM_OPENSCENARIO::v1_1::DynamicsDimension::RATE)
units::math::copysign(units::acceleration::meters_per_second_squared_t(transition_dynamics->GetValue()),