diff --git a/include/MantleAPI/Traffic/control_strategy.h b/include/MantleAPI/Traffic/control_strategy.h index d66b688c9e717d2292f17ea67a41e939c73bac3f..bbd59dab7b53b9f236631e2a41a89b144d6c30ef 100644 --- a/include/MantleAPI/Traffic/control_strategy.h +++ b/include/MantleAPI/Traffic/control_strategy.h @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright (c) 2021-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * Copyright (c) 2022 Ansys, Inc. + * Copyright (c) 2022-2025 Ansys, Inc. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -224,24 +224,33 @@ struct TransitionDynamics double value{0.0}; }; +/// Specifies the dynamics of lane offset transition and defines how it changes over distance. +struct LaneOffsetActionDynamics +{ + Shape shape{Shape::kUndefined}; ///< The shape of the transition function between current and target lane offset + units::acceleration::meters_per_second_squared_t max_lateral_acc{}; ///< Maximum lateral acceleration used to initially reach and afterwards keep the lane offset +}; + /// Controls the transition to a defined lane offset of an entity struct AcquireLaneOffsetControlStrategy : public ControlStrategy { /// @brief Constructs a AcquireLaneOffsetControlStrategy /// as a ControlStrategy with predefined values /// - /// @param[in] offset Lane offset - /// @param[in] transition_dynamics Specifies the dynamics of a value transition + /// @param[in] offset Lane offset + /// @param[in] continuous Flag to control the completion of action + /// @param[in] lane_offset_action_dynamics Parameters defining the dynamics of the LaneOffsetAction explicit AcquireLaneOffsetControlStrategy(units::length::meter_t offset = {}, - TransitionDynamics transition_dynamics = {}) + bool continuous = false, + LaneOffsetActionDynamics lane_offset_action_dynamics = {}) : ControlStrategy{MovementDomain::kLateral, ControlStrategyType::kAcquireLaneOffset}, offset{offset}, - transition_dynamics{transition_dynamics} {} + continuous{continuous}, + lane_offset_action_dynamics{lane_offset_action_dynamics} {} - /// Lane offset - units::length::meter_t offset; - /// Specifies the dynamics of a value transition - TransitionDynamics transition_dynamics; + units::length::meter_t offset; ///< Lane offset + bool continuous; ///< If false, the action ends when the target lane-offset is reached. If true it does not end but has to be stopped. + LaneOffsetActionDynamics lane_offset_action_dynamics; ///< Parameters defining the dynamics of the LaneOffsetAction }; /// Controls the transition of a vehicle light state to the target light state