From 1a26fa115e2a1874191623a66a37e41e94e0fe69 Mon Sep 17 00:00:00 2001 From: Rene Paris <rene.paris@in-tech.com> Date: Thu, 1 Jun 2023 15:11:59 +0200 Subject: [PATCH] finished --- README.md | 68 +++++++++---------- doc/architecture.md | 8 +-- doc/generator.md | 28 ++++---- engine/CMakeLists.txt | 2 +- engine/deps/scenario_api | 2 +- .../RelativeClearanceCondition_impl.cpp | 4 +- .../VariableCondition_impl.cpp | 4 +- .../GenericAction/AddEntityAction.h | 1 - .../GenericAction/AnimationAction_impl.cpp | 4 +- .../GenericAction/DeleteEntityAction.h | 7 +- .../GenericAction/DeleteEntityAction_base.h | 3 - .../GenericAction/EnvironmentAction.h | 3 - .../GenericAction/EnvironmentAction_base.h | 2 - .../GenericAction/LightStateAction_impl.cpp | 4 +- .../GenericAction/ParameterModifyAction.h | 3 - .../ParameterModifyAction_base.h | 2 - .../GenericAction/ParameterSetAction.h | 3 - .../GenericAction/ParameterSetAction_base.h | 3 - .../GenericAction/SpeedProfileAction_impl.cpp | 4 +- .../TrafficSignalControllerAction.h | 3 - .../TrafficSignalControllerAction_base.h | 2 - .../GenericAction/TrafficSignalStateAction.h | 3 - .../TrafficSignalStateAction_base.h | 3 - .../GenericAction/VariableModifyAction.h | 3 - .../GenericAction/VariableModifyAction_base.h | 3 - .../VariableModifyAction_impl.cpp | 4 +- .../GenericAction/VariableSetAction.h | 3 - .../GenericAction/VariableSetAction_base.h | 3 - .../GenericAction/VariableSetAction_impl.cpp | 4 +- engine/src/Node/ConditionNode.h | 2 +- .../ReachPositionCondition_impl.cpp | 2 + .../TrafficSignalStateActionTest.cpp | 3 +- .../Storyboard/ByValueCondition_impl.cpp.j2 | 7 +- .../Storyboard/GenericAction_impl.cpp.j2 | 7 +- .../MotionControlAction_impl.cpp.j2 | 9 +-- 35 files changed, 86 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index 2afa7ae1..e024a051 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # User Guide -The **OpenScenarioEngine** is an implementation of the component _OpenSCENARIO Director_, as proposed by the the [ASAM **OpenSCENARIO 1.1**](https://www.asam.net/standards/detail/openscenario/) standard: +The **OpenScenarioEngine** is an implementation of the component _OpenSCENARIO Director_, as proposed by the the [ASAM **OpenSCENARIO 1.2.0**](https://www.asam.net/standards/detail/openscenario/) standard: > An OpenSCENARIO Director (OSC Director) is a component that interprets the OSC Model Instance and governs the progress of a scenario in a simulation. The OSC Director is the component responsible for running the scenario. @@ -102,44 +102,44 @@ CMAKE_PREFIX_PATH=<path_to_engine>/engine/deps/openscenario_api/cpp/build/cgRele ## Covered Actions and Conditions -The following Actions and Conditions of [OpenSCENARIO v1.1](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/index.html) are under development: +The following Actions and Conditions of [OpenSCENARIO v1.1](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/index.html) are under development: ### Conditions | Type | Subtype | Status | | ------------------| ------------- | ------------------------------------------------------------------------------------------------------------ | -| ByEntityCondition | [ReachPositionCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/ReachPositionCondition.html) | âœ”ï¸ Restricted by conversion: see [Conversions::Position](#position) below | -| ByEntityCondition | [RelativeDistanceCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/RelativeDistanceCondition.html) | Supports only `RelativeDistanceType::kLongitudinal && CoordinateSystem::kEntity` | -| ByEntityCondition | [RelativeSpeedCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/RelativeSpeedCondition.html) | âœ”ï¸ Complete | -| ByEntityCondition | [TimeHeadwayCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/TimeHeadwayCondition.html) | Supports only `DistanceType::kEuclidean` and `CoordinateSystem::kEntity` or `CoordinateSystem::kLane` | -| ByEntityCondition | [TimeToCollisionCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/TimeToCollisionCondition.html) | In clarification: [Issue #7](https://gitlab.eclipse.org/eclipse/openopass/openscenario1_engine/-/issues/7) | -| ByValueCondition | [SimulationTimeCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/SimulationTimeCondition.html) | âœ”ï¸ Complete | -| ByValueCondition | [UserDefinedValueCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/UserDefinedValueCondition.html) | âœ”ï¸ Complete | +| ByEntityCondition | [ReachPositionCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/ReachPositionCondition.html) | âœ”ï¸ Restricted by conversion: see [Conversions::Position](#position) below | +| ByEntityCondition | [RelativeDistanceCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/RelativeDistanceCondition.html) | Supports only `RelativeDistanceType::kLongitudinal && CoordinateSystem::kEntity` | +| ByEntityCondition | [RelativeSpeedCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/RelativeSpeedCondition.html) | âœ”ï¸ Complete | +| ByEntityCondition | [TimeHeadwayCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/TimeHeadwayCondition.html) | Supports only `DistanceType::kEuclidean` and `CoordinateSystem::kEntity` or `CoordinateSystem::kLane` | +| ByEntityCondition | [TimeToCollisionCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/TimeToCollisionCondition.html) | In clarification: [Issue #7](https://gitlab.eclipse.org/eclipse/openopass/openscenario1_engine/-/issues/7) | +| ByValueCondition | [SimulationTimeCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/SimulationTimeCondition.html) | âœ”ï¸ Complete | +| ByValueCondition | [UserDefinedValueCondition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/UserDefinedValueCondition.html) | âœ”ï¸ Complete | ### Actions | Interface | Type | Status | | --------------------| -------------------------- | ---------- | -| _none_ | [AcquirePositionAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/AcquirePositionAction.html) | âœ”ï¸ Complete | -| _none_ | [AssignControllerAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/AssignControllerAction.html) | 🚧 Sets without consideration of motion domain | -| _none_ | [AssignRouteAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/AssignRouteAction.html) | âœ”ï¸ Restricted by conversion: see [Conversions::Position](#position) | -| _none_ | [CustomCommandAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/CustomCommandAction.html) | âœ”ï¸ Complete | -| _none_ | [DeleteEntityAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/DeleteEntityAction.html) | ⌠Broken (See [Issue #23](https://gitlab.eclipse.org/eclipse/openpass/openscenario1_engine/-/issues/23)) | -| _none_ | [TeleportAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/TeleportAction.html) | âœ”ï¸ Restricted by conversion: see [Conversions::Position](#position) below | -| _none_ | [TrafficSignalAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/TrafficSignalAction.html) | âœ”ï¸ Complete | -| _none_ | [TrafficSignalStateAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/TrafficSignalStateAction.html) | âœ”ï¸ Complete | -| _none_ | [TrafficSinkAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/TrafficSinkAction.html) | âœ”ï¸ Does not interpret `rate` and `TrafficDefinition`, and restricted by conversion: see [Conversions::Position](#position) below | -| _none_ | [VisibilityAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/VisibilityAction.html) | âœ”ï¸ Complete | -| MotionControlAction | [FollowTrajectoryAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/FollowTrajectoryAction.html) | âœ”ï¸ Complete (Possibility for optimization in the base class) | -| MotionControlAction | [LaneChangeAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/LaneChangeAction.html) | âœ”ï¸ Complete | -| MotionControlAction | [LaneOffsetAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/LaneOffsetAction.html) | ⌠Not yet implemented | -| MotionControlAction | [LateralDistanceAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/LateralDistanceAction.html) | ⌠Not yet implemented | -| MotionControlAction | [LongitudinalDistanceAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/LongitudinalDistanceAction.html) | ⌠Not yet implemented | -| MotionControlAction | [SpeedAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/SpeedAction.html) | 🚧 Supports shapes linear and cubic, latter using linear shape coefficients (see [MR74](https://gitlab.eclipse.org/eclipse/openopass/openscenario1_engine/-/merge_requests/74)) | +| _none_ | [AcquirePositionAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/AcquirePositionAction.html) | âœ”ï¸ Complete | +| _none_ | [AssignControllerAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/AssignControllerAction.html) | 🚧 Sets without consideration of motion domain | +| _none_ | [AssignRouteAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/AssignRouteAction.html) | âœ”ï¸ Restricted by conversion: see [Conversions::Position](#position) | +| _none_ | [CustomCommandAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/CustomCommandAction.html) | âœ”ï¸ Complete | +| _none_ | [DeleteEntityAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/DeleteEntityAction.html) | ⌠Broken (See [Issue #23](https://gitlab.eclipse.org/eclipse/openpass/openscenario1_engine/-/issues/23)) | +| _none_ | [TeleportAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/TeleportAction.html) | âœ”ï¸ Restricted by conversion: see [Conversions::Position](#position) below | +| _none_ | [TrafficSignalAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/TrafficSignalAction.html) | âœ”ï¸ Complete | +| _none_ | [TrafficSignalStateAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/TrafficSignalStateAction.html) | âœ”ï¸ Complete | +| _none_ | [TrafficSinkAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/TrafficSinkAction.html) | âœ”ï¸ Does not interpret `rate` and `TrafficDefinition`, and restricted by conversion: see [Conversions::Position](#position) below | +| _none_ | [VisibilityAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/VisibilityAction.html) | âœ”ï¸ Complete | +| MotionControlAction | [FollowTrajectoryAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/FollowTrajectoryAction.html) | âœ”ï¸ Complete (Possibility for optimization in the base class) | +| MotionControlAction | [LaneChangeAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/LaneChangeAction.html) | âœ”ï¸ Complete | +| MotionControlAction | [LaneOffsetAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/LaneOffsetAction.html) | ⌠Not yet implemented | +| MotionControlAction | [LateralDistanceAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/LateralDistanceAction.html) | ⌠Not yet implemented | +| MotionControlAction | [LongitudinalDistanceAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/LongitudinalDistanceAction.html) | ⌠Not yet implemented | +| MotionControlAction | [SpeedAction](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/SpeedAction.html) | 🚧 Supports shapes linear and cubic, latter using linear shape coefficients (see [MR74](https://gitlab.eclipse.org/eclipse/openopass/openscenario1_engine/-/merge_requests/74)) | ## TrafficSignalController -If defined in the road network, the engine manages [TrafficSignalController](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/TrafficSignalController.html)s on its own. +If defined in the road network, the engine manages [TrafficSignalController](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/TrafficSignalController.html)s on its own. The corresponding traffic light states of the traffic light phases are automatically emitted for the respective time steps, using the interface `mantle_api::IEnvironment::SetTrafficSignalState`. Restrictions: @@ -153,7 +153,7 @@ Restrictions: Converts number (ID) of the target lane entity from string to [mantle_api::LaneId](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Map/lane_definitio.h) ### Coordinate System -Converts `NET_ASAM_OPENSCENARIO::v1_1::CoordinateSystem` enum to [OpenScenario::CoordinateSystem](https://code.in-tech.global/projects/PBESH/repos/openpass-openscenarioengine/browse/ose/src/nodes/utils/ConvertScenarioCoordinateSystem.h) enum. +Converts `NET_ASAM_OPENSCENARIO::v1_2::CoordinateSystem` enum to [OpenScenario::CoordinateSystem](https://code.in-tech.global/projects/PBESH/repos/openpass-openscenarioengine/browse/ose/src/nodes/utils/ConvertScenarioCoordinateSystem.h) enum. ### Lane Change Target Converts to [mantle_api::UniqueId](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Common/i_identifiable.h) @@ -181,10 +181,10 @@ Converts to [mantle_api::Pose](https://gitlab.eclipse.org/eclipse/openpass/mantl | TrajectoryPosition | ⌠| ### Relative Distance Type -Converts `NET_ASAM_OPENSCENARIO::v1_1::IRelativeDistanceType` enum type to [OpenScenario::RelativeDistanceType](https://code.in-tech.global/projects/PBESH/repos/openpass-openscenarioengine/browse/ose/src/nodes/utils/ConvertScenarioRelativeDistanceType.h) enum. +Converts `NET_ASAM_OPENSCENARIO::v1_2::IRelativeDistanceType` enum type to [OpenScenario::RelativeDistanceType](https://code.in-tech.global/projects/PBESH/repos/openpass-openscenarioengine/browse/ose/src/nodes/utils/ConvertScenarioRelativeDistanceType.h) enum. ### Relative Target Lane -Converts `NET_ASAM_OPENSCENARIO::v1_1::IRelativeTargetLane` type object to [mantle_api::UniqueId](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Common/i_identifiable.h) from its relative pose and the signed number of lanes that is offset from the reference entity's current lane. +Converts `NET_ASAM_OPENSCENARIO::v1_2::IRelativeTargetLane` type object to [mantle_api::UniqueId](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Common/i_identifiable.h) from its relative pose and the signed number of lanes that is offset from the reference entity's current lane. ### Route Converts to [OPENSCENARIO::Route](https://code.in-tech.global/projects/PBESH/repos/openpass-openscenarioengine/browse/ose/src/nodes/utils/ConvertScenarioRoute.h) @@ -212,16 +212,16 @@ Converts to `OPENSCENARIO::SpeedActionTarget` which is of type `units::velocity: | RelativeTargetSpeed | âœ”ï¸ | ### Time Reference -Converts `NET_ASAM_OPENSCENARIO::v1_1::ITimeReference` object type to [mantle_api::FollowTrajectoryControlStrategy::TrajectoryTimeReference](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Traffic/control_strategy.h) when the timing information is taken into account. **Note**: For now only absolute time value is considered but not relative time value. +Converts `NET_ASAM_OPENSCENARIO::v1_2::ITimeReference` object type to [mantle_api::FollowTrajectoryControlStrategy::TrajectoryTimeReference](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Traffic/control_strategy.h) when the timing information is taken into account. **Note**: For now only absolute time value is considered but not relative time value. ### Time to Collision Condition Target -Converts `NET_ASAM_OPENSCENARIO::v1_1::ITimeToCollisionConditionTarget` object type either of `mantle_api::Pose` or `Entity` depending on its property. **Note**: If the object has the property `Position`, then it is restricted by conversion [Conversions::Position](#position) +Converts `NET_ASAM_OPENSCENARIO::v1_2::ITimeToCollisionConditionTarget` object type either of `mantle_api::Pose` or `Entity` depending on its property. **Note**: If the object has the property `Position`, then it is restricted by conversion [Conversions::Position](#position) ### Traffic Signal Controller -Takes in the `NET_ASAM_OPENSCENARIO::v1_1::ITrafficSignalController` object type and returns the name of the target object in the form of a string. +Takes in the `NET_ASAM_OPENSCENARIO::v1_2::ITrafficSignalController` object type and returns the name of the target object in the form of a string. ### Trajectory Reference -Converts `NET_ASAM_OPENSCENARIO::v1_1::ITrajectoryRef` object type to [mantle_api::Trajectory](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Common/trajectory.h) +Converts `NET_ASAM_OPENSCENARIO::v1_2::ITrajectoryRef` object type to [mantle_api::Trajectory](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Common/trajectory.h) | Subtype | Status | |------------------------| :----: | @@ -229,7 +229,7 @@ Converts `NET_ASAM_OPENSCENARIO::v1_1::ITrajectoryRef` object type to [mantle_ap | CatalogReference | âœ”ï¸ | ### Transition Dynamics -Converts `NET_ASAM_OPENSCENARIO::v1_1::ITransitionDynamics` object type to [mantle_api::TransitionDynamics](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Traffic/control_strategy.h) +Converts `NET_ASAM_OPENSCENARIO::v1_2::ITransitionDynamics` object type to [mantle_api::TransitionDynamics](https://gitlab.eclipse.org/eclipse/openpass/mantle-api/-/blob/master/include/MantleAPI/Traffic/control_strategy.h) **Note**: Right now the property `followingMode` is not considered. # Dependencies diff --git a/doc/architecture.md b/doc/architecture.md index e74355cf..7a746d94 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -102,7 +102,7 @@ Suppose that somewhere in the scenario definition, the user specifies a `Distanc When the conversion reaches the `ConditionGroup`, the function `parse(condition)` is called, which shall act as entry point of this example (see `src/Conversion/OscToNode/ParseCondition.cpp`): ```cpp -yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::ICondition> condition) +yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::ICondition> condition) { return std::make_shared<yase::ConditionNode>( condition->GetName(), @@ -140,7 +140,7 @@ The function `resolveChildCondition` (same source file) shows how the engine mak ```cpp namespace detail { -yase::BehaviorNode::Ptr resolveChildCondition(const std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::ICondition>& condition) +yase::BehaviorNode::Ptr resolveChildCondition(const std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::ICondition>& condition) { if (auto element = condition->GetByEntityCondition(); element) { @@ -150,7 +150,7 @@ yase::BehaviorNode::Ptr resolveChildCondition(const std::shared_ptr<NET_ASAM_OPE { return parse(element); } - throw std::runtime_error("Corrupted openSCENARIO file: No choice made within std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::ICondition>"); + throw std::runtime_error("Corrupted openSCENARIO file: No choice made within std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::ICondition>"); } } // namespace detail ``` @@ -184,7 +184,7 @@ In other words `SimulationTimeCondition` will become the direct child `Condition For *list type*s, such as `Actions` in the `Event` element, parsing unwraps the individual elements into children of an ``yase::ParallelNode`` (see `gen/Conversion/OscToNode/ParseActions.cpp`): ```cpp -yase::BehaviorNode::Ptr parse(std::vector<std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IAction>> actions) +yase::BehaviorNode::Ptr parse(std::vector<std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::IAction>> actions) { auto node = std::make_shared<yase::ParallelNode>("Actions"); for (const auto& action : actions) diff --git a/doc/generator.md b/doc/generator.md index dac50b28..51aeb253 100644 --- a/doc/generator.md +++ b/doc/generator.md @@ -16,13 +16,13 @@ In the following the background, basic usage, and technical details, such as int ## Background -The [ASAM **OpenSCENARIO**](https://www.asam.net/standards/detail/openscenario/)'s _ground truth_ is an UML model (see [here](https://github.com/RA-Consulting-GmbH/openscenario.api.test/tree/master/generator/de.rac.openscenario.generator/src/main/resources/input)), which is used to generate various outputs such as OpenSCENARIO's **XML schema** and **model documentation** (see [here](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/index.html)), but also the **OpenScenarioLib** with its related **OpenSCENARIO API** (see [here](https://github.com/RA-Consulting-GmbH/openscenario.api.test)). +The [ASAM **OpenSCENARIO**](https://www.asam.net/standards/detail/openscenario/)'s _ground truth_ is an UML model (see [here](https://github.com/RA-Consulting-GmbH/openscenario.api.test/tree/master/generator/de.rac.openscenario.generator/src/main/resources/input)), which is used to generate various outputs such as OpenSCENARIO's **XML schema** and **model documentation** (see [here](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/index.html)), but also the **OpenScenarioLib** with its related **OpenSCENARIO API** (see [here](https://github.com/RA-Consulting-GmbH/openscenario.api.test)). When an OpenSCENARIO description is read by the parser component of the **OpenScenarioLib**, it maps each individual tag onto an object that implements the **OpenSCENARIO API**, such as the `Storyboard` or `SpeedAction` class. While this provides access to validated scenario file information, it does not provide the logical relationship between objects. The objective of the generator is to extract maximum logical relationship data from the model and augment it with metadata to create a functional behavior tree. -The generator uses the UML model of **OpenSCENARIO V1.1**, which has been converted into a `json` representation available here: [`generator/model/v1_1.json`](../generator/model/v1_1.json). +The generator uses the UML model of **OpenSCENARIO V1.2.0**, which has been converted into a `json` representation available here: [`generator/model/v1_2.json`](../generator/model/v1_2.json). ## Usage @@ -65,7 +65,7 @@ optional arguments: **âš ï¸ Attention** > If you are not familiar with the underlying behavior tree, it's strongly recommended to read the [Architecture Documentation](architecture.md) first. -Before generation begins, the UML model [`generator/model/v1_1.json`](../generator/model/v1_1.json) is converted into a tree, similar to this (c.f. [Model Documentation](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/index.html)): +Before generation begins, the UML model [`generator/model/v1_2.json`](../generator/model/v1_2.json) is converted into a tree, similar to this (c.f. [Model Documentation](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/index.html)): ``` Storyboard (1) @@ -119,7 +119,7 @@ Storyboard > Init > InitActions > GlobalAction > EnvironmentAction - `Storyboard`, `Init`, `InitActions`, and `GlobalAction` are processed as **Node**. - `EnvironmentAction` will e processed as **Leaf**. -- `EnvironmentAction` also has children, such as [`Environment`](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/Environment.html), which will become **Parameter**s of the action. +- `EnvironmentAction` also has children, such as [`Environment`](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/Environment.html), which will become **Parameter**s of the action. Processing of **Nodes**, **Leaves**, and **Parameters** are discussed further down in detail. For sake of clarity, **Integration of Generated Code** into the file structure of the engine and **Definition of Dependencies** will be described first: @@ -218,19 +218,19 @@ The generator distinguishes the following: Properties of a node with attribute `isXorElement` set to `True`. **Example** - The `Condition` object (c.f. line 1470 in [`v1_1.json`](../generator/model/v1_1.json)) can hold either a `ByEntityCondition` or a `ByValueCondition`, both properties in an **xor**-relationship. + The `Condition` object (c.f. line 1470 in [`v1_2.json`](../generator/model/v1_2.json)) can hold either a `ByEntityCondition` or a `ByValueCondition`, both properties in an **xor**-relationship. The generator will create the following code: ```cpp - yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::ICondition> condition) { + yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::ICondition> condition) { if (auto element = condition->GetByEntityCondition()) { return parse(element); } if (auto element = condition->GetByValueCondition()) { return parse(element); } - throw std::runtime_error("Corrupted openSCENARIO file: No choice made within std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::ICondition>"); + throw std::runtime_error("Corrupted openSCENARIO file: No choice made within std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::ICondition>"); } ``` @@ -246,13 +246,13 @@ The generator distinguishes the following: Properties of a node with attribute `isList` set to `True`. **Example** - The `Story` object (c.f. line 8631 in [`v1_1.json`](../generator/model/v1_1.json)) holds a list of acts. + The `Story` object (c.f. line 8631 in [`v1_2.json`](../generator/model/v1_2.json)) holds a list of acts. Processing needs to consider, that `parse(story->GetActs())` is a vector of `Act` objects. Before continuing with the next sub-type `Act`, the generator will create a list-seam for `Acts`: ```cpp - yase::BehaviorNode::Ptr parse(std::vector<std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IAct>> acts) + yase::BehaviorNode::Ptr parse(std::vector<std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::IAct>> acts) { auto node = std::make_shared<yase::ParallelNode>("Acts"); for (const auto& act : acts) @@ -275,12 +275,12 @@ The generator distinguishes the following: Checked by logic. **Example** - The `Trigger` object (c.f. line 10485 in [`v1_1.json`](../generator/model/v1_1.json)) holds only single element `conditionGroups`. + The `Trigger` object (c.f. line 10485 in [`v1_2.json`](../generator/model/v1_2.json)) holds only single element `conditionGroups`. The generator will create the following code: ```cpp - yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::ITrigger> trigger) + yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::ITrigger> trigger) { return trigger ? parse(trigger->GetConditionGroups()) : nullptr; } @@ -307,7 +307,7 @@ The generator distinguishes the following: The generator will create the following code: ```cpp - yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IAddEntityAction> addEntityAction) + yase::BehaviorNode::Ptr parse(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_2::IAddEntityAction> addEntityAction) { return std::make_shared<AddEntityAction>(addEntityAction); } @@ -349,7 +349,7 @@ Entities with entity relation get access to a service named `EntityBroker`, prov Augmenting model data with metadata is also necessary for decoupling of objects implementing the **OpenSCENARIO API** from the actual implementations of conditions and actions, formulated by the design principle *separation of values* described in the [Architecture Documentation](architecture.md). In essence, the generator possesses knowledge regarding the mappings between properties from the **OpenSCENARIO API** and internally used values. -The most used mapping is for the complex datatype [Position](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/index.html) offering diverse specializations, such as [WorldPosition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/WorldPosition.html), [RelativeLanePosition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/RelativeLanePosition.html), or [GeoPosition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/content/GeoPosition.html). +The most used mapping is for the complex datatype [Position](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/index.html) offering diverse specializations, such as [WorldPosition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/WorldPosition.html), [RelativeLanePosition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/RelativeLanePosition.html), or [GeoPosition](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/GeoPosition.html). By applying the mapping, the specification (which specifies the source for the position) is transformed into its result - a Cartesian point and an orientation. **Example** @@ -425,5 +425,5 @@ The corresponding conversion is defined in the [`metainfo.py`](../generator/meta **Processing Rules** -[Rule](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/index.html)s are a particular type of parameter that allow for logical comparisons between values. An example of such a comparison could be determining if the current value of a condition is _greater than or equal to_ **another parameter** within the node. +[Rule](https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/index.html)s are a particular type of parameter that allow for logical comparisons between values. An example of such a comparison could be determining if the current value of a condition is _greater than or equal to_ **another parameter** within the node. Therefore the rule parser is configured to consume the corresponding value of the node and instead provide a class which already contains the correct logic for checking if the rule is satisfied (see [`engine/src/Conversion/OscToMantle/ConvertScenarioRule.h`](../engine/src/Conversion/OscToMantle/ConvertScenarioRule.h)) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 8795bf63..a3ad12b5 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.16.3) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) set(PROJECT_NAME OpenScenarioEngine) -project(${PROJECT_NAME} VERSION 0.3) +project(${PROJECT_NAME} VERSION 0.4) # YASE set(DEP_YASE ${CMAKE_CURRENT_LIST_DIR}/deps/yase/middle_end/agnostic_behavior_tree) diff --git a/engine/deps/scenario_api b/engine/deps/scenario_api index 125625fe..5378f3e1 160000 --- a/engine/deps/scenario_api +++ b/engine/deps/scenario_api @@ -1 +1 @@ -Subproject commit 125625fef23339b55c382268eecb7e53082222c3 +Subproject commit 5378f3e135218db5ad93a0b9f81066be90079cb4 diff --git a/engine/gen/Storyboard/ByEntityCondition/RelativeClearanceCondition_impl.cpp b/engine/gen/Storyboard/ByEntityCondition/RelativeClearanceCondition_impl.cpp index cd60b53c..923adbd3 100644 --- a/engine/gen/Storyboard/ByEntityCondition/RelativeClearanceCondition_impl.cpp +++ b/engine/gen/Storyboard/ByEntityCondition/RelativeClearanceCondition_impl.cpp @@ -10,7 +10,7 @@ #include "Storyboard/ByEntityCondition/RelativeClearanceCondition_impl.h" -#include <iostream> +#include "Utils/Logger.h" namespace OpenScenarioEngine::v1_2 { @@ -19,7 +19,7 @@ bool RelativeClearanceCondition::IsSatisfied() const // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method RelativeClearanceCondition::IsSatisfied() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method RelativeClearanceCondition::IsSatisfied() not implemented yet (returning \"true\" by default)"); return true; } diff --git a/engine/gen/Storyboard/ByValueCondition/VariableCondition_impl.cpp b/engine/gen/Storyboard/ByValueCondition/VariableCondition_impl.cpp index 8e068529..704cadea 100644 --- a/engine/gen/Storyboard/ByValueCondition/VariableCondition_impl.cpp +++ b/engine/gen/Storyboard/ByValueCondition/VariableCondition_impl.cpp @@ -10,7 +10,7 @@ #include "Storyboard/ByValueCondition/VariableCondition_impl.h" -#include <iostream> +#include "Utils/Logger.h" namespace OpenScenarioEngine::v1_2 { @@ -19,7 +19,7 @@ bool VariableCondition::IsSatisfied() const // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method VariableCondition::IsSatisfied() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method VariableCondition::IsSatisfied() not implemented yet (returning \"true\" by default)"); return true; } diff --git a/engine/gen/Storyboard/GenericAction/AddEntityAction.h b/engine/gen/Storyboard/GenericAction/AddEntityAction.h index 1e58ac78..5afc1fa5 100644 --- a/engine/gen/Storyboard/GenericAction/AddEntityAction.h +++ b/engine/gen/Storyboard/GenericAction/AddEntityAction.h @@ -42,7 +42,6 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::AddEntityAction>( OpenScenarioEngine::v1_2::AddEntityAction::Values{ diff --git a/engine/gen/Storyboard/GenericAction/AnimationAction_impl.cpp b/engine/gen/Storyboard/GenericAction/AnimationAction_impl.cpp index 4b25caa4..33d123f6 100644 --- a/engine/gen/Storyboard/GenericAction/AnimationAction_impl.cpp +++ b/engine/gen/Storyboard/GenericAction/AnimationAction_impl.cpp @@ -10,7 +10,7 @@ #include "Storyboard/GenericAction/AnimationAction_impl.h" -#include <iostream> +#include "Utils/Logger.h" namespace OpenScenarioEngine::v1_2 { @@ -19,7 +19,7 @@ bool AnimationAction::Step() // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method AnimationAction::Step() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method AnimationAction::Step() not implemented yet (returning \"true\" by default)"); return true; } diff --git a/engine/gen/Storyboard/GenericAction/DeleteEntityAction.h b/engine/gen/Storyboard/GenericAction/DeleteEntityAction.h index faf27c59..f2660945 100644 --- a/engine/gen/Storyboard/GenericAction/DeleteEntityAction.h +++ b/engine/gen/Storyboard/GenericAction/DeleteEntityAction.h @@ -19,7 +19,6 @@ #include <utility> #include "Storyboard/GenericAction/DeleteEntityAction_impl.h" -#include "Utils/EntityBroker.h" class DeleteEntityAction : public yase::ActionNode { @@ -43,13 +42,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::DeleteEntityAction>( - OpenScenarioEngine::v1_2::DeleteEntityAction::Values{ - entityBroker->GetEntities(), - - }, + OpenScenarioEngine::v1_2::DeleteEntityAction::Values{}, OpenScenarioEngine::v1_2::DeleteEntityAction::Interfaces{ environment}); } diff --git a/engine/gen/Storyboard/GenericAction/DeleteEntityAction_base.h b/engine/gen/Storyboard/GenericAction/DeleteEntityAction_base.h index 5fd1c1f6..6ced05cc 100644 --- a/engine/gen/Storyboard/GenericAction/DeleteEntityAction_base.h +++ b/engine/gen/Storyboard/GenericAction/DeleteEntityAction_base.h @@ -13,8 +13,6 @@ #include <MantleAPI/Execution/i_environment.h> -#include "Utils/EntityBroker.h" - namespace OpenScenarioEngine::v1_2 { class DeleteEntityActionBase @@ -22,7 +20,6 @@ class DeleteEntityActionBase public: struct Values { - Entities entities; }; struct Interfaces { diff --git a/engine/gen/Storyboard/GenericAction/EnvironmentAction.h b/engine/gen/Storyboard/GenericAction/EnvironmentAction.h index 529ecaaf..dd07d4ff 100644 --- a/engine/gen/Storyboard/GenericAction/EnvironmentAction.h +++ b/engine/gen/Storyboard/GenericAction/EnvironmentAction.h @@ -19,7 +19,6 @@ #include <utility> #include "Storyboard/GenericAction/EnvironmentAction_impl.h" -#include "Utils/EntityBroker.h" class EnvironmentAction : public yase::ActionNode { @@ -43,11 +42,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::EnvironmentAction>( OpenScenarioEngine::v1_2::EnvironmentAction::Values{ - entityBroker->GetEntities(), OPENSCENARIO::ConvertScenarioEnvironment(environmentAction_->GetEnvironment()), OPENSCENARIO::ConvertScenarioCatalogReference(environmentAction_->GetCatalogReference())}, OpenScenarioEngine::v1_2::EnvironmentAction::Interfaces{ diff --git a/engine/gen/Storyboard/GenericAction/EnvironmentAction_base.h b/engine/gen/Storyboard/GenericAction/EnvironmentAction_base.h index a413d2c6..6f2b11a4 100644 --- a/engine/gen/Storyboard/GenericAction/EnvironmentAction_base.h +++ b/engine/gen/Storyboard/GenericAction/EnvironmentAction_base.h @@ -15,7 +15,6 @@ #include "Conversion/OscToMantle/ConvertScenarioCatalogReference.h" #include "Conversion/OscToMantle/ConvertScenarioEnvironment.h" -#include "Utils/EntityBroker.h" namespace OpenScenarioEngine::v1_2 { @@ -24,7 +23,6 @@ class EnvironmentActionBase public: struct Values { - Entities entities; OPENSCENARIO::Environment environment; OPENSCENARIO::CatalogReference catalogReference; }; diff --git a/engine/gen/Storyboard/GenericAction/LightStateAction_impl.cpp b/engine/gen/Storyboard/GenericAction/LightStateAction_impl.cpp index 74800ca0..beb6d029 100644 --- a/engine/gen/Storyboard/GenericAction/LightStateAction_impl.cpp +++ b/engine/gen/Storyboard/GenericAction/LightStateAction_impl.cpp @@ -10,7 +10,7 @@ #include "Storyboard/GenericAction/LightStateAction_impl.h" -#include <iostream> +#include "Utils/Logger.h" namespace OpenScenarioEngine::v1_2 { @@ -19,7 +19,7 @@ bool LightStateAction::Step() // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method LightStateAction::Step() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method LightStateAction::Step() not implemented yet (returning \"true\" by default)"); return true; } diff --git a/engine/gen/Storyboard/GenericAction/ParameterModifyAction.h b/engine/gen/Storyboard/GenericAction/ParameterModifyAction.h index 4dcafeb5..74e01ad1 100644 --- a/engine/gen/Storyboard/GenericAction/ParameterModifyAction.h +++ b/engine/gen/Storyboard/GenericAction/ParameterModifyAction.h @@ -19,7 +19,6 @@ #include <utility> #include "Storyboard/GenericAction/ParameterModifyAction_impl.h" -#include "Utils/EntityBroker.h" class ParameterModifyAction : public yase::ActionNode { @@ -43,11 +42,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::ParameterModifyAction>( OpenScenarioEngine::v1_2::ParameterModifyAction::Values{ - entityBroker->GetEntities(), OPENSCENARIO::ConvertScenarioModifyRule(parameterModifyAction_->GetRule())}, OpenScenarioEngine::v1_2::ParameterModifyAction::Interfaces{ environment}); diff --git a/engine/gen/Storyboard/GenericAction/ParameterModifyAction_base.h b/engine/gen/Storyboard/GenericAction/ParameterModifyAction_base.h index 776cfb7f..b088a325 100644 --- a/engine/gen/Storyboard/GenericAction/ParameterModifyAction_base.h +++ b/engine/gen/Storyboard/GenericAction/ParameterModifyAction_base.h @@ -14,7 +14,6 @@ #include <MantleAPI/Execution/i_environment.h> #include "Conversion/OscToMantle/ConvertScenarioModifyRule.h" -#include "Utils/EntityBroker.h" namespace OpenScenarioEngine::v1_2 { @@ -23,7 +22,6 @@ class ParameterModifyActionBase public: struct Values { - Entities entities; OPENSCENARIO::ModifyRule rule; }; struct Interfaces diff --git a/engine/gen/Storyboard/GenericAction/ParameterSetAction.h b/engine/gen/Storyboard/GenericAction/ParameterSetAction.h index d88da7e1..a7722fc2 100644 --- a/engine/gen/Storyboard/GenericAction/ParameterSetAction.h +++ b/engine/gen/Storyboard/GenericAction/ParameterSetAction.h @@ -19,7 +19,6 @@ #include <utility> #include "Storyboard/GenericAction/ParameterSetAction_impl.h" -#include "Utils/EntityBroker.h" class ParameterSetAction : public yase::ActionNode { @@ -43,11 +42,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::ParameterSetAction>( OpenScenarioEngine::v1_2::ParameterSetAction::Values{ - entityBroker->GetEntities(), parameterSetAction_->GetValue()}, OpenScenarioEngine::v1_2::ParameterSetAction::Interfaces{ environment}); diff --git a/engine/gen/Storyboard/GenericAction/ParameterSetAction_base.h b/engine/gen/Storyboard/GenericAction/ParameterSetAction_base.h index 74fca159..f09ef7e6 100644 --- a/engine/gen/Storyboard/GenericAction/ParameterSetAction_base.h +++ b/engine/gen/Storyboard/GenericAction/ParameterSetAction_base.h @@ -15,8 +15,6 @@ #include <string> -#include "Utils/EntityBroker.h" - namespace OpenScenarioEngine::v1_2 { class ParameterSetActionBase @@ -24,7 +22,6 @@ class ParameterSetActionBase public: struct Values { - Entities entities; std::string value; }; struct Interfaces diff --git a/engine/gen/Storyboard/GenericAction/SpeedProfileAction_impl.cpp b/engine/gen/Storyboard/GenericAction/SpeedProfileAction_impl.cpp index 403ca632..95f8b43b 100644 --- a/engine/gen/Storyboard/GenericAction/SpeedProfileAction_impl.cpp +++ b/engine/gen/Storyboard/GenericAction/SpeedProfileAction_impl.cpp @@ -10,7 +10,7 @@ #include "Storyboard/GenericAction/SpeedProfileAction_impl.h" -#include <iostream> +#include "Utils/Logger.h" namespace OpenScenarioEngine::v1_2 { @@ -19,7 +19,7 @@ bool SpeedProfileAction::Step() // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method SpeedProfileAction::Step() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method SpeedProfileAction::Step() not implemented yet (returning \"true\" by default)"); return true; } diff --git a/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction.h b/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction.h index 818068de..584cfb69 100644 --- a/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction.h +++ b/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction.h @@ -19,7 +19,6 @@ #include <utility> #include "Storyboard/GenericAction/TrafficSignalControllerAction_impl.h" -#include "Utils/EntityBroker.h" class TrafficSignalControllerAction : public yase::ActionNode { @@ -43,11 +42,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::TrafficSignalControllerAction>( OpenScenarioEngine::v1_2::TrafficSignalControllerAction::Values{ - entityBroker->GetEntities(), trafficSignalControllerAction_->GetPhase(), OPENSCENARIO::ConvertScenarioTrafficSignalController(trafficSignalControllerAction_->GetTrafficSignalControllerRef()), OPENSCENARIO::ConvertScenarioPhase(trafficSignalControllerAction_->GetPhaseRef())}, diff --git a/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction_base.h b/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction_base.h index d5ff93b3..50de2464 100644 --- a/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction_base.h +++ b/engine/gen/Storyboard/GenericAction/TrafficSignalControllerAction_base.h @@ -17,7 +17,6 @@ #include "Conversion/OscToMantle/ConvertScenarioPhase.h" #include "Conversion/OscToMantle/ConvertScenarioTrafficSignalController.h" -#include "Utils/EntityBroker.h" namespace OpenScenarioEngine::v1_2 { @@ -26,7 +25,6 @@ class TrafficSignalControllerActionBase public: struct Values { - Entities entities; std::string phase; OPENSCENARIO::TrafficSignalController trafficSignalControllerRef; OPENSCENARIO::Phase phaseRef; diff --git a/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction.h b/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction.h index 0115f5e4..6e242658 100644 --- a/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction.h +++ b/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction.h @@ -19,7 +19,6 @@ #include <utility> #include "Storyboard/GenericAction/TrafficSignalStateAction_impl.h" -#include "Utils/EntityBroker.h" class TrafficSignalStateAction : public yase::ActionNode { @@ -43,11 +42,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::TrafficSignalStateAction>( OpenScenarioEngine::v1_2::TrafficSignalStateAction::Values{ - entityBroker->GetEntities(), trafficSignalStateAction_->GetName(), trafficSignalStateAction_->GetState()}, OpenScenarioEngine::v1_2::TrafficSignalStateAction::Interfaces{ diff --git a/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction_base.h b/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction_base.h index 021ae984..50e6a32f 100644 --- a/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction_base.h +++ b/engine/gen/Storyboard/GenericAction/TrafficSignalStateAction_base.h @@ -15,8 +15,6 @@ #include <string> -#include "Utils/EntityBroker.h" - namespace OpenScenarioEngine::v1_2 { class TrafficSignalStateActionBase @@ -24,7 +22,6 @@ class TrafficSignalStateActionBase public: struct Values { - Entities entities; std::string name; std::string state; }; diff --git a/engine/gen/Storyboard/GenericAction/VariableModifyAction.h b/engine/gen/Storyboard/GenericAction/VariableModifyAction.h index 390c03d5..edcc9379 100644 --- a/engine/gen/Storyboard/GenericAction/VariableModifyAction.h +++ b/engine/gen/Storyboard/GenericAction/VariableModifyAction.h @@ -18,7 +18,6 @@ #include <utility> #include "Storyboard/GenericAction/VariableModifyAction_impl.h" -#include "Utils/EntityBroker.h" class VariableModifyAction : public yase::ActionNode { @@ -42,11 +41,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::VariableModifyAction>( OpenScenarioEngine::v1_2::VariableModifyAction::Values{ - entityBroker->GetEntities(), }, OpenScenarioEngine::v1_2::VariableModifyAction::Interfaces{ diff --git a/engine/gen/Storyboard/GenericAction/VariableModifyAction_base.h b/engine/gen/Storyboard/GenericAction/VariableModifyAction_base.h index 47f239fa..ce62ef1d 100644 --- a/engine/gen/Storyboard/GenericAction/VariableModifyAction_base.h +++ b/engine/gen/Storyboard/GenericAction/VariableModifyAction_base.h @@ -12,8 +12,6 @@ #include <MantleAPI/Execution/i_environment.h> -#include "Utils/EntityBroker.h" - namespace OpenScenarioEngine::v1_2 { class VariableModifyActionBase @@ -21,7 +19,6 @@ class VariableModifyActionBase public: struct Values { - Entities entities; }; struct Interfaces { diff --git a/engine/gen/Storyboard/GenericAction/VariableModifyAction_impl.cpp b/engine/gen/Storyboard/GenericAction/VariableModifyAction_impl.cpp index 723f089e..2efd7f70 100644 --- a/engine/gen/Storyboard/GenericAction/VariableModifyAction_impl.cpp +++ b/engine/gen/Storyboard/GenericAction/VariableModifyAction_impl.cpp @@ -10,7 +10,7 @@ #include "Storyboard/GenericAction/VariableModifyAction_impl.h" -#include <iostream> +#include "Utils/Logger.h" namespace OpenScenarioEngine::v1_2 { @@ -19,7 +19,7 @@ bool VariableModifyAction::Step() // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method VariableModifyAction::Step() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method VariableModifyAction::Step() not implemented yet (returning \"true\" by default)"); return true; } diff --git a/engine/gen/Storyboard/GenericAction/VariableSetAction.h b/engine/gen/Storyboard/GenericAction/VariableSetAction.h index 914426f9..6c273214 100644 --- a/engine/gen/Storyboard/GenericAction/VariableSetAction.h +++ b/engine/gen/Storyboard/GenericAction/VariableSetAction.h @@ -18,7 +18,6 @@ #include <utility> #include "Storyboard/GenericAction/VariableSetAction_impl.h" -#include "Utils/EntityBroker.h" class VariableSetAction : public yase::ActionNode { @@ -42,11 +41,9 @@ private: void lookupAndRegisterData(yase::Blackboard& blackboard) final { std::shared_ptr<mantle_api::IEnvironment> environment = blackboard.get<std::shared_ptr<mantle_api::IEnvironment>>("Environment"); - const EntityBroker::Ptr entityBroker = blackboard.get<EntityBroker::Ptr>("EntityBroker"); impl_ = std::make_unique<OpenScenarioEngine::v1_2::VariableSetAction>( OpenScenarioEngine::v1_2::VariableSetAction::Values{ - entityBroker->GetEntities(), variableSetAction_->GetValue()}, OpenScenarioEngine::v1_2::VariableSetAction::Interfaces{ environment}); diff --git a/engine/gen/Storyboard/GenericAction/VariableSetAction_base.h b/engine/gen/Storyboard/GenericAction/VariableSetAction_base.h index 5ff5e547..f4b43db2 100644 --- a/engine/gen/Storyboard/GenericAction/VariableSetAction_base.h +++ b/engine/gen/Storyboard/GenericAction/VariableSetAction_base.h @@ -14,8 +14,6 @@ #include <string> -#include "Utils/EntityBroker.h" - namespace OpenScenarioEngine::v1_2 { class VariableSetActionBase @@ -23,7 +21,6 @@ class VariableSetActionBase public: struct Values { - Entities entities; std::string value; }; struct Interfaces diff --git a/engine/gen/Storyboard/GenericAction/VariableSetAction_impl.cpp b/engine/gen/Storyboard/GenericAction/VariableSetAction_impl.cpp index 0aefa3dd..8c286877 100644 --- a/engine/gen/Storyboard/GenericAction/VariableSetAction_impl.cpp +++ b/engine/gen/Storyboard/GenericAction/VariableSetAction_impl.cpp @@ -10,7 +10,7 @@ #include "Storyboard/GenericAction/VariableSetAction_impl.h" -#include <iostream> +#include "Utils/Logger.h" namespace OpenScenarioEngine::v1_2 { @@ -19,7 +19,7 @@ bool VariableSetAction::Step() // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method VariableSetAction::Step() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method VariableSetAction::Step() not implemented yet (returning \"true\" by default)"); return true; } diff --git a/engine/src/Node/ConditionNode.h b/engine/src/Node/ConditionNode.h index 00b8d38e..37c55843 100644 --- a/engine/src/Node/ConditionNode.h +++ b/engine/src/Node/ConditionNode.h @@ -23,7 +23,7 @@ namespace yase { /// Checks if underlying conditions are satisfied and adds control flow logic, such as delayed execution /// -/// \see https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.1.1_Model_Documentation/modelDocumentation/index.html +/// \see https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/index.html class ConditionNode : public yase::DecoratorNode { public: diff --git a/engine/src/Storyboard/ByEntityCondition/ReachPositionCondition_impl.cpp b/engine/src/Storyboard/ByEntityCondition/ReachPositionCondition_impl.cpp index e74487e1..685f8972 100644 --- a/engine/src/Storyboard/ByEntityCondition/ReachPositionCondition_impl.cpp +++ b/engine/src/Storyboard/ByEntityCondition/ReachPositionCondition_impl.cpp @@ -12,6 +12,8 @@ #include <units.h> +#include "Utils/Logger.h" + namespace OpenScenarioEngine::v1_2 { bool ReachPositionCondition::IsSatisfied() const diff --git a/engine/tests/Storyboard/GenericAction/TrafficSignalStateActionTest.cpp b/engine/tests/Storyboard/GenericAction/TrafficSignalStateActionTest.cpp index 40a72402..54c4ab6c 100644 --- a/engine/tests/Storyboard/GenericAction/TrafficSignalStateActionTest.cpp +++ b/engine/tests/Storyboard/GenericAction/TrafficSignalStateActionTest.cpp @@ -28,8 +28,7 @@ TEST(TrafficSignalStateActionTest, GivenTrafficStateAndName_SetTrafficSignal) SetTrafficSignalState(expected_name, expected_state)) .WillByDefault(Return()); - OpenScenarioEngine::v1_2::TrafficSignalStateAction trafficSignalStateAction({{"traffic_signal"}, - expected_name, + OpenScenarioEngine::v1_2::TrafficSignalStateAction trafficSignalStateAction({expected_name, expected_state}, {mockEnvironment}); diff --git a/generator/templates/Storyboard/ByValueCondition_impl.cpp.j2 b/generator/templates/Storyboard/ByValueCondition_impl.cpp.j2 index eec59a52..7091e4ab 100644 --- a/generator/templates/Storyboard/ByValueCondition_impl.cpp.j2 +++ b/generator/templates/Storyboard/ByValueCondition_impl.cpp.j2 @@ -11,7 +11,8 @@ {% block header %} #include "Storyboard/ByValueCondition/{{ name }}_impl.h" {% endblock %} -#include <iostream> + +#include "Utils/Logger.h" namespace {{ ose_namespace }} { @@ -20,8 +21,8 @@ bool {{ name }}::IsSatisfied() const // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method {{ name }}::IsSatisfied() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method {{ name }}::IsSatisfied() not implemented yet (returning \"true\" by default)"); return true; } -} // namespace {{ ose_namespace }} \ No newline at end of file +} // namespace {{ ose_namespace }} diff --git a/generator/templates/Storyboard/GenericAction_impl.cpp.j2 b/generator/templates/Storyboard/GenericAction_impl.cpp.j2 index 96873384..6c86e13f 100644 --- a/generator/templates/Storyboard/GenericAction_impl.cpp.j2 +++ b/generator/templates/Storyboard/GenericAction_impl.cpp.j2 @@ -9,7 +9,8 @@ ********************************************************************************/ #include "Storyboard/GenericAction/{{ name }}_impl.h" -#include <iostream> + +#include "Utils/Logger.h" namespace {{ ose_namespace }} { @@ -18,8 +19,8 @@ bool {{ name }}::Step() // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method {{ name }}::Step() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method {{ name }}::Step() not implemented yet (returning \"true\" by default)"); return true; } -} // namespace {{ ose_namespace }} \ No newline at end of file +} // namespace {{ ose_namespace }} diff --git a/generator/templates/Storyboard/MotionControlAction_impl.cpp.j2 b/generator/templates/Storyboard/MotionControlAction_impl.cpp.j2 index d408ca23..00081998 100644 --- a/generator/templates/Storyboard/MotionControlAction_impl.cpp.j2 +++ b/generator/templates/Storyboard/MotionControlAction_impl.cpp.j2 @@ -9,7 +9,8 @@ ********************************************************************************/ #include "Storyboard/MotionControlAction/{{ name }}_impl.h" -#include <iostream> + +#include "Utils/Logger.h" namespace {{ ose_namespace }} { @@ -18,7 +19,7 @@ void {{ name }}::SetControlStrategy() // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method {{ name }}::SetControlStrategy() not implemented yet\n"; + OPENSCENARIO::Logger::Warning("Method {{ name }}::SetControlStrategy() not implemented yet"); } bool {{ name }}::HasControlStrategyGoalBeenReached(const std::string& actor) @@ -26,7 +27,7 @@ bool {{ name }}::HasControlStrategyGoalBeenReached(const std::string& actor) // Note: // - Access to values parse to mantle/ose datatypes: this->values.xxx // - Access to mantle interfaces: this->mantle.xxx - std::cout << "Method {{ name }}::HasControlStrategyGoalBeenReached() not implemented yet (returning \"true\" by default)\n"; + OPENSCENARIO::Logger::Warning("Method {{ name }}::HasControlStrategyGoalBeenReached() not implemented yet (returning \"true\" by default)"); return true; } @@ -36,4 +37,4 @@ mantle_api::MovementDomain {{ name }}::GetMovementDomain() const return mantle_api::MovementDomain::kLateral; } -} // namespace {{ ose_namespace }} \ No newline at end of file +} // namespace {{ ose_namespace }} -- GitLab