Operation mode#
Related API#
- /api/operation_mode/state
- /api/operation_mode/change_to_autonomous
- /api/operation_mode/change_to_stop
- /api/operation_mode/change_to_local
- /api/operation_mode/change_to_remote
- /api/operation_mode/enable_autoware_control
- /api/operation_mode/disable_autoware_control
Description#
As shown below, Autoware assumes that the vehicle interface has two modes, Autoware control and direct control. In direct control mode, the vehicle is operated using devices such as steering and pedals. If the vehicle does not support direct control mode, it is always treated as Autoware control mode. Autoware control mode has four operation modes.
| Mode | Description |
|---|---|
| Stop | Keep the vehicle stopped. |
| Autonomous | Autonomously control the vehicle. |
| Local | Manually control the vehicle from nearby with some device such as a joystick. |
| Remote | Manually control the vehicle from a web application on the cloud. |
States#
Autoware control flag#
The flag is_autoware_control_enabled indicates if the vehicle is controlled by Autoware. The enable and disable APIs can be used if the control can be switched by software. These APIs will always fail if the vehicle does not support mode switching or is switched by hardware.
Operation mode and availability flags#
The field mode indicates what command is used when Autoware control is enabled. The flags is_stop_mode_available, is_autonomous_mode_available, is_local_mode_available, and is_remote_mode_available show if it is possible to transition to each mode. A change request to a mode that is not available fails with ERROR_NOT_AVAILABLE.
In the default implementation, a mode is available only when the operation mode component and the diagnostic graph (the /system/operation_mode/availability topic) both allow it. For example, in the diagnostic graph of autoware_launch, the autonomous mode is available only when the map, localization, planning (including the route), perception, control, vehicle, and system diagnostics are OK. An MRM request with the DELEGATE strategy also makes the mode unavailable. Use the diagnostics API to find the cause when a mode is not available.
Transition flag#
Autoware cannot always guarantee safety during a mode change, for example when it switches to autonomous mode during overspeed. For this situation, the flag is_in_transition is true while the mode changes. The operator who changed the mode must ensure safety while this flag is true. The flag becomes false when the mode change is complete. If the mode change does not complete, Autoware returns to the previous mode.