Skip to content

16.8.0

Choose a tag to compare

@github-actions github-actions released this 22 Jul 04:47

Description

This PR enables the execution of cpp scenarios with AWSIM. To achieve this, several changes have been introduced while preserving the default functionality. By default, the code behaves as it did before the modifications.

Abstract

Enable support for running cpp scenarios with AWSIM.

Background

Details

  1. Added support for delaying the scenario clock start - link.

To execute cpp scenarios with Autoware and AWSIM, it is essential to account for their initialization time. If not handled properly, the scenario may terminate before Autoware is fully initialized. The scenario clock is triggered by the traffic_simulator::API::startNpcLogic() function. To delay the start of the scenario until Autoware is fully ready, you should:

By default, the argument is set to true, which preserves the existing behavior and does not affect scenarios from the CppMockScenarios package.

  1. Added support for spawning the EGO vehicle without assigning a route. If no goal pose is provided, the vehicle will spawn without a route link.

This change is closely related to the change described in point 1.

  • When the EGO needs to travel from a start pose to a goal pose, a route must be calculated and the scenario should wait until Autoware reaches the DRIVING state before starting.
  • However, in scenarios where the EGO only needs to be spawned and is not required to follow a route, the scenario should start as soon as Autoware reaches the WAITING_FOR_ROUTE state.

If you provide only a start pose to the spawnEgoEntity function (i.e., leave the goal pose empty), you should add a condition in your scenario's onUpdate method to monitor Autoware's state and start the scenario as soon as it reaches WAITING_FOR_ROUTE.

If you provide both a start pose and a goal pose, you should add a condition in your scenario's onUpdate method to monitor for the EGO to become engaged (i.e., for Autoware to reach the DRIVING state) before starting the scenario.

This approach ensures that each scenario starts at the appropriate moment depending on its requirements.

  1. Introduced the ego_model parameter to ensure proper entity spawning in AWSIM.

Proper spawning in AWSIM requires specifying the correct asset_key to load the appropriate 3D model (e.g., "taxi" or "hatchback" for vehicles, "human" for pedestrians). To support this, the ego_model parameter was introduced. If not provided, the default behavior is preserved. For the EGO vehicle, the asset_key is automatically resolved based on the vehicle_model passed at launch time – launch file reference.

For NPC entities (vehicles, pedestrians), the correct asset_key must be explicitly provided – see sample_scenario_2, which spawns "hatchback" and "taxi".

  1. Introduced the map_path parameter. If not specified, the ROS 2 parameter is used. If specified in the scenario, it takes precedence and overrides the ROS 2 parameter link

This change introduces the map_path parameter to simplify adapting existing scenarios from the CppMockScenarios package and to make it easier to define new ones. Instead of hardcoding the map path in each scenario (as done in CppMockScenarios, where the map is loaded from a specific package), this parameter allows to specify any arbitrary path to the map file via launch arguments. This makes it possible to use maps stored in any location, not just those included in predefined packages.

Evidance

Link to the comment with videos showing sample cpp scenarios executed with AWSIM.

References

Jira: link

Destructive Changes

N/A

Known Limitations

N/A

Related Issues