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 52 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
91 changes: 91 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,91 @@
# 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

Request to cooperate (RTC) is a feature that the operator supports the decision in autonomous driving mode.
The planning component manages each situation that requires decision as a scene.
Autoware usually drives the vehicle using its own decisions, but the operator may prefer to make their decisions in experiments and complex situations.

Each scene has an ID that doesn't change until the scene is completed or canceled.
The operator can override the decision of the target scene using this ID.
In practice, the user interface application can hides the specification of the ID and provides an abstracted interface to the operator.
isamu-takagi marked this conversation as resolved.
Show resolved Hide resolved

For example, in the situation in the diagram below, change lanes twice and turn left at the intersection.
There are three scenes and each has a decision to change or keep the lane, turn left or wait.
isamu-takagi marked this conversation as resolved.
Show resolved Hide resolved
Here Autoware decides not to change lanes a second time due to the obstacle, so the vehicle will stop there.
isamu-takagi marked this conversation as resolved.
Show resolved Hide resolved

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

## Architecture

Modules that support RTC have the operator decision and cooperation policy in addition to the module decision as shown below.
These modules use the merged decision that is determined by these values when planning vehicle behavior.
See decisions section for details of these values.
The cooperation policy is used when there is no operator decision and has a default value set by the system settings.
If the module supports RTC, these information are available in [velocity factors or steering factors](./planning-factors.md) as [cooperation status](../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md).

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

## Sequence

Here is an example sequence that overrides the scene decision to force a lane change. This assumes the second scene in the example situation given earlier.
mitsudome-r marked this conversation as resolved.
Show resolved Hide resolved

1. A module creates a scene with generated ID BBBB when approaching a place where a lane change is needed.
2. The scene determines the module decision from the current situation.
3. The scene determines the merged decision. Since there is no operator decision, so the cooperation policy is used.
4. The scene plans the vehicle to keep the lane.
5. The scene sends a cooperation status.
mitsudome-r marked this conversation as resolved.
Show resolved Hide resolved
6. The operator receives the cooperation status.
7. The operator sends a cooperation command.
8. The scene receives the cooperation command and update the operator decision.
9. The scene updates the module decision from the current situation.
10. The scene updates the merged decision. The received operator decision is used.
11. The scene plans the vehicle to change the lane.

## Decisions

The merged decision is determined by the module decision, operator decision, and cooperation policy, each of which takes the value shown in the table below.

| Status | Values |
| ------------------ | -------------------------------------- |
| merged decision | deactivate, activate |
| module decision | deactivate, activate |
| operator decision | deactivate, activate, autonomous, none |
| cooperation policy | required, optional |

The meanings of these values are as follows. Note that the cooperation policy is common per module, so changing it will affect all scenes in the same module.

| Value | Description |
| ---------- | ------------------------------------------------------------------------------------------ |
| deactivate | An operator/module decision to plan vehicle behavior with priority on safety. |
| activate | An operator/module decision to plan vehicle behavior with priority on driving. |
| autonomous | An operator decision that follows the module decision. |
| none | An initial value for operator decision, indicating that there is no operator decision yet. |
| required | A policy that requires the operator decision to continue driving. |
| optional | A policy that does not require the operator decision to continue driving. |

The following flow is how the merged decision is determined.

![cooperation-decisions](./cooperation/decisions.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 the vehicle keeps the lane by the operator decision. |
| activate | - | - | The operator instructs to change lane regardless the module decision. So the vehicle changes the lane by the operator decision. |
| autonomous | - | deactivate | The operator instructs to follow the module decision. So the vehicle keeps the lane by the module decision. |
| autonomous | - | activate | The operator instructs to follow the module decision. So the vehicle changes the lane by the module decision. |
| none | required | - | The required policy is used because no operator instruction. So the vehicle keeps the lane by the cooperation policy. |
| none | optional | deactivate | The optional policy is used because no operator instruction. So the vehicle keeps the lane by the module decision. |
| none | optional | activate | The optional policy is used because no operator instruction. So the vehicle change the lane by the module decision. |
Loading
Loading