Skip to content

17.0.1

Choose a tag to compare

@github-actions github-actions released this 07 Aug 05:11

Description

Abstract

This pull request fixes a randomly occurring

Simulation error [AutowareError]: Simulator waited for the Autoware state to transition to WAITING_FOR_ROUTE, but time is up. The current Autoware state is INITIALIZING.

The root cause is that the spinner thread is created before std::atomic<bool> is_stop_requested = false; is initialized. This can cause is_stop_requested = true, preventing the spin from executing.
To fix this issue, in this PR, change the member order of concealer::AutowareUniverse class with consideration of initialization dependencies.

Background

To improve test reliability, we want to eliminate random failures. We'd like to run with retry 0.

Details

Currently, in the header https://github.com/tier4/scenario_simulator_v2/blob/ce2156518c7cb58374699c1dc9f68539a80c51ab/external/concealer/include/concealer/autoware_universe.hpp#L87 std::atomic<bool> is_stop_requested = false; is initialized.
Then, in the initializer list at https://github.com/tier4/scenario_simulator_v2/blob/ce2156518c7cb58374699c1dc9f68539a80c51ab/external/concealer/src/autoware_universe.cpp#L163, the spinner thread is started:
spinner(std::thread([this]() {

However, at this point, sometimes initialization hasn't finished. If is_stop_requested is true before initilization, spin_some will not execute, preventing the necessary topics from being published. Specifically, without the /localization/kinematic_state topic being published, Autoware cannot initialize (it can't generate a route) and remains stuck in the INITIALIZING state. ( route_state is neccesary for transition of LegacyAutowareState https://github.com/tier4/scenario_simulator_v2/blob/ce2156518c7cb58374699c1dc9f68539a80c51ab/external/concealer/include/concealer/legacy_autoware_state.hpp#L92-L96).

References

Here is debug result.

fail scenanario with error of

Simulation error [AutowareError]: Simulator waited for the Autoware state to transition to WAITING_FOR_ROUTE, but time is up. The current Autoware state is INITIALIZING

https://evaluation.tier4.jp/evaluation/reports/e271f583-ba6e-56ac-937d-d2bc2482befb/tests/de463131-d4c7-5e37-aa24-aaf16aa1eb59/3a88480d-bcc2-5cd4-91e1-60941a639840/2b7b668a-48a1-5b30-8050-9b99ba781914?failure_cause_labels=SimulationError%3AAutowareError&project_id=prd_jt&state=failed

[simple_sensor_simulator_node-2] [AutowareUniverse] Initial is_stop_requested = 1

pass scenario

https://evaluation.tier4.jp/evaluation/reports/e271f583-ba6e-56ac-937d-d2bc2482befb/tests/de463131-d4c7-5e37-aa24-aaf16aa1eb59/49aafe48-d0d6-54da-b72b-870d9d7ebe1f/9653833d-8fdf-5437-8d84-20e3e2bf2c5e?project_id=prd_jt

[simple_sensor_simulator_node-2] [AutowareUniverse] Initial is_stop_requested = 0

PR test results.

main

all results have the error

PR

no results have the error

Destructive Changes

Known Limitations

Related Issues