Skip to content

Commit

Permalink
Cleanup struct Entities
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <httperror@404-notfound.jp>
  • Loading branch information
yamacir-kit committed Nov 28, 2024
1 parent c79a08a commit 848cc4f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
8 changes: 2 additions & 6 deletions docs/developer_guide/OpenSCENARIOSupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The OpenSCENARIO XML standard [does not define](https://releases.asam.net/OpenSC

### Command

OpenSCENARIO XML standard states that `CustomCommandAction` can be used to either issue a command to the simulation environment or start an external script.
OpenSCENARIO XML standard states that `CustomCommandAction` can be used to either issue a command to the simulation environment or start an external script.

For OpenSCENARIO interpreters implemented in scripting languages such as Python, this action is often implemented as a call to an external script file written in the same language as the host language. However, `scenario_simulator_v2` is implemented in C++ and we cannot simply implement such a feature. Therefore, `scenario_simulator_v2` treats the string given in `CustomCommandAction.type` as a command and executes it on a subprocess, as `sh` does.

Expand Down Expand Up @@ -308,7 +308,7 @@ Currently, the only way to know the result of the simulation is by viewing the s
| DynamicsDimension | 1.3 | |
| DynamicsShape | 1.3 (partial) | [detail](#DynamicsShape) |
| EndOfRoadCondition | unimplemented | |
| Entities | 1.3 (partial) | [detail](#Entities) |
| Entities | 1.3.1 | |
| EntityAction | 1.3 | |
| EntityCondition | 1.3 (partial) | [detail](#EntityCondition) |
| EntityDistribution | unimplemented | |
Expand Down Expand Up @@ -637,10 +637,6 @@ Currently, the only way to know the result of the simulation is by viewing the s

- Enumeration literal `sinusoidal` is **not** supported.

#### Entities

- Property `EntitySelection` is **not** supported.

#### EntityCondition

- Properties `EndOfRoadCondition`, `OffroadCondition`, `TimeToCollisionCondition`, `RelativeDistanceCondition`, `TraveledDistanceCondition`, `AngleCondition`, and `RelativeAngleCondition` are **not** supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ namespace openscenario_interpreter
{
inline namespace syntax
{
/* ---- Entities ---------------------------------------------------------------
*
* <xsd:complexType name="Entities">
* <xsd:sequence>
* <xsd:element name="ScenarioObject" minOccurs="0" maxOccurs="unbounded" type="ScenarioObject"/>
* <xsd:element name="EntitySelection" minOccurs="0" maxOccurs="unbounded" type="EntitySelection"/>
* </xsd:sequence>
* </xsd:complexType>
*
* -------------------------------------------------------------------------- */
struct Entities : public std::unordered_map<std::string, Object> // TODO to be data member
/*
Entities (OpenSCENARIO XML 1.3.1)
Definition of entities (scenario objects or entity selections) in
a scenario.
<xsd:complexType name="Entities">
<xsd:sequence>
<xsd:element name="ScenarioObject" type="ScenarioObject" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="EntitySelection" type="EntitySelection" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
*/
struct Entities : private std::unordered_map<std::string, Object>
{
using std::unordered_map<std::string, Object>::at;
using std::unordered_map<std::string, Object>::begin;
using std::unordered_map<std::string, Object>::end;

explicit Entities(const pugi::xml_node &, Scope &);

auto isAdded(const Entity &) const -> bool;
Expand Down

0 comments on commit 848cc4f

Please sign in to comment.