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

docs(ad-api): add cooperation api #276

Merged
merged 64 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
0ba1472
docs(ad-api): add cooperation api
isamu-takagi Dec 12, 2022
6897eea
feat: add templates and macros
isamu-takagi May 16, 2023
5c02eb2
feat: update route api pages
isamu-takagi May 16, 2023
7c7a95b
feat: update template
isamu-takagi May 16, 2023
6ce548a
feat: update localization api pages
isamu-takagi May 16, 2023
d2474f5
feat: update api pages
isamu-takagi May 16, 2023
c7853ea
feat: resolve field types
isamu-takagi May 16, 2023
9a28553
feat: add message link
isamu-takagi May 16, 2023
516f408
feat: change yaml format
isamu-takagi May 16, 2023
b7cbfc8
feat: generate type pages
isamu-takagi May 16, 2023
e9994c5
feat: type page template
isamu-takagi May 16, 2023
d6ead53
feat: update type pages
isamu-takagi May 16, 2023
57626ba
feat: update comment
isamu-takagi May 16, 2023
0a53392
docs: add readme
isamu-takagi May 18, 2023
d821f67
Merge branch 'main' into feat/adapi-cooperation
isamu-takagi May 18, 2023
11aa093
feat: update diagram
isamu-takagi May 18, 2023
b42a281
Update tools/autoware-interfaces/README.md
isamu-takagi May 18, 2023
ce6b1fe
Merge branch 'main' into feat/adapi-document-template
isamu-takagi May 19, 2023
fb3caad
Merge branch 'feat/adapi-document-template' into feat/adapi-cooperation
isamu-takagi May 19, 2023
aeb09df
feat: remove data type pages
isamu-takagi May 19, 2023
8b0169b
feat: fix spell check
isamu-takagi May 22, 2023
3dc12ee
feat: merge planning factor and cooperation
isamu-takagi May 22, 2023
7b1030f
Merge branch 'feat/adapi-document-template' into feat/adapi-cooperation
isamu-takagi May 22, 2023
fe931c8
feat: update description
isamu-takagi May 22, 2023
462072f
feat: add types
isamu-takagi May 22, 2023
311a496
feat: fix tool comment
isamu-takagi May 22, 2023
fd5cbcd
Merge branch 'feat/adapi-document-template' into feat/adapi-cooperation
isamu-takagi May 22, 2023
093d045
feat: fix tool comment
isamu-takagi May 22, 2023
ecfd401
feat: remove unused link
isamu-takagi May 22, 2023
7aa2aee
feat: add cooperatoin default
isamu-takagi May 22, 2023
e8a022e
feat: update module type
isamu-takagi May 22, 2023
1dc61f4
feat: add status
isamu-takagi May 22, 2023
98586c4
Merge branch 'main' into feat/adapi-cooperation
isamu-takagi May 23, 2023
d2e9f6c
Merge branch 'main' into feat/adapi-cooperation
isamu-takagi Jun 8, 2023
d6711b4
update descriptions
isamu-takagi Jun 9, 2023
13ed4ab
update descriptions
isamu-takagi Jun 9, 2023
5a8d89d
update link
isamu-takagi Jun 9, 2023
f5f9673
fix link
isamu-takagi Jun 9, 2023
c92a723
update default decision service
isamu-takagi Jun 9, 2023
061ab6e
rename service
isamu-takagi Jun 12, 2023
9840dca
update description of default decision
isamu-takagi Jun 14, 2023
060a650
update description
isamu-takagi Jun 16, 2023
45cc1e7
update description
isamu-takagi Jun 22, 2023
ed95e2f
Merge branch 'main' into feat/adapi-cooperation
isamu-takagi Jun 23, 2023
cd50478
rename policy
isamu-takagi Jun 23, 2023
1a54223
Merge branch 'main' into feat/adapi-cooperation
isamu-takagi Jul 5, 2023
4d833e4
add version status
isamu-takagi Jul 5, 2023
5f66ea5
update use case
isamu-takagi Jul 12, 2023
82d39bd
update description
isamu-takagi Jul 21, 2023
dba2f82
update description
isamu-takagi Jul 21, 2023
6ba32d9
update description
isamu-takagi Jul 26, 2023
154bb63
update description
isamu-takagi Jul 26, 2023
6d5754b
Update docs/design/autoware-interfaces/ad-api/features/cooperation.md
isamu-takagi Jul 31, 2023
a0bb7e8
update scenes diagram
isamu-takagi Aug 2, 2023
2e4095a
update sequence
isamu-takagi Aug 2, 2023
a740bfc
update description
isamu-takagi Aug 2, 2023
27cf052
Update docs/design/autoware-interfaces/ad-api/features/cooperation.md
isamu-takagi Aug 2, 2023
15cf9fc
Merge branch 'main' into feat/adapi-cooperation
isamu-takagi Aug 30, 2023
1d06ce9
generate interface documents
isamu-takagi Aug 30, 2023
35f3f7e
Update docs/design/autoware-interfaces/ad-api/features/cooperation.md
isamu-takagi Sep 4, 2023
4fcb025
fix pre-commit
isamu-takagi Sep 4, 2023
f4b6ec9
Merge branch 'main' into feat/adapi-cooperation
isamu-takagi Sep 5, 2023
7e92dbc
update
isamu-takagi Sep 5, 2023
68b0fb2
fix field name
isamu-takagi Sep 5, 2023
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
66 changes: 66 additions & 0 deletions docs/design/autoware-interfaces/ad-api/features/cooperation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Cooperation

## Related API

- {{ link_ad_api('/api/planning/velocity_factors') }}
- {{ link_ad_api('/api/planning/steering_factors') }}
- {{ link_ad_api('/api/planning/cooperation/set_commands') }}
- {{ link_ad_api('/api/planning/cooperation/set_policies') }}
- {{ link_ad_api('/api/planning/cooperation/get_policies') }}

## Description

Some planning modules can receive the operator decision and reflect it in their behavior.
These modules have their own decisions, but their behavior is based on the operator decisions.
The operator can check the module decision and change the operator decision if necessary.
isamu-takagi marked this conversation as resolved.
Show resolved Hide resolved
If the module supports this feature, [cooperation status](../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md) is provided in [velocity factors or steering factors](./planning-factors.md).

![cooperation-architecture](./cooperation/architecture.drawio.svg)

## Scene ID

The cooperation status contains an ID to distinguish scenes.
This ID is generated for each scene that requires decision and doesn't change until the scene is completed or canceled.
To set the operator decision, it needs to specify the ID by selecting the target scene from the cooperation status.
In practice, the application can hides the specification of the ID and provides an abstracted interface to the operator.

## Decisions

The module decision is either deactivate or activate. The operator decision is also evaluated in one of these.
mitsudome-r marked this conversation as resolved.
Show resolved Hide resolved
Its meaning depends on the module and is shown in the table below.
These decisions are designed to assign behavior to activate that is considered high risk.

| Factor Type | Deactivate | Activate |
| --------------- | ------------- | --------------- |
| velocity (stop) | stop | pass |
| steering (path) | keep the path | change the path |

The operator decision is actually either deactivate, activate, autonomous, or none.
If the operator selects deactivate or activate, the module decision is ignored and the operator decision is used instead.
If the operator selects autonomous, the module decision is used.
The none is the initial value of the operator decision and means that the operator has not selected any decision.
If the operator decision is none, it is evaluated according to the cooperation policies set for each module type.

The cooperation policy is either required or optional, and is initialized by system settings.
The required policy evaluates none decision as deactivate to minimize risk.
Therefore, the operator decision is required to continue driving.
The optional policy evaluates none decision as autonomous to continue driving.
This allows the vehicle to drive without the operator decision.
The cooperation policies can also be changed by the operator.
Note that this setting is common per module, so changing it will affect all scenes in the same module.

![cooperation-state](./cooperation/state.drawio.svg)

## Examples

This is an example of cooperation for lane change module. The behaviors by the combination of decisions are as follows.

| Operator decision | Policy | Module decision | Description |
| ----------------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------------- |
| deactivate | - | - | The operator instructs to keep lane regardless the module decision. So it keeps lane by operator decision. |
| activate | - | - | The operator instructs to change lane regardless the module decision. So it changes lane by operator decision. |
| autonomous | - | deactivate | The operator instructs to follow the module decision. So it keeps lane by module decision. |
| autonomous | - | activate | The operator instructs to follow the module decision. So it changes lane by module decision. |
| none | required | - | The required policy is used because no operator instruction. So it keeps lane the same as deactivate. |
| none | optional | deactivate | The optional policy is used because no operator instruction. So it keeps lane by module decision. |
| none | optional | activate | The optional policy is used because no operator instruction. So it change lane by module decision. |
Loading
Loading