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

feat(ad-api): add request to intervene (RTI) #444

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions docs/design/autoware-interfaces/ad-api/features/fail-safe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Related API

- {{ link_ad_api('/api/fail_safe/mrm_state') }}
- {{ link_ad_api('/api/fail_safe/rti_state') }}

## Description

Expand All @@ -15,10 +16,10 @@ The fail-safe module selects the behavior of MRM according to the abnormality an

![fail-safe-architecture](./fail-safe/architecture.drawio.svg)

## States
## MRM state

The MRM state indicates whether MRM is operating. This state also provides success or failure.
Generally, MRM will switch to another behavior if it fails.
The MRM state indicates whether MRM is operating and its current behavior.
This state also provides success or failure of the operation. Generally, MRM will switch to another behavior if it fails.

![mrm-state](./fail-safe/mrm-state.drawio.svg)

Expand All @@ -29,8 +30,6 @@ Generally, MRM will switch to another behavior if it fails.
| SUCCEEDED | MRM succeeded. The vehicle is in a safe condition. |
| FAILED | MRM failed. The vehicle is still in an unsafe condition. |

## Behavior

There is a dependency between MRM behaviors. For example, it switches from a comfortable stop to a emergency stop, but not the other way around.
This is service dependent. Autoware supports the following transitions by default.

Expand All @@ -41,3 +40,14 @@ This is service dependent. Autoware supports the following transitions by defaul
| NONE | MRM is not operating or is operating but no special behavior is required. |
| COMFORTABLE_STOP | The vehicle will stop quickly with a comfortable deceleration. |
| EMERGENCY_STOP | The vehicle will stop immediately with as much deceleration as possible. |

## RTI state

The RTI state indicates whether RTI is requested. If for some reason autonomous driving cannot continue, Autoware will request a change to manual driving.
The following states are provided to properly handle RTI from multiple vehicles.

| State | Description |
| ------------- | ----------------------------------------------------------------------------------------- |
| NONE | RTI is not requested. |
| MRM_OPERATING | MRM is operating. Since MRC has not been achieved, immediate intervention is recommended. |
| MRM_COMPLETED | MRM is completed. Since MRC has been achieved, give priority to vehicles with urgency. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: /api/fail_safe/rti_state
status: not released
method: notification
type:
name: autoware_adapi_v1_msgs/msg/RtiState
msg:
- name: state
text: The state of RTI.
- name: message
text: The message such as reasons for RTI.
---

{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %}
{% block description %}
Get the RTI state.
For details, see the [fail-safe](../../../features/fail-safe.md).
{% endblock %}
1 change: 1 addition & 0 deletions docs/design/autoware-interfaces/ad-api/list/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# List of Autoware AD API

- [/api/fail_safe/mrm_state](./api/fail_safe/mrm_state.md)
- [/api/fail_safe/rti_state](./api/fail_safe/rti_state.md)
- [/api/interface/version](./api/interface/version.md)
- [/api/localization/initialization_state](./api/localization/initialization_state.md)
- [/api/localization/initialize](./api/localization/initialize.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# This file is generated by tools/autoware-interfaces/generate.py
title: autoware_adapi_v1_msgs/msg/RtiState
---

{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}
{% block definition %}

```txt
uint16 UNKNOWN = 0
uint16 NONE = 1
uint16 MRM_OPERATING = 2
uint16 MRM_COMPLETED = 3

builtin_interfaces/Time stamp
uint16 state
string message
```

{% endblock %}
1 change: 1 addition & 0 deletions docs/design/autoware-interfaces/ad-api/types/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- [autoware_adapi_v1_msgs/msg/RoutePrimitive](./autoware_adapi_v1_msgs/msg/RoutePrimitive.md)
- [autoware_adapi_v1_msgs/msg/RouteSegment](./autoware_adapi_v1_msgs/msg/RouteSegment.md)
- [autoware_adapi_v1_msgs/msg/RouteState](./autoware_adapi_v1_msgs/msg/RouteState.md)
- [autoware_adapi_v1_msgs/msg/RtiState](./autoware_adapi_v1_msgs/msg/RtiState.md)
- [autoware_adapi_v1_msgs/msg/SteeringFactor](./autoware_adapi_v1_msgs/msg/SteeringFactor.md)
- [autoware_adapi_v1_msgs/msg/SteeringFactorArray](./autoware_adapi_v1_msgs/msg/SteeringFactorArray.md)
- [autoware_adapi_v1_msgs/msg/TurnIndicators](./autoware_adapi_v1_msgs/msg/TurnIndicators.md)
Expand Down
5 changes: 5 additions & 0 deletions yaml/autoware-interfaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ types:
msg:
stamp: builtin_interfaces/msg/Time
state: uint16
autoware_adapi_v1_msgs/msg/RtiState:
msg:
message: string
stamp: builtin_interfaces/msg/Time
state: uint16
autoware_adapi_v1_msgs/msg/SteeringFactor:
msg:
behavior: string
Expand Down
Loading