diff --git a/README.md b/README.md index 2afa7ae1da7567f6ec4ec15bf6f55def925320ad..e024a0519b0de24316f802c94f9eca035f253c7b 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 e74355cf3ba9216522bf0477f1e03fd2d6931485..7a746d94c5fe86b3c6e2432cd24d307350e0eb4b 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 dac50b2802c09f688048c6cdcc8cde6bb82df67c..51aeb2531b23153c33d716fa0dbfdd71624e776e 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 8795bf630a1b6f27fc32f0e29af389278f6e22c5..a3ad12b50ba13f8344ebf32507a6609d143a13b4 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 125625fef23339b55c382268eecb7e53082222c3..5378f3e135218db5ad93a0b9f81066be90079cb4 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 cd60b53c3ccccfb75012d40bdac36b1f05233a85..923adbd36ae9bfa7f21469d0eac0f4b7f6088e21 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 8e0685293ff456213a5816b959194f8e99a10a31..704cadea9006c52a8abe85841767a742718d321e 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 1e58ac78f1812219b6f2d273613c6b29f2493ef5..5afc1fa559f5d59612bd42f69ba7e044d4cdb297 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 4b25caa474b009dfad6674ac034d864b4f29470c..33d123f65d62c2cf93518b269febb885111c0adb 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 faf27c59cbd5df1411379f8cca0c9e3b90c0caed..f2660945f239a0ce08f0e882c90c66f44e965e7e 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 5fd1c1f6766b94cfac0f7173e83dd0f76fa510e3..6ced05cc4945aa0d4a878a748ac7b0e4a035d5b5 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 529ecaafa47c0a40489bde8ee7312d2bffc027ca..dd07d4ff99c1cc6fe51a99819670ade7342d9be8 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 a413d2c6215a982ea7d2092f5944d4607cdd50df..6f2b11a4bab6a31d0a9a8e33d91167505fb6195c 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 74800ca085c96041a28e0e9a8ffcfb1d77b7a628..beb6d0294ba7f74699fdd5803cd2082ae5a469c1 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 4dcafeb5d88b6725d6d8d17272f39795f4dc066d..74e01ad1c1a79cb18ab3f2c003384da6028f9b87 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 776cfb7fc6caf0306cbdc52a2dcb0a70125decf7..b088a325a5ab5b28b392e4c7433aec52e36e9ea6 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 d88da7e198d0a305fc7b1c1e962536ddedfcbf74..a7722fc21323e90b6c08edfd9eea14660e2341c2 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 74fca1594033514046bf2b0e0ed57abe30a83e72..f09ef7e67da581ce077ce1679992839237893dc8 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 403ca632fd2670ab99b9755876f31c0709ddd022..95f8b43b4a6000044673191e0370b2cbf2ed0894 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 818068de7a7061db7736850243b1f037ab507da5..584cfb693f419e6642db134d03830102bc0e37df 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 d5ff93b38266a5c91c6dc03dc657f919110b7df2..50de2464276194c4af7324b77c2204ff7a9536a0 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 0115f5e416b02e8891690bed088eca71081b9d87..6e24265864e26f2e9fd632b3bb5ebd9e53f760dd 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 021ae9843ef7a058a2ec5c2aa2f46da3440c4437..50e6a32f6305ee7bd5d9082ae50e2992498dcbf8 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 390c03d507498c372b9a43d4204ce9b0f7c898cb..edcc9379ecd0abedb78714e73ea2c143f1daa5ca 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 47f239fad07d0f94ec8b48e4eab4cde64dc9eef9..ce62ef1d5c0039be4e030f5abd15a0e5c7df0cad 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 723f089e177036de8154c503acd4dbede7cf0742..2efd7f700faf530013671fc1accc9dbf0461137c 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 914426f954b5c5fa6d0a630c5af2c396de5f2e7a..6c2732149d36cd1f16dfc743c216a5b953d4e182 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 5ff5e5472e42e8d85e787febbbd56e31ac77e0a5..f4b43db23d811f70c0ff5eaa6223c03fbaaee6d7 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 0aefa3ddba5c6c2f7374e59bdc6a78a883622bd6..8c2868773ea4af73e26d14995f409929cf8cbb62 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 00b8d38e0bd4755ae27c63cdcf77878039d1ddce..37c558438679f4b8d54e48c36b748bce9425b613 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 e74487e1176a5756b49f839550baabe78c6db376..685f8972057251fa166ec28256fdaec3d6cf3a72 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 40a724025a093c033e0e2abd48a7703a3adf6048..54c4ab6c276241c8d7278c77d982eeb16df4cd8a 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 eec59a520a786e1b01bb906a926c7577aeccff99..7091e4abe70173c131fb7415943888a25caaa4c0 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 968733844e49f2894c4431e7682a724fa2c42381..6c86e13f8b45f7578080a70d2db2eaee5256f3dc 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 d408ca2370d7f9d4c15d656961db2236d00c6c6f..000819982b91a13db18efb2e1afa21831a8107e0 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 }}