Skip to content

Commit a3457e7

Browse files
isamu-takagimitsudome-rLalith Vipulananthankenji-miyake
authored
docs(ad-api): add features of interface and driving state (autowarefoundation#115)
* docs(ad-api): add features of interface and driving state Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * docs(ad-api): modify some words Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/driving.md Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> * fix * fix * Update docs/design/autoware-interfaces/ad-api/features/interface.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/interface.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/driving.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/driving.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/driving.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/driving.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/driving.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * Update docs/design/autoware-interfaces/ad-api/features/driving.md Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> * fix page title Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * fix state description * Update docs/design/autoware-interfaces/ad-api/features/.pages Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * Add API and type pages * fix words * fix menu title * fix driving state message * modify menu tree * add link macro for AD API * change file structure Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Co-authored-by: Lalith Vipulananthan <lalith.vipulananthan@tier4.jp> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
1 parent f0412d5 commit a3457e7

File tree

14 files changed

+327
-0
lines changed

14 files changed

+327
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
nav:
22
- index.md
3+
- list
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nav:
2+
- index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# /api/driving/engage
2+
3+
- Method: function call
4+
- Type: [autoware_ad_api_msgs/srv/DrivingEngage](../../../types/autoware_ad_api_msgs/srv/driving_engage.md)
5+
6+
## Description
7+
8+
Engage or disengage the vehicle. For details, see the [driving state](index.md).
9+
10+
## Request
11+
12+
| Name | Type | Description |
13+
| ------ | ---- | --------------------------------------- |
14+
| engage | bool | Set true to engage, false to disengage. |
15+
16+
## Response
17+
18+
| Name | Type | Description |
19+
| ------ | --------------------------------------- | --------------- |
20+
| status | autoware_ad_api_msgs/msg/ResponseStatus | response status |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Driving API
2+
3+
- {{ link_ad_api('/api/driving/state') }}
4+
- {{ link_ad_api('/api/driving/engage') }}
5+
6+
## Description
7+
8+
This API manages whether the vehicle is driving or can start driving.
9+
The user can use this API to check if the vehicle is ready to drive and instruct it to depart.
10+
11+
## States
12+
13+
The state transition for driving state is illustrated in the diagram below.
14+
The vehicle holds a stop when the state is not DRIVING.
15+
During normal operation, the flow of driving state transitions is as follows:
16+
17+
1. Driving state is initialized to NOT_READY.
18+
2. The state transitions to READY when the autonomous system is ready to start driving.
19+
3. The state becomes DRIVING if the engage API is called and the vehicle starts driving.
20+
4. The state returns to NOT_READY when the vehicle reaches its destination.
21+
5. The state can be manually returned to NOT_READY by calling the disengage API.
22+
23+
![driving-state](./state.drawio.svg)
24+
25+
| State | Description |
26+
| --------- | ----------------------------------------------- |
27+
| NOT_READY | The vehicle is not ready to start driving. |
28+
| READY | The vehicle is ready to start driving |
29+
| DRIVING | The vehicle is driving towards the destination. |
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# /api/driving/state
2+
3+
- Method: notification
4+
- Type: [autoware_ad_api_msgs/msg/DrivingState](../../../types/autoware_ad_api_msgs/msg/driving_state.md)
5+
6+
## Description
7+
8+
Get the driving state. For details, see the [driving state](index.md).
9+
10+
## Message
11+
12+
| Name | Type | Description |
13+
| ----- | ------ | ----------------------------------------- |
14+
| state | uint16 | A value of the [driving state](index.md). |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Interface API
2+
3+
- {{ link_ad_api('/api/interface/version') }}
4+
5+
## Description
6+
7+
This API provides the interface version of the set of AD APIs.
8+
It follows [Semantic Versioning][semver] in order to provide an intuitive understanding of the changes between versions.
9+
10+
<!-- link -->
11+
12+
[semver]: https://semver.org/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# /api/interface/version
2+
3+
- Method: function call
4+
- Type: [autoware_ad_api_msgs/srv/InterfaceVersion](../../../types/autoware_ad_api_msgs/srv/interface_version.md)
5+
6+
## Description
7+
8+
Get the interface version. The version follows Semantic Versioning.
9+
10+
## Request
11+
12+
None
13+
14+
## Response
15+
16+
| Name | Type | Description |
17+
| ----- | ------ | ------------- |
18+
| major | uint16 | major version |
19+
| minor | uint16 | minor version |
20+
| patch | uint16 | patch version |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# List of Autoware AD API
2+
3+
- [Interface](./api/interface/index.md)
4+
- [Driving](./api/driving/index.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# autoware_ad_api_msgs/msg/DrivingState
2+
3+
## Definition
4+
5+
```txt
6+
uint16 UNKNOWN = 0
7+
uint16 NOT_READY = 1
8+
uint16 READY = 2
9+
uint16 DRIVING = 3
10+
11+
uint16 state
12+
```
13+
14+
## This type uses
15+
16+
None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# autoware_ad_api_msgs/msg/ResponseStatus
2+
3+
## Definition
4+
5+
```txt
6+
# constants for code
7+
uint16 DEPRECATED = 50000
8+
uint16 SERVICE_UNREADY = 50001
9+
uint16 SERVICE_TIMEOUT = 50002
10+
11+
# variables
12+
bool success
13+
uint16 code
14+
string message
15+
```
16+
17+
## This type uses
18+
19+
None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# autoware_ad_api_msgs/srv/DrivingEngage
2+
3+
## Definition
4+
5+
```txt
6+
bool engage
7+
---
8+
autoware_ad_api_msgs/ResponseStatus status
9+
```
10+
11+
## This type uses
12+
13+
- [autoware_ad_api_msgs/msg/ResponseStatus](../../autoware_ad_api_msgs/msg/response_status.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# autoware_ad_api_msgs/srv/InterfaceVersion
2+
3+
## Definition
4+
5+
```txt
6+
---
7+
uint16 major
8+
uint16 minor
9+
uint16 patch
10+
```
11+
12+
## This type uses
13+
14+
None

main.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os # for relpath, cannot use pathlib
2+
3+
4+
def define_env(env):
5+
6+
@env.macro
7+
def link_ad_api(name):
8+
root_path = "design/autoware-interfaces/ad-api"
9+
base_path = os.path.relpath(root_path, env.page.url) + "/list"
10+
return f"[{name}]({base_path}{name})"

0 commit comments

Comments
 (0)