Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EntitySelection #1059

Merged
merged 189 commits into from
Jul 23, 2024
Merged

Add EntitySelection #1059

merged 189 commits into from
Jul 23, 2024

Conversation

shouth
Copy link
Contributor

@shouth shouth commented Aug 1, 2023

Description

Abstract

  • Add EntitySelection
  • Update mainly Actions and Conditions to be able to handle EntitySelection
  • Add some OpenSCENARIO files for testing EntitySelection

Background

OpenSCENARIO has the concept called Entity. Entity may be represented by either a single ScenarioObject, a EntitySelection or SpawnedObject. This PR enables scenario_simulator_v2 to handle EntitySelection in addtion to ScenarioObject which has been already supported. By using EntitySelection, scenario writers can group multiple entities and apply actions/conditions to the group.

Details

EntitySelection

EntitySelection describes a list of Entity by specifing names or entity types. Entities selected by EntitySelection is collected when users of EntitySelection needs them.

Entity

In a scenario, participants are called Entity. Existing implementation assumes each names in a scenario corresponds to a single entity, but this assumption is broken by introduction of EntitySelection. This PR adds Entity class to handle this issue.

Entity class resolves actual entity instance from entity reference on construction.

  • In places where entity references are resolved only to ScenarioObjects, Entity behaves similarly to the traditional EntityRef, so there are no code changes associated with adding the Entity class.
  • On the other hand, in places where entity references are resolved to EntitySelection as well, the code has been modified to iterate over the entities specified by EntitySelection using functions introduced to Entity for iterative processing.

Members resolved only to ScenarioObjects:

  • RelativeDistanceCondition::entity_ref
  • RelativeObjectPosition::entity_ref
  • RelativeTargetLane::entity_ref
  • RelativeTargetSpeed::entity_ref
  • RelativeWorldPosition::entity_ref
  • RelativeProfileAction::entity_ref
  • SpeedProfileAction::entity_ref
  • TimeHeadwayCondition::entity_ref
  • CollisionCondition::another_given_entity

Members resolved to EntitySelection as well:

  • Scope::actors
    • corresponds OpenSCENARIO Private.entityRef and Actors.entityRefs
  • EntityAction::entity_ref
  • TriggeringEntities::entity_refs

Classes affected by above changes:

  • Affected by Scope::actors
    • AcquirePositionAction
    • AssignRouteAction
    • ControllerAction
    • ApplyWalkStraightAction
    • FollowTrajectoryAction
    • LaneChangeAction
    • SpeedAction
    • SpeedProfileAction
    • TeleportAction
  • Affected by TriggeringEntities::entity_refs
    • AccelerationCondition
    • CollisionCondition
    • DistanceCondition
    • ReachPositionCondition
    • RelativeDistanceCondition
    • SpeedCondition
    • StandStillCondition
    • TimeHeadwayCondition

scenarios

This PR contains several scenarios for testing EntitySelection. Approximately 1,000 lines of the changes contained in this PR are due to these scenarios.

Subsequent changes

N/A

References

https://www.asam.net/index.php?eID=dumpFile&t=f&f=4908&token=ae9d9b44ab9257e817072a653b5d5e98ee0babf8#_entities

Destructive Changes

I added checks on constraints of entities. For more details, see OpenSCENARIO 1.2 Annex B. Scenarios that contradict to OpenSCENARIO 1.2 Annex B will break if this PR is merged (I think it is rare case).

Known Limitations

N/A

@shouth shouth added bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 and removed bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 labels Feb 21, 2024
@yamacir-kit yamacir-kit marked this pull request as ready for review February 22, 2024 04:04
@yamacir-kit yamacir-kit merged commit b8f140b into master Jul 23, 2024
13 checks passed
@github-actions github-actions bot deleted the feature/interpreter/entity_selection branch July 23, 2024 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor If this pull request merged, bump minor version of the scenario_simulator_v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants