From 0ba14725d89a152bc599459973cf145e5d106a80 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 12 Dec 2022 12:56:10 +0900 Subject: [PATCH 01/53] docs(ad-api): add cooperation api Signed-off-by: Takagi, Isamu --- .../cooperation/docs/architecture.drawio.svg | 239 +++++++++ .../api/cooperation/docs/state.drawio.svg | 457 ++++++++++++++++++ .../ad-api/list/api/cooperation/index.md | 31 ++ .../list/api/cooperation/set_decisions.md | 23 + .../list/api/cooperation/set_defaults.md | 23 + .../ad-api/list/api/cooperation/status.md | 21 + .../ad-api/list/api/localization/index.md | 2 +- .../autoware-interfaces/ad-api/list/index.md | 1 + .../msg/cooperation_decision.md | 27 ++ .../msg/cooperation_request.md | 19 + .../msg/cooperation_response.md | 18 + .../msg/cooperation_status.md | 30 ++ .../msg/cooperation_status_array.md | 17 + .../msg/cooperation_target.md | 35 ++ .../msg/response_status.md | 1 + .../srv/set_cooperation_decisions.md | 22 + 16 files changed, 965 insertions(+), 1 deletion(-) create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg new file mode 100644 index 00000000000..02220e0626a --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg @@ -0,0 +1,239 @@ + + + + + + + +
+
+
+ cooperation module +
+
+
+
+ + cooperation module + +
+
+ + + + + + +
+
+
+ planning +
+ module +
+
+
+
+ + planning... + +
+
+ + + + + + + + +
+
+
+ Autoware Decision +
+
+
+
+ + Autoware Decision + +
+
+ + + + + + +
+
+
+ Operator Decision +
+
+
+
+ + Operator Decision + +
+
+ + + + + + +
+
+
+ Default Decision +
+
+
+
+ + Default Decision + +
+
+ + + + +
+
+
+ initial +
+ value +
+
+
+
+ + initial... + +
+
+ + + + + + +
+
+
+ Final Decision +
+
+
+
+ + Final Decision + +
+
+ + + + + + + + +
+
+
+ Operator +
+
+
+
+ + Operator + +
+
+ + + + +
+
+
+ status +
+
+
+
+ + status + +
+
+ + + + +
+
+
+ set decision +
+
+
+
+ + set decision + +
+
+ + + + +
+
+
+ set default +
+
+
+
+ + set default + +
+
+ + + + + + +
+
+
+ Behavior State +
+
+
+
+ + Behavior State + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg new file mode 100644 index 00000000000..7298e405089 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg @@ -0,0 +1,457 @@ + + + + + + + +
+
+
+ Behavior State +
+
+
+
+ + Behavior State + +
+
+ + + + + + +
+
+
+ Autoware Decision +
+
+
+
+ + Autoware Decision + +
+
+ + + + + + +
+
+
+ Default Decision +
+
+
+
+ + Default Decision + +
+
+ + + + +
+
+
+ Operator Decision +
+
+
+
+ + Operator Decision + +
+
+ + + + + + +
+
+
+ WAITING +
+
+
+
+ + WAITING + +
+
+ + + + + + + + + +
+
+
+ EXECUTING +
+
+
+
+ + EXECUTING + +
+
+ + + + + + + + +
+
+
+ CANCELLING +
+
+
+
+ + CANCELLING + +
+
+ + + + +
+
+
+ activate +
+
+
+
+ + activate + +
+
+ + + + +
+
+
+ activate +
+
+
+
+ + activate + +
+
+ + + + +
+
+
+ deactivate +
+
+
+
+ + deactivate + +
+
+ + + + +
+
+
+ cancelled +
+
+
+
+ + cancelled + +
+
+ + + + + + + + + + + + + + + + +
+
+
+ DEFAULT +
+ DEACTIVATE +
+
+
+
+ + DEFAULT... + +
+
+ + + + + + + + +
+
+
+ DEFAULT +
+ AUTONOMOUS +
+
+
+
+ + DEFAULT... + +
+
+ + + + + + + + + + +
+
+
+ DEACTIVATE +
+
+
+
+ + DEACTIVATE + +
+
+ + + + +
+
+
+ AUTONOMOUS +
+
+
+
+ + AUTONOMOUS + +
+
+ + + + + + + +
+
+
+ ACTIVATE +
+
+
+
+ + ACTIVATE + +
+
+ + + + +
+
+
+ default deactivate +
+
+
+
+ + default deactivate + +
+
+ + + + +
+
+
+ default autonomous +
+
+
+
+ + default autonomous + +
+
+ + + + +
+
+
+ ACTIVATE +
+
+
+
+ + ACTIVATE + +
+
+ + + + + + + +
+
+
+ DEACTIVATE +
+
+
+
+ + DEACTIVATE + +
+
+ + + + +
+
+
+ AUTONOMOUS +
+
+
+
+ + AUTONOMOUS + +
+
+ + + + + + + +
+
+
+ DEACTIVATE +
+
+
+
+ + DEACTIVATE + +
+
+ + + + + +
+
+
+ final +
+ decision +
+
+
+
+ + final... + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md new file mode 100644 index 00000000000..2549625c1d7 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md @@ -0,0 +1,31 @@ +# Cooperation API + +- {{ link_ad_api('/api/cooperation/status') }} +- {{ link_ad_api('/api/cooperation/set_decisions') }} +- {{ link_ad_api('/api/cooperation/set_defaults') }} + +## Description + +This API manages cooperation between an operator and Autoware. + +The cooperation module receives a decision from the planning module and returns behavior to be performed. +This behavior is determined from the operator and Autoware decisions. +The operator receives the current status and makes decisions based on that. +Also, the operator can choose the default behavior when undecided. + +![cooperation-architecture](./docs/architecture.drawio.svg) + +## Decision states + +There are three decision states, one behavior state, and a final decision event. + +![cooperation-state](./docs/state.drawio.svg) + +## Decision events + +The final decision event is used for the behavior state transitions and is determined from the operator and Autoware state as follows. + +| | DEFAULT
DEACTIVATE | DEACTIVATE | ACTIVATE | AUTONOMOUS | DEFAULT
AUTONOMOUS | +| :--------: | :-------------------: | :--------: | :------: | :--------: | :-------------------: | +| DEACTIVATE | deactivate | deactivate | activate | deactivate | deactivate | +| ACTIVATE | deactivate | deactivate | activate | activate | activate | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md new file mode 100644 index 00000000000..27be54c527c --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md @@ -0,0 +1,23 @@ + + +# /api/cooperation/set_decisions + +- Method: function call +- Type: [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../../types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) + +## Description + +T.B.D. + +## Request + +| Name | Type | Description | +| -------- | ----------------------------------------------- | ----------- | +| requests | autoware_adapi_v1_msgs/msg/CooperationRequest[] | T.B.D. | + +## Response + +| Name | Type | Description | +| --------- | ------------------------------------------------ | --------------- | +| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +| responses | autoware_adapi_v1_msgs/msg/CooperationResponse[] | T.B.D. | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md new file mode 100644 index 00000000000..2d8d229b1ac --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md @@ -0,0 +1,23 @@ + + +# /api/cooperation/set_defaults + +- Method: function call +- Type: [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../../types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) + +## Description + +T.B.D. + +## Request + +| Name | Type | Description | +| -------- | ----------------------------------------------- | ----------- | +| requests | autoware_adapi_v1_msgs/msg/CooperationRequest[] | T.B.D. | + +## Response + +| Name | Type | Description | +| --------- | ------------------------------------------------ | --------------- | +| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +| responses | autoware_adapi_v1_msgs/msg/CooperationResponse[] | T.B.D. | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md new file mode 100644 index 00000000000..a956cfd12ed --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md @@ -0,0 +1,21 @@ + + +# /api/cooperation/status + +- Method: realtime stream +- Type: [autoware_adapi_v1_msgs/msg/CooperationStatusArray](../../../types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md) + +## Description + +Get the cooperation status. + +## Message + +| Name | Type | Description | +| ------------------- | ---------------------------------------------- | ----------- | +| statuses.stamp | builtin_interfaces/msg/Time | T.B.D. | +| statuses.target | autoware_adapi_v1_msgs/msg/CooperationTarget | T.B.D. | +| statuses.autonomous | autoware_adapi_v1_msgs/msg/CooperationDecision | T.B.D. | +| statuses.cooperator | autoware_adapi_v1_msgs/msg/CooperationDecision | T.B.D. | +| statuses.direction | uint8 | T.B.D. | +| statuses.distance | float32[2] | T.B.D. | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/localization/index.md b/docs/design/autoware-interfaces/ad-api/list/api/localization/index.md index 6caa6952b5c..c9c485c3f70 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/localization/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/localization/index.md @@ -9,7 +9,7 @@ This API manages the initialization of localization. Autoware requires a global ## States -![localization-initialization_state-state](./state.drawio.svg) +![localization-initialization-state](./state.drawio.svg) | State | Description | | ------------- | -------------------------------------------------------------------------------- | diff --git a/docs/design/autoware-interfaces/ad-api/list/index.md b/docs/design/autoware-interfaces/ad-api/list/index.md index 65ee7e0efd7..ad4a2ef8003 100644 --- a/docs/design/autoware-interfaces/ad-api/list/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/index.md @@ -7,3 +7,4 @@ - [Motion](./api/motion/index.md) - [Planning](./api/planning/index.md) - [Fail-safe](./api/fail_safe/index.md) +- [Cooperation](./api/cooperation/index.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md new file mode 100644 index 00000000000..054cf0ca9df --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md @@ -0,0 +1,27 @@ + + +# autoware_adapi_v1_msgs/msg/CooperationDecision + +## Definition + +```txt +# constants +uint8 UNKNOWN = 0 +uint8 DEACTIVATE = 1 +uint8 ACTIVATE = 2 +uint8 AUTONOMOUS = 3 +uint8 DEFAULT_DEACTIVATE = 4 +uint8 DEFAULT_AUTONOMOUS = 5 + +# variables +uint8 decision +``` + +## This type uses + +None + +## This type is used by + +- [autoware_adapi_v1_msgs/msg/CooperationRequest](../../autoware_adapi_v1_msgs/msg/cooperation_request.md) +- [autoware_adapi_v1_msgs/msg/CooperationStatus](../../autoware_adapi_v1_msgs/msg/cooperation_status.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md new file mode 100644 index 00000000000..504e115cad2 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md @@ -0,0 +1,19 @@ + + +# autoware_adapi_v1_msgs/msg/CooperationRequest + +## Definition + +```txt +autoware_adapi_v1_msgs/CooperationTarget target +autoware_adapi_v1_msgs/CooperationDecision cooperator +``` + +## This type uses + +- [autoware_adapi_v1_msgs/msg/CooperationDecision](../../autoware_adapi_v1_msgs/msg/cooperation_decision.md) +- [autoware_adapi_v1_msgs/msg/CooperationTarget](../../autoware_adapi_v1_msgs/msg/cooperation_target.md) + +## This type is used by + +- [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md new file mode 100644 index 00000000000..a643893d854 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md @@ -0,0 +1,18 @@ + + +# autoware_adapi_v1_msgs/msg/CooperationResponse + +## Definition + +```txt +autoware_adapi_v1_msgs/CooperationTarget target +bool success +``` + +## This type uses + +- [autoware_adapi_v1_msgs/msg/CooperationTarget](../../autoware_adapi_v1_msgs/msg/cooperation_target.md) + +## This type is used by + +- [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md new file mode 100644 index 00000000000..d21586b5eb7 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md @@ -0,0 +1,30 @@ + + +# autoware_adapi_v1_msgs/msg/CooperationStatus + +## Definition + +```txt +# constants for direction +uint8 UNKNOWN = 0 +uint8 RIGHT = 1 +uint8 LEFT = 2 +uint8 STRAIGHT = 3 + +# variables +builtin_interfaces/Time stamp +autoware_adapi_v1_msgs/CooperationTarget target +autoware_adapi_v1_msgs/CooperationDecision autonomous +autoware_adapi_v1_msgs/CooperationDecision cooperator +uint8 direction +float32[2] distance +``` + +## This type uses + +- [autoware_adapi_v1_msgs/msg/CooperationDecision](../../autoware_adapi_v1_msgs/msg/cooperation_decision.md) +- [autoware_adapi_v1_msgs/msg/CooperationTarget](../../autoware_adapi_v1_msgs/msg/cooperation_target.md) + +## This type is used by + +- [autoware_adapi_v1_msgs/msg/CooperationStatusArray](../../autoware_adapi_v1_msgs/msg/cooperation_status_array.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md new file mode 100644 index 00000000000..ba263c77340 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md @@ -0,0 +1,17 @@ + + +# autoware_adapi_v1_msgs/msg/CooperationStatusArray + +## Definition + +```txt +autoware_adapi_v1_msgs/CooperationStatus[] statuses +``` + +## This type uses + +- [autoware_adapi_v1_msgs/msg/CooperationStatus](../../autoware_adapi_v1_msgs/msg/cooperation_status.md) + +## This type is used by + +None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md new file mode 100644 index 00000000000..9a4a41cc764 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md @@ -0,0 +1,35 @@ + + +# autoware_adapi_v1_msgs/msg/CooperationTarget + +## Definition + +```txt +# constants +uint8 UNKNOWN = 0 +uint8 LANE_CHANGE = 1 +uint8 AVOIDANCE = 2 +uint8 PULL_OVER = 3 +uint8 PULL_OUT = 4 +uint8 TRAFFIC_SIGNAL = 5 +uint8 INTERSECTION = 6 +uint8 CROSSWALK = 7 +uint8 REAR_CHECK = 8 +uint8 DETECTION_AREA = 9 +uint8 NO_STOPPING_AREA = 10 +uint8 OCCLUSION_SPOT = 11 + +# variables +unique_identifier_msgs/UUID uuid +uint8 type +``` + +## This type uses + +None + +## This type is used by + +- [autoware_adapi_v1_msgs/msg/CooperationRequest](../../autoware_adapi_v1_msgs/msg/cooperation_request.md) +- [autoware_adapi_v1_msgs/msg/CooperationResponse](../../autoware_adapi_v1_msgs/msg/cooperation_response.md) +- [autoware_adapi_v1_msgs/msg/CooperationStatus](../../autoware_adapi_v1_msgs/msg/cooperation_status.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md index 625c19cc14a..2ea7ada1b55 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md @@ -32,5 +32,6 @@ None - [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../autoware_adapi_v1_msgs/srv/change_operation_mode.md) - [autoware_adapi_v1_msgs/srv/ClearRoute](../../autoware_adapi_v1_msgs/srv/clear_route.md) - [autoware_adapi_v1_msgs/srv/InitializeLocalization](../../autoware_adapi_v1_msgs/srv/initialize_localization.md) +- [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) - [autoware_adapi_v1_msgs/srv/SetRoute](../../autoware_adapi_v1_msgs/srv/set_route.md) - [autoware_adapi_v1_msgs/srv/SetRoutePoints](../../autoware_adapi_v1_msgs/srv/set_route_points.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md new file mode 100644 index 00000000000..5385d5499e7 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md @@ -0,0 +1,22 @@ + + +# autoware_adapi_v1_msgs/srv/SetCooperationDecisions + +## Definition + +```txt +autoware_adapi_v1_msgs/CooperationRequest[] requests +--- +autoware_adapi_v1_msgs/ResponseStatus status +autoware_adapi_v1_msgs/CooperationResponse[] responses +``` + +## This type uses + +- [autoware_adapi_v1_msgs/msg/CooperationRequest](../../autoware_adapi_v1_msgs/msg/cooperation_request.md) +- [autoware_adapi_v1_msgs/msg/CooperationResponse](../../autoware_adapi_v1_msgs/msg/cooperation_response.md) +- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) + +## This type is used by + +None From 6897eea1396fd0a5c72addf735f6c2b99697c780 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 16 May 2023 18:22:50 +0900 Subject: [PATCH 02/53] feat: add templates and macros Signed-off-by: Takagi, Isamu --- .../templates/interface-header.jinja2 | 2 + .../templates/interface-message.jinja2 | 9 ++++ .../templates/interface-request.jinja2 | 9 ++++ .../templates/interface-response.jinja2 | 9 ++++ main.py | 5 ++ mkdocs.yaml | 4 +- tools/generate-autoware-rosidl.py | 50 +++++++++++++++++++ yaml/autoware-rosidl.yaml | 24 +++++++++ 8 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 docs/design/autoware-interfaces/templates/interface-header.jinja2 create mode 100644 docs/design/autoware-interfaces/templates/interface-message.jinja2 create mode 100644 docs/design/autoware-interfaces/templates/interface-request.jinja2 create mode 100644 docs/design/autoware-interfaces/templates/interface-response.jinja2 create mode 100755 tools/generate-autoware-rosidl.py create mode 100644 yaml/autoware-rosidl.yaml diff --git a/docs/design/autoware-interfaces/templates/interface-header.jinja2 b/docs/design/autoware-interfaces/templates/interface-header.jinja2 new file mode 100644 index 00000000000..d1722b021f4 --- /dev/null +++ b/docs/design/autoware-interfaces/templates/interface-header.jinja2 @@ -0,0 +1,2 @@ +- Communication method: {{ interface.method }} +- Data Type: {{ interface.type }} diff --git a/docs/design/autoware-interfaces/templates/interface-message.jinja2 b/docs/design/autoware-interfaces/templates/interface-message.jinja2 new file mode 100644 index 00000000000..d0c5b294344 --- /dev/null +++ b/docs/design/autoware-interfaces/templates/interface-message.jinja2 @@ -0,0 +1,9 @@ +{%- if message %} +| Name | Type | Description | +| ---- | ---- | ----------- | +{%- for field in message %} +| {{ field.name }} | {{ link_ros_msg(interface.type, field.name, 'msg') }} | {{ field.text }} | +{%- endfor %} +{%- else %} +None +{%- endif %} diff --git a/docs/design/autoware-interfaces/templates/interface-request.jinja2 b/docs/design/autoware-interfaces/templates/interface-request.jinja2 new file mode 100644 index 00000000000..36861b7915e --- /dev/null +++ b/docs/design/autoware-interfaces/templates/interface-request.jinja2 @@ -0,0 +1,9 @@ +{%- if request %} +| Name | Type | Description | +| ---- | ---- | ----------- | +{%- for field in request %} +| {{ field.name }} | {{ link_ros_msg(interface.type, field.name, 'req') }} | {{ field.text }} | +{%- endfor %} +{%- else %} +None +{%- endif %} diff --git a/docs/design/autoware-interfaces/templates/interface-response.jinja2 b/docs/design/autoware-interfaces/templates/interface-response.jinja2 new file mode 100644 index 00000000000..e91744e5985 --- /dev/null +++ b/docs/design/autoware-interfaces/templates/interface-response.jinja2 @@ -0,0 +1,9 @@ +{%- if response %} +| Name | Type | Description | +| ---- | ---- | ----------- | +{%- for field in response %} +| {{ field.name }} | {{ link_ros_msg(interface.type, field.name, 'res') }} | {{ field.text }} | +{%- endfor %} +{%- else %} +None +{%- endif %} diff --git a/main.py b/main.py index 13663ff2212..2c91eb53c7d 100644 --- a/main.py +++ b/main.py @@ -13,3 +13,8 @@ def link_ad_api(name): root_path = "design/autoware-interfaces/ad-api" base_path = os.path.relpath(root_path, env.page.url) + "/list" return f"[{name}]({base_path}{name})" + + @env.macro + def link_ros_msg(data, name, ext): + field = env.variables["rosidl"][ext][data][name] + return field diff --git a/mkdocs.yaml b/mkdocs.yaml index 20e39c85a8f..878d9a13057 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -53,7 +53,9 @@ plugins: regex: - ^(?!(.*/)?assets/).*\.(?!(.*\.)?md|(.*\.)?svg|(.*\.)?png|(.*\.)?gif|(.*\.)?jpg).*$ - ^(.*/)?[^.]*$ - - macros + - macros: + include_yaml: + - yaml/autoware-rosidl.yaml - mkdocs-video - same-dir - search diff --git a/tools/generate-autoware-rosidl.py b/tools/generate-autoware-rosidl.py new file mode 100755 index 00000000000..7c7c069936f --- /dev/null +++ b/tools/generate-autoware-rosidl.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +import yaml +from pathlib import Path + +from rosidl_adapter.parser import MessageSpecification +from rosidl_adapter.parser import parse_message_file +from rosidl_adapter.parser import parse_service_file +from ament_index_python.packages import get_package_share_directory + +def load_markdown_yaml(path: Path): + lines = path.read_text().splitlines() + if (2 < len(lines)) and (lines[0] == "---"): + data = lines[1:lines.index("---", 1)] + return yaml.safe_load("\n".join(data)) + return None + + +def parse_rosidl_spec(spec: MessageSpecification): + fields = dict() + for field in spec.fields: + fields[field.name] = str(field.type) + return fields + + +def parse_rosidl_file(name: str, specs: dict): + pkg, ext, msg = name.split("/") + path = Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) + if ext == "msg": + specs["msg"][pkg] = parse_rosidl_spec(parse_message_file(pkg, path)) + if ext == "srv": + service = parse_service_file(pkg, path) + specs["req"][name] = parse_rosidl_spec(service.request) + specs["res"][name] = parse_rosidl_spec(service.response) + return None + + +def main(): + adapi = Path("docs/design/autoware-interfaces/ad-api/list/api") + yamls = (load_markdown_yaml(path) for path in adapi.glob("**/*.md")) + names = (yaml["interface"]["type"] for yaml in yamls if yaml) + + specs = {"msg": {}, "req": {}, "res": {}} + for name in names: + parse_rosidl_file(name, specs) + + data = {"rosidl": specs} + Path("yaml/autoware-rosidl.yaml").write_text(yaml.safe_dump(data)) + +main() diff --git a/yaml/autoware-rosidl.yaml b/yaml/autoware-rosidl.yaml new file mode 100644 index 00000000000..c86993da633 --- /dev/null +++ b/yaml/autoware-rosidl.yaml @@ -0,0 +1,24 @@ +rosidl: + msg: + autoware_adapi_v1_msgs: + stamp: builtin_interfaces/Time + state: uint16 + req: + autoware_adapi_v1_msgs/srv/ClearRoute: {} + autoware_adapi_v1_msgs/srv/SetRoute: + goal: geometry_msgs/Pose + header: std_msgs/Header + option: autoware_adapi_v1_msgs/RouteOption + segments: autoware_adapi_v1_msgs/RouteSegment[] + autoware_adapi_v1_msgs/srv/SetRoutePoints: + goal: geometry_msgs/Pose + header: std_msgs/Header + option: autoware_adapi_v1_msgs/RouteOption + waypoints: geometry_msgs/Pose[] + res: + autoware_adapi_v1_msgs/srv/ClearRoute: + status: autoware_adapi_v1_msgs/ResponseStatus + autoware_adapi_v1_msgs/srv/SetRoute: + status: autoware_adapi_v1_msgs/ResponseStatus + autoware_adapi_v1_msgs/srv/SetRoutePoints: + status: autoware_adapi_v1_msgs/ResponseStatus From 5c02eb2e562f0fc9021346fbf37a7029f7f25c0a Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 16 May 2023 18:24:43 +0900 Subject: [PATCH 03/53] feat: update route api pages Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/routing/clear_route.md | 19 +++++++----- .../ad-api/list/api/routing/route.md | 20 ++++++++----- .../ad-api/list/api/routing/set_route.md | 30 ++++++++++++------- .../list/api/routing/set_route_points.md | 30 ++++++++++++------- .../ad-api/list/api/routing/state.md | 17 +++++++---- 5 files changed, 74 insertions(+), 42 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md index 77252199605..7cb42ff3859 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md @@ -1,9 +1,16 @@ - +--- +interface: + name: /api/routing/clear_route + type: autoware_adapi_v1_msgs/srv/ClearRoute + method: function call +response: + - name: status + text: response status +--- # /api/routing/clear_route -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/ClearRoute](../../../types/autoware_adapi_v1_msgs/srv/clear_route.md) +{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} ## Description @@ -11,10 +18,8 @@ Clear the route. ## Request -None +{% include 'design/autoware-interfaces/templates/interface-request.jinja2' %} ## Response -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% include 'design/autoware-interfaces/templates/interface-response.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md index 3075fb09200..6283244d40b 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md @@ -1,9 +1,18 @@ - +--- +interface: + name: /api/routing/route + type: autoware_adapi_v1_msgs/msg/Route + method: notification +message: + - name: header + text: header for pose transformation + - name: data + text: The route in lanelet format +--- # /api/routing/route -- Method: notification -- Type: [autoware_adapi_v1_msgs/msg/Route](../../../types/autoware_adapi_v1_msgs/msg/route.md) +{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} ## Description @@ -11,7 +20,4 @@ Get the route with the waypoint segments in lanelet format. It is empty if route ## Message -| Name | Type | Description | -| ------ | ----------------------------------------- | ------------------------------ | -| header | std_msgs/msg/Header | header for pose transformation | -| data | autoware_adapi_v1_msgs/msg/RouteData[<=1] | The route in lanelet format | +{% include 'design/autoware-interfaces/templates/interface-message.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md index 370ba365a4e..d3899acf9fa 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md @@ -1,9 +1,23 @@ - +--- +interface: + name: /api/routing/set_route + type: autoware_adapi_v1_msgs/srv/SetRoute + method: function call +request: + - name: header + text: header for pose transformation + - name: goal + text: goal pose + - name: segments + text: waypoint segments in lanelet format +response: + - name: status + text: response status +--- # /api/routing/set_route -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/SetRoute](../../../types/autoware_adapi_v1_msgs/srv/set_route.md) +{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} ## Description @@ -11,14 +25,8 @@ Set the route with the waypoint segments in lanelet format. If start pose is not ## Request -| Name | Type | Description | -| -------- | ----------------------------------------- | ----------------------------------- | -| header | std_msgs/msg/Header | header for pose transformation | -| goal | geometry_msgs/msg/Pose | goal pose | -| segments | autoware_adapi_v1_msgs/msg/RouteSegment[] | waypoint segments in lanelet format | +{% include 'design/autoware-interfaces/templates/interface-request.jinja2' %} ## Response -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% include 'design/autoware-interfaces/templates/interface-response.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md index 79e2f26af0e..33fc5564061 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md @@ -1,9 +1,23 @@ - +--- +interface: + name: /api/routing/set_route_points + type: autoware_adapi_v1_msgs/srv/SetRoutePoints + method: function call +request: + - name: header + text: header for pose transformation + - name: goal + text: goal pose + - name: waypoints + text: waypoint poses +response: + - name: status + text: response status +--- # /api/routing/set_route_points -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/SetRoutePoints](../../../types/autoware_adapi_v1_msgs/srv/set_route_points.md) +{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} ## Description @@ -11,14 +25,8 @@ Set the route with the waypoint poses. If start pose is not specified, the curre ## Request -| Name | Type | Description | -| --------- | ------------------------ | ------------------------------ | -| header | std_msgs/msg/Header | header for pose transformation | -| goal | geometry_msgs/msg/Pose | goal pose | -| waypoints | geometry_msgs/msg/Pose[] | waypoint poses | +{% include 'design/autoware-interfaces/templates/interface-request.jinja2' %} ## Response -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% include 'design/autoware-interfaces/templates/interface-response.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md index e574c9a9445..d9be1d31809 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md @@ -1,9 +1,16 @@ - +--- +interface: + name: /api/routing/state + type: autoware_adapi_v1_msgs/msg/RouteState + method: notification +message: + - name: state + text: A value of the [route state](./index.md). +--- # /api/routing/state -- Method: notification -- Type: [autoware_adapi_v1_msgs/msg/RouteState](../../../types/autoware_adapi_v1_msgs/msg/route_state.md) +{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} ## Description @@ -11,6 +18,4 @@ Get the route state. For details, see the [route state](./index.md). ## Message -| Name | Type | Description | -| ----- | ------ | ----------------------------------------- | -| state | uint16 | A value of the [route state](./index.md). | +{% include 'design/autoware-interfaces/templates/interface-message.jinja2' %} From 7c7a95bab04a9b62f8843a8a1e3603adf0962375 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 16 May 2023 19:52:03 +0900 Subject: [PATCH 04/53] feat: update template Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/fail_safe/mrm_state.md | 29 ++++++------ .../ad-api/list/api/routing/clear_route.md | 31 ++++--------- .../ad-api/list/api/routing/route.md | 31 +++++-------- .../ad-api/list/api/routing/set_route.md | 45 +++++++----------- .../list/api/routing/set_route_points.md | 45 +++++++----------- .../ad-api/list/api/routing/state.md | 27 ++++------- .../templates/autoware-interface.jinja2 | 46 +++++++++++++++++++ .../templates/interface-header.jinja2 | 2 - .../templates/interface-message.jinja2 | 9 ---- .../templates/interface-request.jinja2 | 9 ---- .../templates/interface-response.jinja2 | 9 ---- tools/generate-autoware-rosidl.py | 2 +- yaml/autoware-rosidl.yaml | 9 +++- 13 files changed, 135 insertions(+), 159 deletions(-) create mode 100644 docs/design/autoware-interfaces/templates/autoware-interface.jinja2 delete mode 100644 docs/design/autoware-interfaces/templates/interface-header.jinja2 delete mode 100644 docs/design/autoware-interfaces/templates/interface-message.jinja2 delete mode 100644 docs/design/autoware-interfaces/templates/interface-request.jinja2 delete mode 100644 docs/design/autoware-interfaces/templates/interface-response.jinja2 diff --git a/docs/design/autoware-interfaces/ad-api/list/api/fail_safe/mrm_state.md b/docs/design/autoware-interfaces/ad-api/list/api/fail_safe/mrm_state.md index 790a89c1a96..54e7ffdf95f 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/fail_safe/mrm_state.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/fail_safe/mrm_state.md @@ -1,17 +1,16 @@ - - -# /api/fail_safe/mrm_state - -- Method: notification -- Type: [autoware_adapi_v1_msgs/msg/MrmState](../../../types/autoware_adapi_v1_msgs/msg/mrm_state.md) - -## Description +--- +title: /api/fail_safe/mrm_state +method: notification +type: + name: autoware_adapi_v1_msgs/msg/MrmState + msg: + - name: state + text: The state of MRM operation. + - name: behavior + text: The currently selected behavior of MRM. +--- +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the MRM state. For details, see the [fail-safe](./index.md). - -## Message - -| Name | Type | Description | -| -------- | ------ | --------------------------------------- | -| state | uint16 | The state of MRM operation. | -| behavior | uint16 | The currently selected behavior of MRM. | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md index 7cb42ff3859..a1b2161a94f 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/clear_route.md @@ -1,25 +1,14 @@ --- -interface: - name: /api/routing/clear_route - type: autoware_adapi_v1_msgs/srv/ClearRoute - method: function call -response: - - name: status - text: response status +title: /api/routing/clear_route +method: function call +type: + name: autoware_adapi_v1_msgs/srv/ClearRoute + res: + - name: status + text: response status --- -# /api/routing/clear_route - -{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} - -## Description - +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Clear the route. - -## Request - -{% include 'design/autoware-interfaces/templates/interface-request.jinja2' %} - -## Response - -{% include 'design/autoware-interfaces/templates/interface-response.jinja2' %} +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md index 6283244d40b..7bf8deafcea 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/route.md @@ -1,23 +1,16 @@ --- -interface: - name: /api/routing/route - type: autoware_adapi_v1_msgs/msg/Route - method: notification -message: - - name: header - text: header for pose transformation - - name: data - text: The route in lanelet format +title: /api/routing/route +method: notification +type: + name: autoware_adapi_v1_msgs/msg/Route + msg: + - name: header + text: header for pose transformation + - name: data + text: The route in lanelet format --- -# /api/routing/route - -{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} - -## Description - +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the route with the waypoint segments in lanelet format. It is empty if route is not set. - -## Message - -{% include 'design/autoware-interfaces/templates/interface-message.jinja2' %} +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md index d3899acf9fa..ff9b0d44f40 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route.md @@ -1,32 +1,21 @@ --- -interface: - name: /api/routing/set_route - type: autoware_adapi_v1_msgs/srv/SetRoute - method: function call -request: - - name: header - text: header for pose transformation - - name: goal - text: goal pose - - name: segments - text: waypoint segments in lanelet format -response: - - name: status - text: response status +title: /api/routing/set_route +method: function call +type: + name: autoware_adapi_v1_msgs/srv/SetRoute + req: + - name: header + text: header for pose transformation + - name: goal + text: goal pose + - name: segments + text: waypoint segments in lanelet format + res: + - name: status + text: response status --- -# /api/routing/set_route - -{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} - -## Description - +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Set the route with the waypoint segments in lanelet format. If start pose is not specified, the current pose will be used. - -## Request - -{% include 'design/autoware-interfaces/templates/interface-request.jinja2' %} - -## Response - -{% include 'design/autoware-interfaces/templates/interface-response.jinja2' %} +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md index 33fc5564061..9a6c44e80dc 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/set_route_points.md @@ -1,32 +1,21 @@ --- -interface: - name: /api/routing/set_route_points - type: autoware_adapi_v1_msgs/srv/SetRoutePoints - method: function call -request: - - name: header - text: header for pose transformation - - name: goal - text: goal pose - - name: waypoints - text: waypoint poses -response: - - name: status - text: response status +title: /api/routing/set_route_points +method: function call +type: + name: autoware_adapi_v1_msgs/srv/SetRoutePoints + req: + - name: header + text: header for pose transformation + - name: goal + text: goal pose + - name: waypoints + text: waypoint poses + res: + - name: status + text: response status --- -# /api/routing/set_route_points - -{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} - -## Description - +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Set the route with the waypoint poses. If start pose is not specified, the current pose will be used. - -## Request - -{% include 'design/autoware-interfaces/templates/interface-request.jinja2' %} - -## Response - -{% include 'design/autoware-interfaces/templates/interface-response.jinja2' %} +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md b/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md index d9be1d31809..3698a68c18b 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/routing/state.md @@ -1,21 +1,14 @@ --- -interface: - name: /api/routing/state - type: autoware_adapi_v1_msgs/msg/RouteState - method: notification -message: - - name: state - text: A value of the [route state](./index.md). +title: /api/routing/state +method: notification +type: + name: autoware_adapi_v1_msgs/msg/RouteState + msg: + - name: state + text: A value of the [route state](./index.md). --- -# /api/routing/state - -{% include 'design/autoware-interfaces/templates/interface-header.jinja2' %} - -## Description - +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the route state. For details, see the [route state](./index.md). - -## Message - -{% include 'design/autoware-interfaces/templates/interface-message.jinja2' %} +{% endblock %} diff --git a/docs/design/autoware-interfaces/templates/autoware-interface.jinja2 b/docs/design/autoware-interfaces/templates/autoware-interface.jinja2 new file mode 100644 index 00000000000..6d30611c9b3 --- /dev/null +++ b/docs/design/autoware-interfaces/templates/autoware-interface.jinja2 @@ -0,0 +1,46 @@ +# {{ title }} + +- Method: {{ method }} +- Type: {{ type.name }} + +## Description + +{%- block description %} +{%- endblock %} + +{%- if method != 'function call' %} +## Message +{%- if type.msg %} +| Name | Type | Description | +| ---- | ---- | ----------- | +{%- for field in type.msg %} +| {{ field.name }} | {{ link_ros_msg(type.name, field.name, 'msg') }} | {{ field.text }} | +{%- endfor %} +{%- else %} +None +{%- endif %} +{%- endif %} + +{%- if method == 'function call' %} +## Request +{%- if type.req %} +| Name | Type | Description | +| ---- | ---- | ----------- | +{%- for field in type.req %} +| {{ field.name }} | {{ link_ros_msg(type.name, field.name, 'req') }} | {{ field.text }} | +{%- endfor %} +{%- else %} +None +{%- endif %} + +## Response +{%- if type.res %} +| Name | Type | Description | +| ---- | ---- | ----------- | +{%- for field in type.res %} +| {{ field.name }} | {{ link_ros_msg(type.name, field.name, 'res') }} | {{ field.text }} | +{%- endfor %} +{%- else %} +None +{%- endif %} +{%- endif %} diff --git a/docs/design/autoware-interfaces/templates/interface-header.jinja2 b/docs/design/autoware-interfaces/templates/interface-header.jinja2 deleted file mode 100644 index d1722b021f4..00000000000 --- a/docs/design/autoware-interfaces/templates/interface-header.jinja2 +++ /dev/null @@ -1,2 +0,0 @@ -- Communication method: {{ interface.method }} -- Data Type: {{ interface.type }} diff --git a/docs/design/autoware-interfaces/templates/interface-message.jinja2 b/docs/design/autoware-interfaces/templates/interface-message.jinja2 deleted file mode 100644 index d0c5b294344..00000000000 --- a/docs/design/autoware-interfaces/templates/interface-message.jinja2 +++ /dev/null @@ -1,9 +0,0 @@ -{%- if message %} -| Name | Type | Description | -| ---- | ---- | ----------- | -{%- for field in message %} -| {{ field.name }} | {{ link_ros_msg(interface.type, field.name, 'msg') }} | {{ field.text }} | -{%- endfor %} -{%- else %} -None -{%- endif %} diff --git a/docs/design/autoware-interfaces/templates/interface-request.jinja2 b/docs/design/autoware-interfaces/templates/interface-request.jinja2 deleted file mode 100644 index 36861b7915e..00000000000 --- a/docs/design/autoware-interfaces/templates/interface-request.jinja2 +++ /dev/null @@ -1,9 +0,0 @@ -{%- if request %} -| Name | Type | Description | -| ---- | ---- | ----------- | -{%- for field in request %} -| {{ field.name }} | {{ link_ros_msg(interface.type, field.name, 'req') }} | {{ field.text }} | -{%- endfor %} -{%- else %} -None -{%- endif %} diff --git a/docs/design/autoware-interfaces/templates/interface-response.jinja2 b/docs/design/autoware-interfaces/templates/interface-response.jinja2 deleted file mode 100644 index e91744e5985..00000000000 --- a/docs/design/autoware-interfaces/templates/interface-response.jinja2 +++ /dev/null @@ -1,9 +0,0 @@ -{%- if response %} -| Name | Type | Description | -| ---- | ---- | ----------- | -{%- for field in response %} -| {{ field.name }} | {{ link_ros_msg(interface.type, field.name, 'res') }} | {{ field.text }} | -{%- endfor %} -{%- else %} -None -{%- endif %} diff --git a/tools/generate-autoware-rosidl.py b/tools/generate-autoware-rosidl.py index 7c7c069936f..fad0af8091a 100755 --- a/tools/generate-autoware-rosidl.py +++ b/tools/generate-autoware-rosidl.py @@ -27,7 +27,7 @@ def parse_rosidl_file(name: str, specs: dict): pkg, ext, msg = name.split("/") path = Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) if ext == "msg": - specs["msg"][pkg] = parse_rosidl_spec(parse_message_file(pkg, path)) + specs["msg"][name] = parse_rosidl_spec(parse_message_file(pkg, path)) if ext == "srv": service = parse_service_file(pkg, path) specs["req"][name] = parse_rosidl_spec(service.request) diff --git a/yaml/autoware-rosidl.yaml b/yaml/autoware-rosidl.yaml index c86993da633..af3a63c8793 100644 --- a/yaml/autoware-rosidl.yaml +++ b/yaml/autoware-rosidl.yaml @@ -1,6 +1,13 @@ rosidl: msg: - autoware_adapi_v1_msgs: + autoware_adapi_v1_msgs/msg/MrmState: + behavior: uint16 + stamp: builtin_interfaces/Time + state: uint16 + autoware_adapi_v1_msgs/msg/Route: + data: autoware_adapi_v1_msgs/RouteData[<=1] + header: std_msgs/Header + autoware_adapi_v1_msgs/msg/RouteState: stamp: builtin_interfaces/Time state: uint16 req: From 6ce548af3cdba28566894fbf4c8d7e99551d8fef Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 16 May 2023 20:05:00 +0900 Subject: [PATCH 05/53] feat: update localization api pages Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/interface/version.md | 38 +++++++++---------- .../api/localization/initialization_state.md | 28 +++++++------- .../list/api/localization/initialize.md | 37 ++++++++---------- tools/generate-autoware-rosidl.py | 2 +- yaml/autoware-rosidl.yaml | 12 ++++++ 5 files changed, 59 insertions(+), 58 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/interface/version.md b/docs/design/autoware-interfaces/ad-api/list/api/interface/version.md index 3f9e3a86cad..a23b49b1b98 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/interface/version.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/interface/version.md @@ -1,22 +1,18 @@ - - -# /api/interface/version - -- Method: function call -- Type: [autoware_adapi_version_msgs/srv/InterfaceVersion](../../../types/autoware_adapi_version_msgs/srv/interface_version.md) - -## Description - +--- +title: /api/interface/version +method: function call +type: + name: autoware_adapi_version_msgs/srv/InterfaceVersion + res: + - name: major + text: major version + - name: minor + text: minor version + - name: patch + text: patch version +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the interface version. The version follows Semantic Versioning. - -## Request - -None - -## Response - -| Name | Type | Description | -| ----- | ------ | ------------- | -| major | uint16 | major version | -| minor | uint16 | minor version | -| patch | uint16 | patch version | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/localization/initialization_state.md b/docs/design/autoware-interfaces/ad-api/list/api/localization/initialization_state.md index 5b4a1ae9023..781be074681 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/localization/initialization_state.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/localization/initialization_state.md @@ -1,16 +1,14 @@ - - -# /api/localization/initialization_state - -- Method: notification -- Type: [autoware_adapi_v1_msgs/msg/LocalizationInitializationState](../../../types/autoware_adapi_v1_msgs/msg/localization_initialization_state.md) - -## Description - +--- +title: /api/localization/initialization_state +method: notification +type: + name: autoware_adapi_v1_msgs/msg/LocalizationInitializationState + msg: + - name: state + text: A value of the [localization initialization state](./index.md). +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the initialization state of localization. For details, see the [localization initialization state](./index.md). - -## Message - -| Name | Type | Description | -| ----- | ------ | --------------------------------------------------------------- | -| state | uint16 | A value of the [localization initialization state](./index.md). | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/localization/initialize.md b/docs/design/autoware-interfaces/ad-api/list/api/localization/initialize.md index e3b1c57b451..e7d6e71cd29 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/localization/initialize.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/localization/initialize.md @@ -1,22 +1,17 @@ - - -# /api/localization/initialize - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/InitializeLocalization](../../../types/autoware_adapi_v1_msgs/srv/initialize_localization.md) - -## Description - +--- +title: /api/localization/initialize +method: function call +type: + name: autoware_adapi_v1_msgs/srv/InitializeLocalization + req: + - name: pose + text: A global pose as the initial guess. If omitted, the GNSS pose will be used. + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Request to initialize localization. For details, see the [pose state](./index.md). - -## Request - -| Name | Type | Description | -| ---- | ------------------------------------------------ | --------------------------------------------------------------------------- | -| pose | geometry_msgs/msg/PoseWithCovarianceStamped[<=1] | A global pose as the initial guess. If omitted, the GNSS pose will be used. | - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/tools/generate-autoware-rosidl.py b/tools/generate-autoware-rosidl.py index fad0af8091a..17c2214d658 100755 --- a/tools/generate-autoware-rosidl.py +++ b/tools/generate-autoware-rosidl.py @@ -38,7 +38,7 @@ def parse_rosidl_file(name: str, specs: dict): def main(): adapi = Path("docs/design/autoware-interfaces/ad-api/list/api") yamls = (load_markdown_yaml(path) for path in adapi.glob("**/*.md")) - names = (yaml["interface"]["type"] for yaml in yamls if yaml) + names = (yaml["type"]["name"] for yaml in yamls if yaml) specs = {"msg": {}, "req": {}, "res": {}} for name in names: diff --git a/yaml/autoware-rosidl.yaml b/yaml/autoware-rosidl.yaml index af3a63c8793..a4bbc210bb2 100644 --- a/yaml/autoware-rosidl.yaml +++ b/yaml/autoware-rosidl.yaml @@ -1,5 +1,8 @@ rosidl: msg: + autoware_adapi_v1_msgs/msg/LocalizationInitializationState: + stamp: builtin_interfaces/Time + state: uint16 autoware_adapi_v1_msgs/msg/MrmState: behavior: uint16 stamp: builtin_interfaces/Time @@ -12,6 +15,8 @@ rosidl: state: uint16 req: autoware_adapi_v1_msgs/srv/ClearRoute: {} + autoware_adapi_v1_msgs/srv/InitializeLocalization: + pose: geometry_msgs/PoseWithCovarianceStamped[<=1] autoware_adapi_v1_msgs/srv/SetRoute: goal: geometry_msgs/Pose header: std_msgs/Header @@ -22,10 +27,17 @@ rosidl: header: std_msgs/Header option: autoware_adapi_v1_msgs/RouteOption waypoints: geometry_msgs/Pose[] + autoware_adapi_version_msgs/srv/InterfaceVersion: {} res: autoware_adapi_v1_msgs/srv/ClearRoute: status: autoware_adapi_v1_msgs/ResponseStatus + autoware_adapi_v1_msgs/srv/InitializeLocalization: + status: autoware_adapi_v1_msgs/ResponseStatus autoware_adapi_v1_msgs/srv/SetRoute: status: autoware_adapi_v1_msgs/ResponseStatus autoware_adapi_v1_msgs/srv/SetRoutePoints: status: autoware_adapi_v1_msgs/ResponseStatus + autoware_adapi_version_msgs/srv/InterfaceVersion: + major: uint16 + minor: uint16 + patch: uint16 From d2474f58ce890de992ef2015cb4a55d20392b7bb Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 16 May 2023 20:19:26 +0900 Subject: [PATCH 06/53] feat: update api pages Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/motion/accept_start.md | 32 ++++++-------- .../ad-api/list/api/motion/state.md | 28 ++++++------ .../operation_mode/change_to_autonomous.md | 32 ++++++-------- .../api/operation_mode/change_to_local.md | 32 ++++++-------- .../api/operation_mode/change_to_remote.md | 32 ++++++-------- .../list/api/operation_mode/change_to_stop.md | 32 ++++++-------- .../disable_autoware_control.md | 32 ++++++-------- .../operation_mode/enable_autoware_control.md | 32 ++++++-------- .../ad-api/list/api/operation_mode/state.md | 44 ++++++++++--------- .../list/api/planning/steering_factors.md | 41 +++++++++-------- .../list/api/planning/velocity_factors.md | 38 ++++++++-------- yaml/autoware-rosidl.yaml | 24 ++++++++++ 12 files changed, 194 insertions(+), 205 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/motion/accept_start.md b/docs/design/autoware-interfaces/ad-api/list/api/motion/accept_start.md index 46a1b52ce3b..57cfd6066a1 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/motion/accept_start.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/motion/accept_start.md @@ -1,20 +1,14 @@ - - -# /api/motion/accept_start - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/AcceptStart](../../../types/autoware_adapi_v1_msgs/srv/accept_start.md) - -## Description - +--- +title: /api/motion/accept_start +method: function call +type: + name: autoware_adapi_v1_msgs/srv/AcceptStart + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Accept the vehicle to start. This API can be used when the [motion state](./index.md) is STARTING. - -## Request - -None - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/motion/state.md b/docs/design/autoware-interfaces/ad-api/list/api/motion/state.md index c77112ecfd9..dacbc92086c 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/motion/state.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/motion/state.md @@ -1,16 +1,14 @@ - - -# /api/motion/state - -- Method: notification -- Type: [autoware_adapi_v1_msgs/msg/MotionState](../../../types/autoware_adapi_v1_msgs/msg/motion_state.md) - -## Description - +--- +title: /api/motion/state +method: notification +type: + name: autoware_adapi_v1_msgs/msg/MotionState + msg: + - name: state + text: A value of the motion state. +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the motion state. For details, see the [motion state](./index.md). - -## Message - -| Name | Type | Description | -| ----- | ------ | ---------------------------- | -| state | uint16 | A value of the motion state. | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_autonomous.md b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_autonomous.md index 7a5f6226380..b64e6aa9500 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_autonomous.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_autonomous.md @@ -1,20 +1,14 @@ - - -# /api/operation_mode/change_to_autonomous - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../../types/autoware_adapi_v1_msgs/srv/change_operation_mode.md) - -## Description - +--- +title: /api/operation_mode/change_to_autonomous +method: function call +type: + name: autoware_adapi_v1_msgs/srv/ChangeOperationMode + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Change the operation mode to autonomous. For details, see the [operation mode](./index.md). - -## Request - -None - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_local.md b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_local.md index dd1bdc02d43..e1ca84473ca 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_local.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_local.md @@ -1,20 +1,14 @@ - - -# /api/operation_mode/change_to_local - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../../types/autoware_adapi_v1_msgs/srv/change_operation_mode.md) - -## Description - +--- +title: /api/operation_mode/change_to_local +method: function call +type: + name: autoware_adapi_v1_msgs/srv/ChangeOperationMode + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Change the operation mode to local. For details, see the [operation mode](./index.md). - -## Request - -None - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_remote.md b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_remote.md index 689f66510af..17c830e6ddb 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_remote.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_remote.md @@ -1,20 +1,14 @@ - - -# /api/operation_mode/change_to_remote - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../../types/autoware_adapi_v1_msgs/srv/change_operation_mode.md) - -## Description - +--- +title: /api/operation_mode/change_to_remote +method: function call +type: + name: autoware_adapi_v1_msgs/srv/ChangeOperationMode + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Change the operation mode to remote. For details, see the [operation mode](./index.md). - -## Request - -None - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_stop.md b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_stop.md index d590a42330e..509cb7b2c8e 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_stop.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/change_to_stop.md @@ -1,20 +1,14 @@ - - -# /api/operation_mode/change_to_stop - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../../types/autoware_adapi_v1_msgs/srv/change_operation_mode.md) - -## Description - +--- +title: /api/operation_mode/change_to_stop +method: function call +type: + name: autoware_adapi_v1_msgs/srv/ChangeOperationMode + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Change the operation mode to stop. For details, see the [operation mode](./index.md). - -## Request - -None - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/disable_autoware_control.md b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/disable_autoware_control.md index 7372ac7e2ed..96be075d08d 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/disable_autoware_control.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/disable_autoware_control.md @@ -1,21 +1,15 @@ - - -# /api/operation_mode/disable_autoware_control - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../../types/autoware_adapi_v1_msgs/srv/change_operation_mode.md) - -## Description - +--- +title: /api/operation_mode/disable_autoware_control +method: function call +type: + name: autoware_adapi_v1_msgs/srv/ChangeOperationMode + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Disable vehicle control by Autoware. For details, see the [operation mode](./index.md). This API fails if the vehicle does not support mode change by software. - -## Request - -None - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/enable_autoware_control.md b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/enable_autoware_control.md index ec8b0b6220e..49752fcdd84 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/enable_autoware_control.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/enable_autoware_control.md @@ -1,21 +1,15 @@ - - -# /api/operation_mode/enable_autoware_control - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../../types/autoware_adapi_v1_msgs/srv/change_operation_mode.md) - -## Description - +--- +title: /api/operation_mode/enable_autoware_control +method: function call +type: + name: autoware_adapi_v1_msgs/srv/ChangeOperationMode + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Enable vehicle control by Autoware. For details, see the [operation mode](./index.md). This API fails if the vehicle does not support mode change by software. - -## Request - -None - -## Response - -| Name | Type | Description | -| ------ | ----------------------------------------- | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/state.md b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/state.md index 2342efacb5a..7ff8385963a 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/state.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/operation_mode/state.md @@ -1,22 +1,26 @@ - - -# /api/operation_mode/state - -- Method: notification -- Type: [autoware_adapi_v1_msgs/msg/OperationModeState](../../../types/autoware_adapi_v1_msgs/msg/operation_mode_state.md) - -## Description +--- +title: /api/operation_mode/state +method: notification +type: + name: autoware_adapi_v1_msgs/msg/OperationModeState + msg: + - name: mode + text: The selected command for Autoware control. + - name: is_autoware_control_enabled + text: True if vehicle control by Autoware is enabled. + - name: is_in_transition + text: True if the operation mode is in transition. + - name: is_stop_mode_available + text: True if the operation mode can be changed to stop. + - name: is_autonomous_mode_available + text: True if the operation mode can be changed to autonomous. + - name: is_local_mode_available + text: True if the operation mode can be changed to local. + - name: is_remote_mode_available + text: True if the operation mode can be changed to remote. +--- +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the operation mode state. For details, see the [operation mode](./index.md). - -## Message - -| Name | Type | Description | -| ---------------------------- | ----- | -------------------------------------------------------- | -| mode | uint8 | The selected command for Autoware control. | -| is_autoware_control_enabled | bool | True if vehicle control by Autoware is enabled. | -| is_in_transition | bool | True if the operation mode is in transition. | -| is_stop_mode_available | bool | True if the operation mode can be changed to stop. | -| is_autonomous_mode_available | bool | True if the operation mode can be changed to autonomous. | -| is_local_mode_available | bool | True if the operation mode can be changed to local. | -| is_remote_mode_available | bool | True if the operation mode can be changed to remote. | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md index 5580ebf8353..e0c91b44bd5 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md @@ -1,22 +1,25 @@ - - -# /api/planning/steering_factors - -- Method: realtime stream -- Type: [autoware_adapi_v1_msgs/msg/SteeringFactorArray](../../../types/autoware_adapi_v1_msgs/msg/steering_factor_array.md) - -## Description +--- +title: /api/planning/steering_factors +method: realtime stream +type: + name: autoware_adapi_v1_msgs/msg/SteeringFactorArray + msg: + - name: factors.pose + text: The base link pose related to the steering factor. + - name: factors.distance + text: The distance from the base link to the above pose. + - name: factors.type + text: The type of the steering factor. + - name: factors.direction + text: The direction of the steering factor. + - name: factors.status + text: The status of the steering factor. + - name: factors.detail + text: The additional information of the steering factor. +--- +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the steering factors, sorted in ascending order of distance. For details, see the [planning](./index.md). - -## Message - -| Name | Type | Description | -| ----------------- | ------------------------- | -------------------------------------------------- | -| factors.pose | geometry_msgs/msg/Pose[2] | The base link pose related to the steering factor. | -| factors.distance | float32[2] | The distance from the base link to the above pose. | -| factors.type | uint16 | The type of the steering factor. | -| factors.direction | uint16 | The direction of the steering factor. | -| factors.status | uint16 | The status of the steering factor. | -| factors.detail | string | The additional information of the steering factor. | +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md index c73303a43ad..5339a0a4297 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md @@ -1,21 +1,23 @@ - - -# /api/planning/velocity_factors - -- Method: realtime stream -- Type: [autoware_adapi_v1_msgs/msg/VelocityFactorArray](../../../types/autoware_adapi_v1_msgs/msg/velocity_factor_array.md) - -## Description +--- +title: /api/planning/velocity_factors +method: realtime stream +type: + name: autoware_adapi_v1_msgs/msg/VelocityFactorArray + msg: + - name: factors.pose + text: The base link pose related to the velocity factor. + - name: factors.distance + text: The distance from the base link to the above pose. + - name: factors.type + text: The type of the velocity factor. + - name: factors.status + text: The status of the velocity factor. + - name: factors.detail + text: The additional information of the velocity factor. +--- +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} Get the velocity factors, sorted in ascending order of distance. For details, see the [planning](./index.md). - -## Message - -| Name | Type | Description | -| ---------------- | ---------------------- | -------------------------------------------------- | -| factors.pose | geometry_msgs/msg/Pose | The base link pose related to the velocity factor. | -| factors.distance | float32 | The distance from the base link to the above pose. | -| factors.type | uint16 | The type of the velocity factor. | -| factors.status | uint16 | The status of the velocity factor. | -| factors.detail | string | The additional information of the velocity factor. | +{% endblock %} diff --git a/yaml/autoware-rosidl.yaml b/yaml/autoware-rosidl.yaml index a4bbc210bb2..3975543a084 100644 --- a/yaml/autoware-rosidl.yaml +++ b/yaml/autoware-rosidl.yaml @@ -3,17 +3,37 @@ rosidl: autoware_adapi_v1_msgs/msg/LocalizationInitializationState: stamp: builtin_interfaces/Time state: uint16 + autoware_adapi_v1_msgs/msg/MotionState: + stamp: builtin_interfaces/Time + state: uint16 autoware_adapi_v1_msgs/msg/MrmState: behavior: uint16 stamp: builtin_interfaces/Time state: uint16 + autoware_adapi_v1_msgs/msg/OperationModeState: + is_autonomous_mode_available: bool + is_autoware_control_enabled: bool + is_in_transition: bool + is_local_mode_available: bool + is_remote_mode_available: bool + is_stop_mode_available: bool + mode: uint8 + stamp: builtin_interfaces/Time autoware_adapi_v1_msgs/msg/Route: data: autoware_adapi_v1_msgs/RouteData[<=1] header: std_msgs/Header autoware_adapi_v1_msgs/msg/RouteState: stamp: builtin_interfaces/Time state: uint16 + autoware_adapi_v1_msgs/msg/SteeringFactorArray: + factors: autoware_adapi_v1_msgs/SteeringFactor[] + header: std_msgs/Header + autoware_adapi_v1_msgs/msg/VelocityFactorArray: + factors: autoware_adapi_v1_msgs/VelocityFactor[] + header: std_msgs/Header req: + autoware_adapi_v1_msgs/srv/AcceptStart: {} + autoware_adapi_v1_msgs/srv/ChangeOperationMode: {} autoware_adapi_v1_msgs/srv/ClearRoute: {} autoware_adapi_v1_msgs/srv/InitializeLocalization: pose: geometry_msgs/PoseWithCovarianceStamped[<=1] @@ -29,6 +49,10 @@ rosidl: waypoints: geometry_msgs/Pose[] autoware_adapi_version_msgs/srv/InterfaceVersion: {} res: + autoware_adapi_v1_msgs/srv/AcceptStart: + status: autoware_adapi_v1_msgs/ResponseStatus + autoware_adapi_v1_msgs/srv/ChangeOperationMode: + status: autoware_adapi_v1_msgs/ResponseStatus autoware_adapi_v1_msgs/srv/ClearRoute: status: autoware_adapi_v1_msgs/ResponseStatus autoware_adapi_v1_msgs/srv/InitializeLocalization: From c7853ea24d1033889a4c0fdfd6bf8551d2873752 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 16 May 2023 21:33:12 +0900 Subject: [PATCH 07/53] feat: resolve field types Signed-off-by: Takagi, Isamu --- main.py | 8 +-- tools/generate-autoware-rosidl.py | 50 +++++++++++++----- yaml/autoware-rosidl.yaml | 85 ++++++++++++++++++++----------- 3 files changed, 98 insertions(+), 45 deletions(-) diff --git a/main.py b/main.py index 2c91eb53c7d..e6c03e16c95 100644 --- a/main.py +++ b/main.py @@ -15,6 +15,8 @@ def link_ad_api(name): return f"[{name}]({base_path}{name})" @env.macro - def link_ros_msg(data, name, ext): - field = env.variables["rosidl"][ext][data][name] - return field + def link_ros_msg(type, name, ext): + for field in name.split("."): + type = type.split("[")[0] + type = env.variables["rosidl"][ext][type][field] + return type diff --git a/tools/generate-autoware-rosidl.py b/tools/generate-autoware-rosidl.py index 17c2214d658..3c9159a9386 100755 --- a/tools/generate-autoware-rosidl.py +++ b/tools/generate-autoware-rosidl.py @@ -8,6 +8,7 @@ from rosidl_adapter.parser import parse_service_file from ament_index_python.packages import get_package_share_directory + def load_markdown_yaml(path: Path): lines = path.read_text().splitlines() if (2 < len(lines)) and (lines[0] == "---"): @@ -16,23 +17,40 @@ def load_markdown_yaml(path: Path): return None -def parse_rosidl_spec(spec: MessageSpecification): - fields = dict() - for field in spec.fields: - fields[field.name] = str(field.type) +def strip_array_suffix(name): + return name.split("[")[0] + + +def normalize_msg_name(name: str): + parts = str(name).split("/") + return parts[0] if len(parts) == 1 else f"{parts[0]}/msg/{parts[1]}" + + +def parse_rosidl_spec(depends: set, visited: set, spec: MessageSpecification): + fields = {field.name: normalize_msg_name(field.type) for field in spec.fields} + for name in fields.values(): + name = strip_array_suffix(name) + if name not in visited: + depends.add(name) return fields -def parse_rosidl_file(name: str, specs: dict): - pkg, ext, msg = name.split("/") +def parse_rosidl_file(depends: set, visited: set, specs: dict, name: str): + visited.add(name) + parts = name.split("/") + if len(parts) != 3: + return + pkg, ext, msg = parts + if pkg not in ["autoware_adapi_version_msgs", "autoware_adapi_v1_msgs"]: + return path = Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) if ext == "msg": - specs["msg"][name] = parse_rosidl_spec(parse_message_file(pkg, path)) + message = parse_message_file(pkg, path) + specs["msg"][name] = parse_rosidl_spec(depends, visited, message) if ext == "srv": service = parse_service_file(pkg, path) - specs["req"][name] = parse_rosidl_spec(service.request) - specs["res"][name] = parse_rosidl_spec(service.response) - return None + specs["req"][name] = parse_rosidl_spec(depends, visited, service.request) + specs["res"][name] = parse_rosidl_spec(depends, visited, service.response) def main(): @@ -40,9 +58,17 @@ def main(): yamls = (load_markdown_yaml(path) for path in adapi.glob("**/*.md")) names = (yaml["type"]["name"] for yaml in yamls if yaml) + # Create field list of messages and services. + visited = set() + depends = set(names) specs = {"msg": {}, "req": {}, "res": {}} - for name in names: - parse_rosidl_file(name, specs) + while depends: + name = depends.pop() + parse_rosidl_file(depends, visited, specs, name) + + # Remove empty fields. + for key in ("msg", "req", "res"): + specs[key] = {k: v for k, v in specs[key].items() if v} data = {"rosidl": specs} Path("yaml/autoware-rosidl.yaml").write_text(yaml.safe_dump(data)) diff --git a/yaml/autoware-rosidl.yaml b/yaml/autoware-rosidl.yaml index 3975543a084..e187a0c1aa8 100644 --- a/yaml/autoware-rosidl.yaml +++ b/yaml/autoware-rosidl.yaml @@ -1,14 +1,14 @@ rosidl: msg: autoware_adapi_v1_msgs/msg/LocalizationInitializationState: - stamp: builtin_interfaces/Time + stamp: builtin_interfaces/msg/Time state: uint16 autoware_adapi_v1_msgs/msg/MotionState: - stamp: builtin_interfaces/Time + stamp: builtin_interfaces/msg/Time state: uint16 autoware_adapi_v1_msgs/msg/MrmState: behavior: uint16 - stamp: builtin_interfaces/Time + stamp: builtin_interfaces/msg/Time state: uint16 autoware_adapi_v1_msgs/msg/OperationModeState: is_autonomous_mode_available: bool @@ -18,49 +18,74 @@ rosidl: is_remote_mode_available: bool is_stop_mode_available: bool mode: uint8 - stamp: builtin_interfaces/Time + stamp: builtin_interfaces/msg/Time + autoware_adapi_v1_msgs/msg/ResponseStatus: + code: uint16 + message: string + success: bool autoware_adapi_v1_msgs/msg/Route: - data: autoware_adapi_v1_msgs/RouteData[<=1] - header: std_msgs/Header + data: autoware_adapi_v1_msgs/msg/RouteData[<=1] + header: std_msgs/msg/Header + autoware_adapi_v1_msgs/msg/RouteData: + goal: geometry_msgs/msg/Pose + segments: autoware_adapi_v1_msgs/msg/RouteSegment[] + start: geometry_msgs/msg/Pose + autoware_adapi_v1_msgs/msg/RouteOption: + allow_goal_modification: bool + autoware_adapi_v1_msgs/msg/RoutePrimitive: + id: int64 + type: string + autoware_adapi_v1_msgs/msg/RouteSegment: + alternatives: autoware_adapi_v1_msgs/msg/RoutePrimitive[] + preferred: autoware_adapi_v1_msgs/msg/RoutePrimitive autoware_adapi_v1_msgs/msg/RouteState: - stamp: builtin_interfaces/Time + stamp: builtin_interfaces/msg/Time state: uint16 + autoware_adapi_v1_msgs/msg/SteeringFactor: + detail: string + direction: uint16 + distance: float32[2] + pose: geometry_msgs/msg/Pose[2] + status: uint16 + type: uint16 autoware_adapi_v1_msgs/msg/SteeringFactorArray: - factors: autoware_adapi_v1_msgs/SteeringFactor[] - header: std_msgs/Header + factors: autoware_adapi_v1_msgs/msg/SteeringFactor[] + header: std_msgs/msg/Header + autoware_adapi_v1_msgs/msg/VelocityFactor: + detail: string + distance: float32 + pose: geometry_msgs/msg/Pose + status: uint16 + type: uint16 autoware_adapi_v1_msgs/msg/VelocityFactorArray: - factors: autoware_adapi_v1_msgs/VelocityFactor[] - header: std_msgs/Header + factors: autoware_adapi_v1_msgs/msg/VelocityFactor[] + header: std_msgs/msg/Header req: - autoware_adapi_v1_msgs/srv/AcceptStart: {} - autoware_adapi_v1_msgs/srv/ChangeOperationMode: {} - autoware_adapi_v1_msgs/srv/ClearRoute: {} autoware_adapi_v1_msgs/srv/InitializeLocalization: - pose: geometry_msgs/PoseWithCovarianceStamped[<=1] + pose: geometry_msgs/msg/PoseWithCovarianceStamped[<=1] autoware_adapi_v1_msgs/srv/SetRoute: - goal: geometry_msgs/Pose - header: std_msgs/Header - option: autoware_adapi_v1_msgs/RouteOption - segments: autoware_adapi_v1_msgs/RouteSegment[] + goal: geometry_msgs/msg/Pose + header: std_msgs/msg/Header + option: autoware_adapi_v1_msgs/msg/RouteOption + segments: autoware_adapi_v1_msgs/msg/RouteSegment[] autoware_adapi_v1_msgs/srv/SetRoutePoints: - goal: geometry_msgs/Pose - header: std_msgs/Header - option: autoware_adapi_v1_msgs/RouteOption - waypoints: geometry_msgs/Pose[] - autoware_adapi_version_msgs/srv/InterfaceVersion: {} + goal: geometry_msgs/msg/Pose + header: std_msgs/msg/Header + option: autoware_adapi_v1_msgs/msg/RouteOption + waypoints: geometry_msgs/msg/Pose[] res: autoware_adapi_v1_msgs/srv/AcceptStart: - status: autoware_adapi_v1_msgs/ResponseStatus + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/ChangeOperationMode: - status: autoware_adapi_v1_msgs/ResponseStatus + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/ClearRoute: - status: autoware_adapi_v1_msgs/ResponseStatus + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/InitializeLocalization: - status: autoware_adapi_v1_msgs/ResponseStatus + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/SetRoute: - status: autoware_adapi_v1_msgs/ResponseStatus + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/SetRoutePoints: - status: autoware_adapi_v1_msgs/ResponseStatus + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_version_msgs/srv/InterfaceVersion: major: uint16 minor: uint16 From 9a285530e5f881abaec3e9c794d8ed16f8227dfb Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 16 May 2023 21:52:17 +0900 Subject: [PATCH 08/53] feat: add message link Signed-off-by: Takagi, Isamu --- .../templates/autoware-interface.jinja2 | 8 ++++---- main.py | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/design/autoware-interfaces/templates/autoware-interface.jinja2 b/docs/design/autoware-interfaces/templates/autoware-interface.jinja2 index 6d30611c9b3..531f69708c3 100644 --- a/docs/design/autoware-interfaces/templates/autoware-interface.jinja2 +++ b/docs/design/autoware-interfaces/templates/autoware-interface.jinja2 @@ -1,7 +1,7 @@ # {{ title }} - Method: {{ method }} -- Type: {{ type.name }} +- Type: {{ create_relative_link(type.name, 'design/autoware-interfaces/ad-api/types/' + type.name) }} ## Description @@ -14,7 +14,7 @@ | Name | Type | Description | | ---- | ---- | ----------- | {%- for field in type.msg %} -| {{ field.name }} | {{ link_ros_msg(type.name, field.name, 'msg') }} | {{ field.text }} | +| {{ field.name }} | {{ resolve_msg_field(type.name, field.name, 'msg') }} | {{ field.text }} | {%- endfor %} {%- else %} None @@ -27,7 +27,7 @@ None | Name | Type | Description | | ---- | ---- | ----------- | {%- for field in type.req %} -| {{ field.name }} | {{ link_ros_msg(type.name, field.name, 'req') }} | {{ field.text }} | +| {{ field.name }} | {{ resolve_msg_field(type.name, field.name, 'req') }} | {{ field.text }} | {%- endfor %} {%- else %} None @@ -38,7 +38,7 @@ None | Name | Type | Description | | ---- | ---- | ----------- | {%- for field in type.res %} -| {{ field.name }} | {{ link_ros_msg(type.name, field.name, 'res') }} | {{ field.text }} | +| {{ field.name }} | {{ resolve_msg_field(type.name, field.name, 'res') }} | {{ field.text }} | {%- endfor %} {%- else %} None diff --git a/main.py b/main.py index e6c03e16c95..52bc37abe0a 100644 --- a/main.py +++ b/main.py @@ -8,14 +8,17 @@ def drawio(image_path): image_url = urllib.parse.quote(f"{env.conf['site_url']}{image_path}", "") return f"https://app.diagrams.net/?lightbox=1#U{image_url}" + @env.macro + def create_relative_link(text, root_path): + path = os.path.relpath(root_path, env.page.url) + return f"[{text}]({path})" + @env.macro def link_ad_api(name): - root_path = "design/autoware-interfaces/ad-api" - base_path = os.path.relpath(root_path, env.page.url) + "/list" - return f"[{name}]({base_path}{name})" + return create_relative_link(name, f"design/autoware-interfaces/ad-api/list/{name}") @env.macro - def link_ros_msg(type, name, ext): + def resolve_msg_field(type, name, ext): for field in name.split("."): type = type.split("[")[0] type = env.variables["rosidl"][ext][type][field] From 516f408f21723103aaba16b592b97bbeff464245 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 17 May 2023 06:33:55 +0900 Subject: [PATCH 09/53] feat: change yaml format Signed-off-by: Takagi, Isamu --- main.py | 3 +- mkdocs.yaml | 2 +- tools/generate-autoware-interfaces.py | 106 ++++++++++++++++++ tools/generate-autoware-rosidl.py | 76 ------------- ...e-rosidl.yaml => autoware-interfaces.yaml} | 87 ++++++++------ 5 files changed, 162 insertions(+), 112 deletions(-) create mode 100755 tools/generate-autoware-interfaces.py delete mode 100755 tools/generate-autoware-rosidl.py rename yaml/{autoware-rosidl.yaml => autoware-interfaces.yaml} (64%) diff --git a/main.py b/main.py index 52bc37abe0a..5629cd8cdc5 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,8 @@ def link_ad_api(name): @env.macro def resolve_msg_field(type, name, ext): + specs = env.variables["autoware_interfaces"]["types"] for field in name.split("."): type = type.split("[")[0] - type = env.variables["rosidl"][ext][type][field] + type = specs[type][ext][field] return type diff --git a/mkdocs.yaml b/mkdocs.yaml index 878d9a13057..df58f2c09e5 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -55,7 +55,7 @@ plugins: - ^(.*/)?[^.]*$ - macros: include_yaml: - - yaml/autoware-rosidl.yaml + - autoware_interfaces: yaml/autoware-interfaces.yaml - mkdocs-video - same-dir - search diff --git a/tools/generate-autoware-interfaces.py b/tools/generate-autoware-interfaces.py new file mode 100755 index 00000000000..3f29b09286d --- /dev/null +++ b/tools/generate-autoware-interfaces.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 + +import yaml +from pathlib import Path + +from rosidl_adapter.parser import MessageSpecification +from rosidl_adapter.parser import parse_message_file +from rosidl_adapter.parser import parse_service_file +from ament_index_python.packages import get_package_share_directory + + +def load_markdown_metadata(path: Path): + lines = path.read_text().splitlines() + if (2 < len(lines)) and (lines[0] == "---"): + data = lines[1:lines.index("---", 1)] + return yaml.safe_load("\n".join(data)) + return None + + +def is_documentation_msg(name: str): + targets = set(["autoware_adapi_version_msgs", "autoware_adapi_v1_msgs"]) + return name.split("/")[0] in targets + + +def strip_array_suffix(name: str): + return name.split("[")[0] + + +def resolve_msg_file_path(name: str): + pkg, ext, msg = name.split("/") + return Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) + +def normalize_msg_name(name: str): + parts = str(name).split("/") + return parts[0] if len(parts) == 1 else f"{parts[0]}/msg/{parts[1]}" + + +def parse_rosidl_spec(depends: set, visited: set, spec: MessageSpecification): + fields = {field.name: normalize_msg_name(field.type) for field in spec.fields} + for name in fields.values(): + name = strip_array_suffix(name) + if name not in visited: + depends.add(name) + return fields + + +def parse_rosidl_file(depends: set, visited: set, specs: dict, name: str): + visited.add(name) + if not is_documentation_msg(name): + return + pkg, ext, msg = name.split("/") + path = Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) + if ext == "msg": + msg = parse_message_file(pkg, path) + msg = parse_rosidl_spec(depends, visited, msg) + specs[name] = {"msg": msg} + specs[name] = {k: v for k, v in specs[name].items() if v} + if ext == "srv": + srv = parse_service_file(pkg, path) + req = parse_rosidl_spec(depends, visited, srv.request) + res = parse_rosidl_spec(depends, visited, srv.response) + specs[name] = {"req": req, "res": res} + specs[name] = {k: v for k, v in specs[name].items() if v} + + +def generate_type_page(name: str, uses: set, used: set): + path = Path("docs/design/autoware-interfaces/ad-api/types").joinpath(name).with_suffix(".md") + print(path) + print(resolve_msg_file_path(name)) + + +def main(): + # Create a list of data types used in adapi. + adapi = Path("docs/design/autoware-interfaces/ad-api/list/api") + yamls = (load_markdown_metadata(path) for path in adapi.glob("**/*.md")) + names = (yaml["type"]["name"] for yaml in yamls if yaml) + + # Create a field list for each data type. + visited = set() + depends = set(names) + specs = {} + while depends: + name = depends.pop() + parse_rosidl_file(depends, visited, specs, name) + + # Export a field list. + data = {"types": specs} + Path("yaml/autoware-interfaces.yaml").write_text(yaml.safe_dump(data)) + + return + + # Create pages of data types + type_uses = {name: set() for name in visited if is_documentation_msg(name)} + type_used = {name: set() for name in visited if is_documentation_msg(name)} + for key in ("msg", "req", "res"): + for name, fields in specs[key].items(): + for field in fields.values(): + field = strip_array_suffix(field) + if is_documentation_msg(field): + type_uses[name].add(field) + type_used[field].add(name) + for name in visited: + if is_documentation_msg(name): + generate_type_page(name, type_uses[name], type_used[name]) + +main() diff --git a/tools/generate-autoware-rosidl.py b/tools/generate-autoware-rosidl.py deleted file mode 100755 index 3c9159a9386..00000000000 --- a/tools/generate-autoware-rosidl.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python3 - -import yaml -from pathlib import Path - -from rosidl_adapter.parser import MessageSpecification -from rosidl_adapter.parser import parse_message_file -from rosidl_adapter.parser import parse_service_file -from ament_index_python.packages import get_package_share_directory - - -def load_markdown_yaml(path: Path): - lines = path.read_text().splitlines() - if (2 < len(lines)) and (lines[0] == "---"): - data = lines[1:lines.index("---", 1)] - return yaml.safe_load("\n".join(data)) - return None - - -def strip_array_suffix(name): - return name.split("[")[0] - - -def normalize_msg_name(name: str): - parts = str(name).split("/") - return parts[0] if len(parts) == 1 else f"{parts[0]}/msg/{parts[1]}" - - -def parse_rosidl_spec(depends: set, visited: set, spec: MessageSpecification): - fields = {field.name: normalize_msg_name(field.type) for field in spec.fields} - for name in fields.values(): - name = strip_array_suffix(name) - if name not in visited: - depends.add(name) - return fields - - -def parse_rosidl_file(depends: set, visited: set, specs: dict, name: str): - visited.add(name) - parts = name.split("/") - if len(parts) != 3: - return - pkg, ext, msg = parts - if pkg not in ["autoware_adapi_version_msgs", "autoware_adapi_v1_msgs"]: - return - path = Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) - if ext == "msg": - message = parse_message_file(pkg, path) - specs["msg"][name] = parse_rosidl_spec(depends, visited, message) - if ext == "srv": - service = parse_service_file(pkg, path) - specs["req"][name] = parse_rosidl_spec(depends, visited, service.request) - specs["res"][name] = parse_rosidl_spec(depends, visited, service.response) - - -def main(): - adapi = Path("docs/design/autoware-interfaces/ad-api/list/api") - yamls = (load_markdown_yaml(path) for path in adapi.glob("**/*.md")) - names = (yaml["type"]["name"] for yaml in yamls if yaml) - - # Create field list of messages and services. - visited = set() - depends = set(names) - specs = {"msg": {}, "req": {}, "res": {}} - while depends: - name = depends.pop() - parse_rosidl_file(depends, visited, specs, name) - - # Remove empty fields. - for key in ("msg", "req", "res"): - specs[key] = {k: v for k, v in specs[key].items() if v} - - data = {"rosidl": specs} - Path("yaml/autoware-rosidl.yaml").write_text(yaml.safe_dump(data)) - -main() diff --git a/yaml/autoware-rosidl.yaml b/yaml/autoware-interfaces.yaml similarity index 64% rename from yaml/autoware-rosidl.yaml rename to yaml/autoware-interfaces.yaml index e187a0c1aa8..b766dac0e00 100644 --- a/yaml/autoware-rosidl.yaml +++ b/yaml/autoware-interfaces.yaml @@ -1,16 +1,19 @@ -rosidl: - msg: - autoware_adapi_v1_msgs/msg/LocalizationInitializationState: +types: + autoware_adapi_v1_msgs/msg/LocalizationInitializationState: + msg: stamp: builtin_interfaces/msg/Time state: uint16 - autoware_adapi_v1_msgs/msg/MotionState: + autoware_adapi_v1_msgs/msg/MotionState: + msg: stamp: builtin_interfaces/msg/Time state: uint16 - autoware_adapi_v1_msgs/msg/MrmState: + autoware_adapi_v1_msgs/msg/MrmState: + msg: behavior: uint16 stamp: builtin_interfaces/msg/Time state: uint16 - autoware_adapi_v1_msgs/msg/OperationModeState: + autoware_adapi_v1_msgs/msg/OperationModeState: + msg: is_autonomous_mode_available: bool is_autoware_control_enabled: bool is_in_transition: bool @@ -19,74 +22,90 @@ rosidl: is_stop_mode_available: bool mode: uint8 stamp: builtin_interfaces/msg/Time - autoware_adapi_v1_msgs/msg/ResponseStatus: + autoware_adapi_v1_msgs/msg/ResponseStatus: + msg: code: uint16 message: string success: bool - autoware_adapi_v1_msgs/msg/Route: + autoware_adapi_v1_msgs/msg/Route: + msg: data: autoware_adapi_v1_msgs/msg/RouteData[<=1] header: std_msgs/msg/Header - autoware_adapi_v1_msgs/msg/RouteData: + autoware_adapi_v1_msgs/msg/RouteData: + msg: goal: geometry_msgs/msg/Pose segments: autoware_adapi_v1_msgs/msg/RouteSegment[] start: geometry_msgs/msg/Pose - autoware_adapi_v1_msgs/msg/RouteOption: + autoware_adapi_v1_msgs/msg/RouteOption: + msg: allow_goal_modification: bool - autoware_adapi_v1_msgs/msg/RoutePrimitive: + autoware_adapi_v1_msgs/msg/RoutePrimitive: + msg: id: int64 type: string - autoware_adapi_v1_msgs/msg/RouteSegment: + autoware_adapi_v1_msgs/msg/RouteSegment: + msg: alternatives: autoware_adapi_v1_msgs/msg/RoutePrimitive[] preferred: autoware_adapi_v1_msgs/msg/RoutePrimitive - autoware_adapi_v1_msgs/msg/RouteState: + autoware_adapi_v1_msgs/msg/RouteState: + msg: stamp: builtin_interfaces/msg/Time state: uint16 - autoware_adapi_v1_msgs/msg/SteeringFactor: + autoware_adapi_v1_msgs/msg/SteeringFactor: + msg: detail: string direction: uint16 distance: float32[2] pose: geometry_msgs/msg/Pose[2] status: uint16 type: uint16 - autoware_adapi_v1_msgs/msg/SteeringFactorArray: + autoware_adapi_v1_msgs/msg/SteeringFactorArray: + msg: factors: autoware_adapi_v1_msgs/msg/SteeringFactor[] header: std_msgs/msg/Header - autoware_adapi_v1_msgs/msg/VelocityFactor: + autoware_adapi_v1_msgs/msg/VelocityFactor: + msg: detail: string distance: float32 pose: geometry_msgs/msg/Pose status: uint16 type: uint16 - autoware_adapi_v1_msgs/msg/VelocityFactorArray: + autoware_adapi_v1_msgs/msg/VelocityFactorArray: + msg: factors: autoware_adapi_v1_msgs/msg/VelocityFactor[] header: std_msgs/msg/Header - req: - autoware_adapi_v1_msgs/srv/InitializeLocalization: + autoware_adapi_v1_msgs/srv/AcceptStart: + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/ChangeOperationMode: + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/ClearRoute: + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/InitializeLocalization: + req: pose: geometry_msgs/msg/PoseWithCovarianceStamped[<=1] - autoware_adapi_v1_msgs/srv/SetRoute: + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/SetRoute: + req: goal: geometry_msgs/msg/Pose header: std_msgs/msg/Header option: autoware_adapi_v1_msgs/msg/RouteOption segments: autoware_adapi_v1_msgs/msg/RouteSegment[] - autoware_adapi_v1_msgs/srv/SetRoutePoints: + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/SetRoutePoints: + req: goal: geometry_msgs/msg/Pose header: std_msgs/msg/Header option: autoware_adapi_v1_msgs/msg/RouteOption waypoints: geometry_msgs/msg/Pose[] - res: - autoware_adapi_v1_msgs/srv/AcceptStart: - status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/ChangeOperationMode: - status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/ClearRoute: - status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/InitializeLocalization: - status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/SetRoute: - status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/SetRoutePoints: + res: status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_version_msgs/srv/InterfaceVersion: + autoware_adapi_version_msgs/srv/InterfaceVersion: + res: major: uint16 minor: uint16 patch: uint16 From b7cbfc8818109fe15de94ada0cc09b9daefc2255 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 17 May 2023 07:58:51 +0900 Subject: [PATCH 10/53] feat: generate type pages Signed-off-by: Takagi, Isamu --- tools/generate-autoware-interfaces.py | 43 ++++++++++++++++++--------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/tools/generate-autoware-interfaces.py b/tools/generate-autoware-interfaces.py index 3f29b09286d..9c4a4c0886f 100755 --- a/tools/generate-autoware-interfaces.py +++ b/tools/generate-autoware-interfaces.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import re import yaml from pathlib import Path @@ -8,6 +9,10 @@ from rosidl_adapter.parser import parse_service_file from ament_index_python.packages import get_package_share_directory +def camel_to_snake(text: str): + text = re.sub("([a-z])([A-Z])", r"\1_\2", text) + return text.lower() + def load_markdown_metadata(path: Path): lines = path.read_text().splitlines() @@ -30,6 +35,7 @@ def resolve_msg_file_path(name: str): pkg, ext, msg = name.split("/") return Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) + def normalize_msg_name(name: str): parts = str(name).split("/") return parts[0] if len(parts) == 1 else f"{parts[0]}/msg/{parts[1]}" @@ -87,20 +93,29 @@ def main(): data = {"types": specs} Path("yaml/autoware-interfaces.yaml").write_text(yaml.safe_dump(data)) - return - # Create pages of data types - type_uses = {name: set() for name in visited if is_documentation_msg(name)} - type_used = {name: set() for name in visited if is_documentation_msg(name)} - for key in ("msg", "req", "res"): - for name, fields in specs[key].items(): - for field in fields.values(): - field = strip_array_suffix(field) - if is_documentation_msg(field): - type_uses[name].add(field) - type_used[field].add(name) - for name in visited: - if is_documentation_msg(name): - generate_type_page(name, type_uses[name], type_used[name]) + type_uses = {name: set() for name in specs} + type_used = {name: set() for name in specs} + for user, spec in specs.items(): + for field in spec.values(): + for name in field.values(): + name = strip_array_suffix(name) + if is_documentation_msg(name): + type_uses[user].add(name) + type_used[name].add(user) + + base = Path("docs/design/autoware-interfaces/ad-api/types") + for name in specs: + uses = list(sorted(type_uses[name])) + used = list(sorted(type_used[name])) + data = {"uses": uses, "used": used} + data = {k: v for k, v in data.items() if v} + text = "---\n" + text += f"title: {name}\n" + text += yaml.safe_dump(data) + text += "---\n" + text += "aaa" + path = base.joinpath(camel_to_snake(name)).with_suffix(".md") + path.write_text(text) main() From e9994c5c2a7e1f362a6706585dce0765f84bad7b Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 17 May 2023 08:18:14 +0900 Subject: [PATCH 11/53] feat: type page template Signed-off-by: Takagi, Isamu --- .../templates/autoware-data-type.jinja2 | 28 ++++++++++ tools/generate-autoware-interfaces.py | 56 ++++++++----------- 2 files changed, 51 insertions(+), 33 deletions(-) create mode 100644 docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 diff --git a/docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 b/docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 new file mode 100644 index 00000000000..a1c6372c423 --- /dev/null +++ b/docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 @@ -0,0 +1,28 @@ +# {{ title }} + +## Definition + +```txt +{%- block definition %} +{%- endblock %} +``` + +## This type uses + +{%- if uses %} +{%- for name in uses %} +- {{ create_relative_link(name, 'design/autoware-interfaces/ad-api/types/' + name) }} +{%- endfor %} +{%- else %} +- None +{%- endif %} + +## This type is used by + +{%- if used %} +{%- for name in used %} +- {{ create_relative_link(name, 'design/autoware-interfaces/ad-api/types/' + name) }} +{%- endfor %} +{%- else %} +- None +{%- endif %} diff --git a/tools/generate-autoware-interfaces.py b/tools/generate-autoware-interfaces.py index 9c4a4c0886f..404d6a49a07 100755 --- a/tools/generate-autoware-interfaces.py +++ b/tools/generate-autoware-interfaces.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import re import yaml from pathlib import Path @@ -9,10 +8,6 @@ from rosidl_adapter.parser import parse_service_file from ament_index_python.packages import get_package_share_directory -def camel_to_snake(text: str): - text = re.sub("([a-z])([A-Z])", r"\1_\2", text) - return text.lower() - def load_markdown_metadata(path: Path): lines = path.read_text().splitlines() @@ -52,28 +47,19 @@ def parse_rosidl_spec(depends: set, visited: set, spec: MessageSpecification): def parse_rosidl_file(depends: set, visited: set, specs: dict, name: str): visited.add(name) - if not is_documentation_msg(name): - return - pkg, ext, msg = name.split("/") - path = Path(get_package_share_directory(pkg)).joinpath(ext, msg).with_suffix("." + ext) - if ext == "msg": - msg = parse_message_file(pkg, path) - msg = parse_rosidl_spec(depends, visited, msg) - specs[name] = {"msg": msg} - specs[name] = {k: v for k, v in specs[name].items() if v} - if ext == "srv": - srv = parse_service_file(pkg, path) - req = parse_rosidl_spec(depends, visited, srv.request) - res = parse_rosidl_spec(depends, visited, srv.response) - specs[name] = {"req": req, "res": res} - specs[name] = {k: v for k, v in specs[name].items() if v} - - -def generate_type_page(name: str, uses: set, used: set): - path = Path("docs/design/autoware-interfaces/ad-api/types").joinpath(name).with_suffix(".md") - print(path) - print(resolve_msg_file_path(name)) - + if is_documentation_msg(name): + pkg, ext, msg = name.split("/") + if ext == "msg": + msg = parse_message_file(pkg, resolve_msg_file_path(name)) + msg = parse_rosidl_spec(depends, visited, msg) + specs[name] = {"msg": msg} + specs[name] = {k: v for k, v in specs[name].items() if v} + if ext == "srv": + srv = parse_service_file(pkg, resolve_msg_file_path(name)) + req = parse_rosidl_spec(depends, visited, srv.request) + res = parse_rosidl_spec(depends, visited, srv.response) + specs[name] = {"req": req, "res": res} + specs[name] = {k: v for k, v in specs[name].items() if v} def main(): # Create a list of data types used in adapi. @@ -108,14 +94,18 @@ def main(): for name in specs: uses = list(sorted(type_uses[name])) used = list(sorted(type_used[name])) - data = {"uses": uses, "used": used} + data = {"title": name, "uses": uses, "used": used} data = {k: v for k, v in data.items() if v} text = "---\n" - text += f"title: {name}\n" - text += yaml.safe_dump(data) - text += "---\n" - text += "aaa" - path = base.joinpath(camel_to_snake(name)).with_suffix(".md") + text += "# This file is generated by tools/generate-autoware-interfaces.py\n" + text += yaml.safe_dump(data).strip() + "\n" + text += "---\n\n" + text += "{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}\n" + text += "{% block definition %}\n" + text += resolve_msg_file_path(name).read_text().strip() + "\n" + text += "{% endblock %}\n" + path = base.joinpath(name).with_suffix(".md") + path.parent.mkdir(parents=True, exist_ok=True) path.write_text(text) main() From d6ead53ccd1341fe10de176d3eeefafe1204ced2 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 17 May 2023 08:30:10 +0900 Subject: [PATCH 12/53] feat: update type pages Signed-off-by: Takagi, Isamu --- .../msg/LocalizationInitializationState.md | 19 ++++++++++ .../autoware_adapi_v1_msgs/msg/MotionState.md | 19 ++++++++++ .../msg/{mrm_state.md => MrmState.md} | 18 ++++------ ...on_mode_state.md => OperationModeState.md} | 18 ++++------ .../msg/ResponseStatus.md | 34 ++++++++++++++++++ .../types/autoware_adapi_v1_msgs/msg/Route.md | 16 +++++++++ .../autoware_adapi_v1_msgs/msg/RouteData.md | 19 ++++++++++ .../autoware_adapi_v1_msgs/msg/RouteOption.md | 16 +++++++++ .../msg/RoutePrimitive.md | 16 +++++++++ .../msg/RouteSegment.md | 19 ++++++++++ .../autoware_adapi_v1_msgs/msg/RouteState.md | 20 +++++++++++ .../{steering_factor.md => SteeringFactor.md} | 23 ++++++------ .../msg/SteeringFactorArray.md | 16 +++++++++ .../{velocity_factor.md => VelocityFactor.md} | 20 +++++------ .../msg/VelocityFactorArray.md | 16 +++++++++ .../msg/localization_initialization_state.md | 23 ------------ .../msg/motion_state.md | 23 ------------ .../msg/response_status.md | 36 ------------------- .../types/autoware_adapi_v1_msgs/msg/route.md | 18 ---------- .../autoware_adapi_v1_msgs/msg/route_data.md | 19 ---------- .../msg/route_primitive.md | 18 ---------- .../msg/route_segment.md | 19 ---------- .../autoware_adapi_v1_msgs/msg/route_state.md | 24 ------------- .../msg/steering_factor_array.md | 18 ---------- .../msg/velocity_factor_array.md | 18 ---------- .../autoware_adapi_v1_msgs/srv/AcceptStart.md | 17 +++++++++ .../srv/ChangeOperationMode.md | 18 ++++++++++ .../autoware_adapi_v1_msgs/srv/ClearRoute.md | 16 +++++++++ .../srv/InitializeLocalization.md | 21 +++++++++++ .../autoware_adapi_v1_msgs/srv/SetRoute.md | 27 ++++++++++++++ .../srv/SetRoutePoints.md | 26 ++++++++++++++ .../srv/accept_start.md | 19 ---------- .../srv/change_operation_mode.md | 20 ----------- .../autoware_adapi_v1_msgs/srv/clear_route.md | 18 ---------- .../srv/initialize_localization.md | 23 ------------ .../autoware_adapi_v1_msgs/srv/set_route.md | 25 ------------- .../srv/set_route_points.md | 24 ------------- .../srv/InterfaceVersion.md | 16 +++++++++ .../srv/interface_version.md | 20 ----------- .../templates/autoware-data-type.jinja2 | 2 -- tools/generate-autoware-interfaces.py | 2 ++ 41 files changed, 387 insertions(+), 412 deletions(-) create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/{mrm_state.md => MrmState.md} (56%) rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/{operation_mode_state.md => OperationModeState.md} (59%) create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/{steering_factor.md => SteeringFactor.md} (59%) create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/{velocity_factor.md => VelocityFactor.md} (69%) create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/localization_initialization_state.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/motion_state.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_data.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_primitive.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_segment.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_state.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/steering_factor_array.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/velocity_factor_array.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/accept_start.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/change_operation_mode.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/clear_route.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/initialize_localization.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route_points.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/interface_version.md diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md new file mode 100644 index 00000000000..cf84294225e --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md @@ -0,0 +1,19 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/LocalizationInitializationState +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +uint16 UNKNOWN = 0 +uint16 UNINITIALIZED = 1 +uint16 INITIALIZING = 2 +uint16 INITIALIZED = 3 + +builtin_interfaces/Time stamp +uint16 state +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md new file mode 100644 index 00000000000..54d4c4d6c42 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md @@ -0,0 +1,19 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/MotionState +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +uint16 UNKNOWN = 0 +uint16 STOPPED = 1 +uint16 STARTING = 2 +uint16 MOVING = 3 + +builtin_interfaces/Time stamp +uint16 state +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/mrm_state.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md similarity index 56% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/mrm_state.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md index 7322cc7f883..3f72bc29f44 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/mrm_state.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md @@ -1,8 +1,10 @@ - +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/MrmState +--- -# autoware_adapi_v1_msgs/msg/MrmState - -## Definition +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} ```txt builtin_interfaces/Time stamp @@ -25,10 +27,4 @@ uint16 state uint16 behavior ``` -## This type uses - -None - -## This type is used by - -None +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/operation_mode_state.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/OperationModeState.md similarity index 59% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/operation_mode_state.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/OperationModeState.md index 23405e2aea2..96326f4d634 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/operation_mode_state.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/OperationModeState.md @@ -1,8 +1,10 @@ - +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/OperationModeState +--- -# autoware_adapi_v1_msgs/msg/OperationModeState - -## Definition +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} ```txt # constants for mode @@ -23,10 +25,4 @@ bool is_local_mode_available bool is_remote_mode_available ``` -## This type uses - -None - -## This type is used by - -None +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md new file mode 100644 index 00000000000..9790a46d789 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md @@ -0,0 +1,34 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/ResponseStatus +used: + - autoware_adapi_v1_msgs/srv/AcceptStart + - autoware_adapi_v1_msgs/srv/ChangeOperationMode + - autoware_adapi_v1_msgs/srv/ClearRoute + - autoware_adapi_v1_msgs/srv/InitializeLocalization + - autoware_adapi_v1_msgs/srv/SetRoute + - autoware_adapi_v1_msgs/srv/SetRoutePoints +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +# error code +uint16 UNKNOWN = 50000 +uint16 SERVICE_UNREADY = 50001 +uint16 SERVICE_TIMEOUT = 50002 +uint16 TRANSFORM_ERROR = 50003 +uint16 PARAMETER_ERROR = 50004 + +# warning code +uint16 DEPRECATED = 60000 +uint16 NO_EFFECT = 60001 + +# variables +bool success +uint16 code +string message +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md new file mode 100644 index 00000000000..723b99abc4c --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md @@ -0,0 +1,16 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/Route +uses: + - autoware_adapi_v1_msgs/msg/RouteData +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +std_msgs/Header header +autoware_adapi_v1_msgs/RouteData[<=1] data +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md new file mode 100644 index 00000000000..3e99c609705 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md @@ -0,0 +1,19 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/RouteData +used: + - autoware_adapi_v1_msgs/msg/Route +uses: + - autoware_adapi_v1_msgs/msg/RouteSegment +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +geometry_msgs/Pose start +geometry_msgs/Pose goal +autoware_adapi_v1_msgs/RouteSegment[] segments +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md new file mode 100644 index 00000000000..e7ac4a7c339 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md @@ -0,0 +1,16 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/RouteOption +used: + - autoware_adapi_v1_msgs/srv/SetRoute + - autoware_adapi_v1_msgs/srv/SetRoutePoints +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +bool allow_goal_modification +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md new file mode 100644 index 00000000000..98c943621d7 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md @@ -0,0 +1,16 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/RoutePrimitive +used: + - autoware_adapi_v1_msgs/msg/RouteSegment +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +int64 id +string type # The same id may be used for each type. +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md new file mode 100644 index 00000000000..4691dbbb148 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md @@ -0,0 +1,19 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/RouteSegment +used: + - autoware_adapi_v1_msgs/msg/RouteData + - autoware_adapi_v1_msgs/srv/SetRoute +uses: + - autoware_adapi_v1_msgs/msg/RoutePrimitive +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +autoware_adapi_v1_msgs/RoutePrimitive preferred +autoware_adapi_v1_msgs/RoutePrimitive[] alternatives # Does not include the preferred primitive. +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md new file mode 100644 index 00000000000..689fc330213 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md @@ -0,0 +1,20 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/RouteState +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +uint16 UNKNOWN = 0 +uint16 UNSET = 1 +uint16 SET = 2 +uint16 ARRIVED = 3 +uint16 CHANGING = 4 + +builtin_interfaces/Time stamp +uint16 state +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/steering_factor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md similarity index 59% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/steering_factor.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md index 8c7a6f3d67c..5f9d92a0211 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/steering_factor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md @@ -1,8 +1,12 @@ - +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/SteeringFactor +used: + - autoware_adapi_v1_msgs/msg/SteeringFactorArray +--- -# autoware_adapi_v1_msgs/msg/SteeringFactor - -## Definition +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} ```txt # constants for common use @@ -15,7 +19,8 @@ uint16 AVOIDANCE_PATH_CHANGE = 3 uint16 AVOIDANCE_PATH_RETURN = 4 uint16 STATION = 5 uint16 PULL_OUT = 6 -uint16 PULL_OVER = 7 +uint16 PULL_OVER = 7 # Deprecated. Use GOAL_PLANNER. +uint16 GOAL_PLANNER = 7 uint16 EMERGENCY_OPERATION = 8 # constants for direction @@ -37,10 +42,4 @@ uint16 status string detail ``` -## This type uses - -None - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/SteeringFactorArray](../../autoware_adapi_v1_msgs/msg/steering_factor_array.md) +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md new file mode 100644 index 00000000000..944f1b47965 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md @@ -0,0 +1,16 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/SteeringFactorArray +uses: + - autoware_adapi_v1_msgs/msg/SteeringFactor +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +std_msgs/Header header +autoware_adapi_v1_msgs/SteeringFactor[] factors +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/velocity_factor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md similarity index 69% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/velocity_factor.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md index 4e2fd039ea9..4b258a35176 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/velocity_factor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md @@ -1,8 +1,12 @@ - +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/VelocityFactor +used: + - autoware_adapi_v1_msgs/msg/VelocityFactorArray +--- -# autoware_adapi_v1_msgs/msg/VelocityFactor - -## Definition +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} ```txt # constants for common use @@ -38,10 +42,4 @@ uint16 status string detail ``` -## This type uses - -None - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/VelocityFactorArray](../../autoware_adapi_v1_msgs/msg/velocity_factor_array.md) +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md new file mode 100644 index 00000000000..f5e76913e6d --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md @@ -0,0 +1,16 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/VelocityFactorArray +uses: + - autoware_adapi_v1_msgs/msg/VelocityFactor +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +std_msgs/Header header +autoware_adapi_v1_msgs/VelocityFactor[] factors +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/localization_initialization_state.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/localization_initialization_state.md deleted file mode 100644 index 5954ec26bd3..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/localization_initialization_state.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/LocalizationInitializationState - -## Definition - -```txt -uint16 UNKNOWN = 0 -uint16 UNINITIALIZED = 1 -uint16 INITIALIZING = 2 -uint16 INITIALIZED = 3 - -builtin_interfaces/Time stamp -uint16 state -``` - -## This type uses - -None - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/motion_state.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/motion_state.md deleted file mode 100644 index 091099499a8..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/motion_state.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/MotionState - -## Definition - -```txt -uint16 UNKNOWN = 0 -uint16 STOPPED = 1 -uint16 STARTING = 2 -uint16 MOVING = 3 - -builtin_interfaces/Time stamp -uint16 state -``` - -## This type uses - -None - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md deleted file mode 100644 index 625c19cc14a..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/response_status.md +++ /dev/null @@ -1,36 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/ResponseStatus - -## Definition - -```txt -# error code -uint16 UNKNOWN = 50000 -uint16 SERVICE_UNREADY = 50001 -uint16 SERVICE_TIMEOUT = 50002 -uint16 TRANSFORM_ERROR = 50003 -uint16 PARAMETER_ERROR = 50004 - -# warning code -uint16 DEPRECATED = 60000 -uint16 NO_EFFECT = 60001 - -# variables -bool success -uint16 code -string message -``` - -## This type uses - -None - -## This type is used by - -- [autoware_adapi_v1_msgs/srv/AcceptStart](../../autoware_adapi_v1_msgs/srv/accept_start.md) -- [autoware_adapi_v1_msgs/srv/ChangeOperationMode](../../autoware_adapi_v1_msgs/srv/change_operation_mode.md) -- [autoware_adapi_v1_msgs/srv/ClearRoute](../../autoware_adapi_v1_msgs/srv/clear_route.md) -- [autoware_adapi_v1_msgs/srv/InitializeLocalization](../../autoware_adapi_v1_msgs/srv/initialize_localization.md) -- [autoware_adapi_v1_msgs/srv/SetRoute](../../autoware_adapi_v1_msgs/srv/set_route.md) -- [autoware_adapi_v1_msgs/srv/SetRoutePoints](../../autoware_adapi_v1_msgs/srv/set_route_points.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route.md deleted file mode 100644 index 1d2cc6ef815..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/Route - -## Definition - -```txt -std_msgs/Header header -autoware_adapi_v1_msgs/RouteData[<=1] data -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/RouteData](../../autoware_adapi_v1_msgs/msg/route_data.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_data.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_data.md deleted file mode 100644 index 6a2f729b1c4..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_data.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/RouteData - -## Definition - -```txt -geometry_msgs/Pose start -geometry_msgs/Pose goal -autoware_adapi_v1_msgs/RouteSegment[] segments -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/RouteSegment](../../autoware_adapi_v1_msgs/msg/route_segment.md) - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/Route](../../autoware_adapi_v1_msgs/msg/route.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_primitive.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_primitive.md deleted file mode 100644 index 61ac8402b88..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_primitive.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/RoutePrimitive - -## Definition - -```txt -int64 id -string type # The same id may be used for each type. -``` - -## This type uses - -None - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/RouteSegment](../../autoware_adapi_v1_msgs/msg/route_segment.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_segment.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_segment.md deleted file mode 100644 index 7ae77e6b46d..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_segment.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/RouteSegment - -## Definition - -```txt -autoware_adapi_v1_msgs/RoutePrimitive preferred -autoware_adapi_v1_msgs/RoutePrimitive[] alternatives # Does not include the preferred primitive. -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/RoutePrimitive](../../autoware_adapi_v1_msgs/msg/route_primitive.md) - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/RouteData](../../autoware_adapi_v1_msgs/msg/route_data.md) -- [autoware_adapi_v1_msgs/srv/SetRoute](../../autoware_adapi_v1_msgs/srv/set_route.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_state.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_state.md deleted file mode 100644 index 86922126556..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/route_state.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/RouteState - -## Definition - -```txt -uint16 UNKNOWN = 0 -uint16 UNSET = 1 -uint16 SET = 2 -uint16 ARRIVED = 3 -uint16 CHANGING = 4 - -builtin_interfaces/Time stamp -uint16 state -``` - -## This type uses - -None - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/steering_factor_array.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/steering_factor_array.md deleted file mode 100644 index e7c357c43bf..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/steering_factor_array.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/SteeringFactorArray - -## Definition - -```txt -std_msgs/Header header -autoware_adapi_v1_msgs/SteeringFactor[] factors -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/SteeringFactor](../../autoware_adapi_v1_msgs/msg/steering_factor.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/velocity_factor_array.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/velocity_factor_array.md deleted file mode 100644 index e1924e103d5..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/velocity_factor_array.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/VelocityFactorArray - -## Definition - -```txt -std_msgs/Header header -autoware_adapi_v1_msgs/VelocityFactor[] factors -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/VelocityFactor](../../autoware_adapi_v1_msgs/msg/velocity_factor.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md new file mode 100644 index 00000000000..6a2af52bb9b --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md @@ -0,0 +1,17 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/srv/AcceptStart +uses: + - autoware_adapi_v1_msgs/msg/ResponseStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +--- +uint16 ERROR_NOT_STARTING = 1 +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md new file mode 100644 index 00000000000..de65c73f6be --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md @@ -0,0 +1,18 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/srv/ChangeOperationMode +uses: + - autoware_adapi_v1_msgs/msg/ResponseStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +--- +uint16 ERROR_NOT_AVAILABLE = 1 +uint16 ERROR_IN_TRANSITION = 2 +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md new file mode 100644 index 00000000000..c716ed85034 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md @@ -0,0 +1,16 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/srv/ClearRoute +uses: + - autoware_adapi_v1_msgs/msg/ResponseStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +--- +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md new file mode 100644 index 00000000000..e00b52783de --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md @@ -0,0 +1,21 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/srv/InitializeLocalization +uses: + - autoware_adapi_v1_msgs/msg/ResponseStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +geometry_msgs/PoseWithCovarianceStamped[<=1] pose +--- +uint16 ERROR_UNSAFE = 1 +uint16 ERROR_GNSS_SUPPORT = 2 +uint16 ERROR_GNSS = 3 +uint16 ERROR_ESTIMATION = 4 +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md new file mode 100644 index 00000000000..a5e6c2dcb2e --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md @@ -0,0 +1,27 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/srv/SetRoute +uses: + - autoware_adapi_v1_msgs/msg/ResponseStatus + - autoware_adapi_v1_msgs/msg/RouteOption + - autoware_adapi_v1_msgs/msg/RouteSegment +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +std_msgs/Header header +autoware_adapi_v1_msgs/RouteOption option +geometry_msgs/Pose goal +autoware_adapi_v1_msgs/RouteSegment[] segments +--- +uint16 ERROR_ROUTE_EXISTS = 1 # Deprecated. Use ERROR_INVALID_STATE. +uint16 ERROR_INVALID_STATE = 1 +uint16 ERROR_PLANNER_UNREADY = 2 +uint16 ERROR_PLANNER_FAILED = 3 +uint16 ERROR_REROUTE_FAILED = 4 +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md new file mode 100644 index 00000000000..af6a0b5ef02 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md @@ -0,0 +1,26 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/srv/SetRoutePoints +uses: + - autoware_adapi_v1_msgs/msg/ResponseStatus + - autoware_adapi_v1_msgs/msg/RouteOption +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +std_msgs/Header header +autoware_adapi_v1_msgs/RouteOption option +geometry_msgs/Pose goal +geometry_msgs/Pose[] waypoints +--- +uint16 ERROR_ROUTE_EXISTS = 1 # Deprecated. Use ERROR_INVALID_STATE. +uint16 ERROR_INVALID_STATE = 1 +uint16 ERROR_PLANNER_UNREADY = 2 +uint16 ERROR_PLANNER_FAILED = 3 +uint16 ERROR_REROUTE_FAILED = 4 +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/accept_start.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/accept_start.md deleted file mode 100644 index f8f1f683884..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/accept_start.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# autoware_adapi_v1_msgs/srv/AcceptStart - -## Definition - -```txt ---- -uint16 ERROR_NOT_STARTING = 1 -autoware_adapi_v1_msgs/ResponseStatus status -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/change_operation_mode.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/change_operation_mode.md deleted file mode 100644 index 274daae3dad..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/change_operation_mode.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# autoware_adapi_v1_msgs/srv/ChangeOperationMode - -## Definition - -```txt ---- -uint16 ERROR_NOT_AVAILABLE = 1 -uint16 ERROR_IN_TRANSITION = 2 -autoware_adapi_v1_msgs/ResponseStatus status -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/clear_route.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/clear_route.md deleted file mode 100644 index ac280e5f125..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/clear_route.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# autoware_adapi_v1_msgs/srv/ClearRoute - -## Definition - -```txt ---- -autoware_adapi_v1_msgs/ResponseStatus status -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/initialize_localization.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/initialize_localization.md deleted file mode 100644 index 272446ff6a1..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/initialize_localization.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# autoware_adapi_v1_msgs/srv/InitializeLocalization - -## Definition - -```txt -geometry_msgs/PoseWithCovarianceStamped[<=1] pose ---- -uint16 ERROR_UNSAFE = 1 -uint16 ERROR_GNSS_SUPPORT = 2 -uint16 ERROR_GNSS = 3 -uint16 ERROR_ESTIMATION = 4 -autoware_adapi_v1_msgs/ResponseStatus status -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route.md deleted file mode 100644 index 074dc375daf..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# autoware_adapi_v1_msgs/srv/SetRoute - -## Definition - -```txt -std_msgs/Header header -geometry_msgs/Pose goal -autoware_adapi_v1_msgs/RouteSegment[] segments ---- -uint16 ERROR_ROUTE_EXISTS = 1 -uint16 ERROR_PLANNER_UNREADY = 2 -uint16 ERROR_PLANNER_FAILED = 3 -autoware_adapi_v1_msgs/ResponseStatus status -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) -- [autoware_adapi_v1_msgs/msg/RouteSegment](../../autoware_adapi_v1_msgs/msg/route_segment.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route_points.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route_points.md deleted file mode 100644 index 9236ec8e02e..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_route_points.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# autoware_adapi_v1_msgs/srv/SetRoutePoints - -## Definition - -```txt -std_msgs/Header header -geometry_msgs/Pose goal -geometry_msgs/Pose[] waypoints ---- -uint16 ERROR_ROUTE_EXISTS = 1 -uint16 ERROR_PLANNER_UNREADY = 2 -uint16 ERROR_PLANNER_FAILED = 3 -autoware_adapi_v1_msgs/ResponseStatus status -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md new file mode 100644 index 00000000000..d1d605580ea --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md @@ -0,0 +1,16 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_version_msgs/srv/InterfaceVersion +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +--- +uint16 major +uint16 minor +uint16 patch +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/interface_version.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/interface_version.md deleted file mode 100644 index 54d5242c670..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/interface_version.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# autoware_adapi_version_msgs/srv/InterfaceVersion - -## Definition - -```txt ---- -uint16 major -uint16 minor -uint16 patch -``` - -## This type uses - -None - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 b/docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 index a1c6372c423..3acf494d8e1 100644 --- a/docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 +++ b/docs/design/autoware-interfaces/templates/autoware-data-type.jinja2 @@ -2,10 +2,8 @@ ## Definition -```txt {%- block definition %} {%- endblock %} -``` ## This type uses diff --git a/tools/generate-autoware-interfaces.py b/tools/generate-autoware-interfaces.py index 404d6a49a07..bf4d1ffa4bf 100755 --- a/tools/generate-autoware-interfaces.py +++ b/tools/generate-autoware-interfaces.py @@ -102,7 +102,9 @@ def main(): text += "---\n\n" text += "{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}\n" text += "{% block definition %}\n" + text += "\n```txt\n" text += resolve_msg_file_path(name).read_text().strip() + "\n" + text += "```\n\n" text += "{% endblock %}\n" path = base.joinpath(name).with_suffix(".md") path.parent.mkdir(parents=True, exist_ok=True) From 57626bafb864a43d8ed8cea27b03f72e84cc6b02 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 17 May 2023 08:34:18 +0900 Subject: [PATCH 13/53] feat: update comment Signed-off-by: Takagi, Isamu --- tools/generate-autoware-interfaces.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/generate-autoware-interfaces.py b/tools/generate-autoware-interfaces.py index bf4d1ffa4bf..21c6c4cf2b5 100755 --- a/tools/generate-autoware-interfaces.py +++ b/tools/generate-autoware-interfaces.py @@ -1,5 +1,21 @@ #!/usr/bin/env python3 +# Copyright 2023 The Autoware Contributors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script requires "source install/setup.bash" for dependent messages/services. + import yaml from pathlib import Path @@ -79,7 +95,7 @@ def main(): data = {"types": specs} Path("yaml/autoware-interfaces.yaml").write_text(yaml.safe_dump(data)) - # Create pages of data types + # Create data type dependencies. type_uses = {name: set() for name in specs} type_used = {name: set() for name in specs} for user, spec in specs.items(): @@ -90,6 +106,7 @@ def main(): type_uses[user].add(name) type_used[name].add(user) + # Generate data type pages. base = Path("docs/design/autoware-interfaces/ad-api/types") for name in specs: uses = list(sorted(type_uses[name])) From 0a53392471dbf5680ec914e78e177e70ad9647f6 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Thu, 18 May 2023 11:36:33 +0900 Subject: [PATCH 14/53] docs: add readme Signed-off-by: Takagi, Isamu --- tools/autoware-interfaces/README.md | 30 +++++++++++++++++++ .../generate.py} | 0 2 files changed, 30 insertions(+) create mode 100644 tools/autoware-interfaces/README.md rename tools/{generate-autoware-interfaces.py => autoware-interfaces/generate.py} (100%) diff --git a/tools/autoware-interfaces/README.md b/tools/autoware-interfaces/README.md new file mode 100644 index 00000000000..9c883ae53da --- /dev/null +++ b/tools/autoware-interfaces/README.md @@ -0,0 +1,30 @@ +# Document generation for autoware interfaces + +Some of the documents under the `docs/design/autoware-interfaces` are generated by scripts. +If you would like to update these documents, please follow the steps below. + +## Usage + +Create a workspace anywhere and source the dependent message packages. + +```bash +mkdir workspace +cd workspace +git clone https://github.com/autowarefoundation/autoware_adapi_msgs.git +colcon build +source install/setup.bash +``` + +Execute the script from the root of this repository. + +```bash +cd "repository root" +python3 tools/autoware-interfaces/generate.py +``` + +A document will be generated in the following paths. + +```txt +yaml/autoware-interfaces.yaml +docs/design/autoware-interfaces/ad-api/types/**/*.md +``` diff --git a/tools/generate-autoware-interfaces.py b/tools/autoware-interfaces/generate.py similarity index 100% rename from tools/generate-autoware-interfaces.py rename to tools/autoware-interfaces/generate.py From 11aa093693310e2f30ae05a1b954b8c31525ab9d Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Thu, 18 May 2023 18:18:14 +0900 Subject: [PATCH 15/53] feat: update diagram Signed-off-by: Takagi, Isamu --- .../cooperation/docs/architecture.drawio.svg | 196 +++++----- .../api/cooperation/docs/state.drawio.svg | 352 ++++-------------- .../ad-api/list/api/cooperation/index.md | 10 +- 3 files changed, 185 insertions(+), 373 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg index 02220e0626a..b0993c8457c 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg @@ -1,184 +1,205 @@ - + - + + + + + + + + -
-
+
+
- cooperation module + planning +
+ module
- - cooperation module + + planning... - - - + + + -
+
- planning -
- module + Final Decision
- - planning... + + Final Decision - - - - - + -
+
- Autoware Decision + Default Decision + +
+
- - Autoware Decision + + Default Decision - - - + + + + + -
+
- Operator Decision + Operator
- - Operator Decision + + Operator - - - + -
+
- Default Decision + status
- - Default Decision + + status - + -
+
- initial -
- value + set decision
- - initial... + + set decision - - - + -
+
- Final Decision + Scene State
- - Final Decision + + Scene State - - - - - + + + + + -
+
- Operator + Operator Decision
- - Operator + + Operator Decision - + + + -
+
- status + Planner Decision
- - status + + Planner Decision + + + + + + + +
+
+
+ refer +
+
+
+
+ + refer
- + -
+
set decision @@ -186,44 +207,49 @@
- + set decision - + -
-
+
+
- set default + + F + + + or each scene type +
- - set default + + For each scene type - - - + -
-
+
+
- Behavior State + + For each scene instance +
- - Behavior State + + For each scene instance @@ -232,7 +258,7 @@ - Viewer does not support full SVG 1.1 + Text is not SVG - cannot display diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg index 7298e405089..4a0eb1ba756 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg @@ -1,49 +1,28 @@ - + - + -
+
- Behavior State + Planner Decision
- - Behavior State + + Planner Decision - - - + -
-
-
- Autoware Decision -
-
-
-
- - Autoware Decision - -
-
- - - - - - -
+
Default Decision @@ -51,16 +30,16 @@
- + Default Decision - + -
+
Operator Decision @@ -68,206 +47,50 @@
- + Operator Decision - - - + + + + + + + + + + + + -
-
-
- WAITING -
-
-
-
- - WAITING - -
-
- - - - - - - - - -
-
-
- EXECUTING -
-
-
-
- - EXECUTING - -
-
- - - - - - - - -
-
-
- CANCELLING -
-
-
-
- - CANCELLING - -
-
- - - - -
-
-
- activate -
-
-
-
- - activate - -
-
- - - - -
-
-
- activate -
-
-
-
- - activate - -
-
- - - - -
-
-
- deactivate -
-
-
-
- - deactivate - -
-
- - - - -
-
-
- cancelled -
-
-
-
- - cancelled - -
-
- - - - - - - - - - - - - - - - -
-
-
- DEFAULT -
- DEACTIVATE -
-
-
-
- - DEFAULT... - -
-
- - - - - - - - -
+
DEFAULT -
- AUTONOMOUS
- - DEFAULT... + + DEFAULT - - - - - - - + + + + + + + -
+
DEACTIVATE @@ -275,16 +98,16 @@
- + DEACTIVATE - + -
+
AUTONOMOUS @@ -292,19 +115,19 @@
- + AUTONOMOUS - - - - + + + + -
+
ACTIVATE @@ -312,50 +135,16 @@
- + ACTIVATE - - - - -
-
-
- default deactivate -
-
-
-
- - default deactivate - -
-
- - - - -
-
-
- default autonomous -
-
-
-
- - default autonomous - -
-
- + -
+
ACTIVATE @@ -363,19 +152,19 @@
- + ACTIVATE - - - - + + + + -
+
DEACTIVATE @@ -383,16 +172,16 @@
- + DEACTIVATE - + -
+
AUTONOMOUS @@ -400,19 +189,19 @@
- + AUTONOMOUS - - - - + + + + -
+
DEACTIVATE @@ -420,28 +209,25 @@
- + DEACTIVATE - - + -
+
- final -
- decision + refer
- - final... + + refer @@ -450,7 +236,7 @@ - Viewer does not support full SVG 1.1 + Text is not SVG - cannot display diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md index 2549625c1d7..beb2789dcdd 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md @@ -1,8 +1,8 @@ # Cooperation API -- {{ link_ad_api('/api/cooperation/status') }} -- {{ link_ad_api('/api/cooperation/set_decisions') }} -- {{ link_ad_api('/api/cooperation/set_defaults') }} +- {{ link_ad_api('/api/planning/cooperation/set_decisions') }} +- {{ link_ad_api('/api/planning/cooperation/set_defaults') }} +- {{ link_ad_api('/api/planning/cooperation/get_defaults') }} ## Description @@ -17,9 +17,9 @@ Also, the operator can choose the default behavior when undecided. ## Decision states -There are three decision states, one behavior state, and a final decision event. +There are three decision state. -![cooperation-state](./docs/state.drawio.svg) +![state](./docs/state.drawio.svg) ## Decision events From b42a281da0e5a6d04770ae568e0add35ffbad0b0 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" <43976882+isamu-takagi@users.noreply.github.com> Date: Fri, 19 May 2023 06:43:40 +0900 Subject: [PATCH 16/53] Update tools/autoware-interfaces/README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: M. Fatih Cırıt --- tools/autoware-interfaces/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/autoware-interfaces/README.md b/tools/autoware-interfaces/README.md index 9c883ae53da..b7d8ffdb9e6 100644 --- a/tools/autoware-interfaces/README.md +++ b/tools/autoware-interfaces/README.md @@ -8,9 +8,10 @@ If you would like to update these documents, please follow the steps below. Create a workspace anywhere and source the dependent message packages. ```bash -mkdir workspace -cd workspace +mkdir -p workspace/src +cd workspace/src git clone https://github.com/autowarefoundation/autoware_adapi_msgs.git +cd .. colcon build source install/setup.bash ``` From aeb09dfaf98b2c1846b42faf5c8412789e668264 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 19 May 2023 09:31:46 +0900 Subject: [PATCH 17/53] feat: remove data type pages Signed-off-by: Takagi, Isamu --- .../msg/cooperation_decision.md | 27 -------------- .../msg/cooperation_request.md | 19 ---------- .../msg/cooperation_response.md | 18 ---------- .../msg/cooperation_status.md | 30 ---------------- .../msg/cooperation_status_array.md | 17 --------- .../msg/cooperation_target.md | 35 ------------------- .../srv/set_cooperation_decisions.md | 22 ------------ 7 files changed, 168 deletions(-) delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md deleted file mode 100644 index 054cf0ca9df..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_decision.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/CooperationDecision - -## Definition - -```txt -# constants -uint8 UNKNOWN = 0 -uint8 DEACTIVATE = 1 -uint8 ACTIVATE = 2 -uint8 AUTONOMOUS = 3 -uint8 DEFAULT_DEACTIVATE = 4 -uint8 DEFAULT_AUTONOMOUS = 5 - -# variables -uint8 decision -``` - -## This type uses - -None - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/CooperationRequest](../../autoware_adapi_v1_msgs/msg/cooperation_request.md) -- [autoware_adapi_v1_msgs/msg/CooperationStatus](../../autoware_adapi_v1_msgs/msg/cooperation_status.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md deleted file mode 100644 index 504e115cad2..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_request.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/CooperationRequest - -## Definition - -```txt -autoware_adapi_v1_msgs/CooperationTarget target -autoware_adapi_v1_msgs/CooperationDecision cooperator -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/CooperationDecision](../../autoware_adapi_v1_msgs/msg/cooperation_decision.md) -- [autoware_adapi_v1_msgs/msg/CooperationTarget](../../autoware_adapi_v1_msgs/msg/cooperation_target.md) - -## This type is used by - -- [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md deleted file mode 100644 index a643893d854..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_response.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/CooperationResponse - -## Definition - -```txt -autoware_adapi_v1_msgs/CooperationTarget target -bool success -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/CooperationTarget](../../autoware_adapi_v1_msgs/msg/cooperation_target.md) - -## This type is used by - -- [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md deleted file mode 100644 index d21586b5eb7..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status.md +++ /dev/null @@ -1,30 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/CooperationStatus - -## Definition - -```txt -# constants for direction -uint8 UNKNOWN = 0 -uint8 RIGHT = 1 -uint8 LEFT = 2 -uint8 STRAIGHT = 3 - -# variables -builtin_interfaces/Time stamp -autoware_adapi_v1_msgs/CooperationTarget target -autoware_adapi_v1_msgs/CooperationDecision autonomous -autoware_adapi_v1_msgs/CooperationDecision cooperator -uint8 direction -float32[2] distance -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/CooperationDecision](../../autoware_adapi_v1_msgs/msg/cooperation_decision.md) -- [autoware_adapi_v1_msgs/msg/CooperationTarget](../../autoware_adapi_v1_msgs/msg/cooperation_target.md) - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/CooperationStatusArray](../../autoware_adapi_v1_msgs/msg/cooperation_status_array.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md deleted file mode 100644 index ba263c77340..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/CooperationStatusArray - -## Definition - -```txt -autoware_adapi_v1_msgs/CooperationStatus[] statuses -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/CooperationStatus](../../autoware_adapi_v1_msgs/msg/cooperation_status.md) - -## This type is used by - -None diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md deleted file mode 100644 index 9a4a41cc764..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/cooperation_target.md +++ /dev/null @@ -1,35 +0,0 @@ - - -# autoware_adapi_v1_msgs/msg/CooperationTarget - -## Definition - -```txt -# constants -uint8 UNKNOWN = 0 -uint8 LANE_CHANGE = 1 -uint8 AVOIDANCE = 2 -uint8 PULL_OVER = 3 -uint8 PULL_OUT = 4 -uint8 TRAFFIC_SIGNAL = 5 -uint8 INTERSECTION = 6 -uint8 CROSSWALK = 7 -uint8 REAR_CHECK = 8 -uint8 DETECTION_AREA = 9 -uint8 NO_STOPPING_AREA = 10 -uint8 OCCLUSION_SPOT = 11 - -# variables -unique_identifier_msgs/UUID uuid -uint8 type -``` - -## This type uses - -None - -## This type is used by - -- [autoware_adapi_v1_msgs/msg/CooperationRequest](../../autoware_adapi_v1_msgs/msg/cooperation_request.md) -- [autoware_adapi_v1_msgs/msg/CooperationResponse](../../autoware_adapi_v1_msgs/msg/cooperation_response.md) -- [autoware_adapi_v1_msgs/msg/CooperationStatus](../../autoware_adapi_v1_msgs/msg/cooperation_status.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md deleted file mode 100644 index 5385d5499e7..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# autoware_adapi_v1_msgs/srv/SetCooperationDecisions - -## Definition - -```txt -autoware_adapi_v1_msgs/CooperationRequest[] requests ---- -autoware_adapi_v1_msgs/ResponseStatus status -autoware_adapi_v1_msgs/CooperationResponse[] responses -``` - -## This type uses - -- [autoware_adapi_v1_msgs/msg/CooperationRequest](../../autoware_adapi_v1_msgs/msg/cooperation_request.md) -- [autoware_adapi_v1_msgs/msg/CooperationResponse](../../autoware_adapi_v1_msgs/msg/cooperation_response.md) -- [autoware_adapi_v1_msgs/msg/ResponseStatus](../../autoware_adapi_v1_msgs/msg/response_status.md) - -## This type is used by - -None From 8b0169b69b7d6d52f53838105f424f47aec9cf46 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 09:55:29 +0900 Subject: [PATCH 18/53] feat: fix spell check Signed-off-by: Takagi, Isamu --- tools/autoware-interfaces/generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/autoware-interfaces/generate.py b/tools/autoware-interfaces/generate.py index 21c6c4cf2b5..9f037832e4f 100755 --- a/tools/autoware-interfaces/generate.py +++ b/tools/autoware-interfaces/generate.py @@ -80,8 +80,8 @@ def parse_rosidl_file(depends: set, visited: set, specs: dict, name: str): def main(): # Create a list of data types used in adapi. adapi = Path("docs/design/autoware-interfaces/ad-api/list/api") - yamls = (load_markdown_metadata(path) for path in adapi.glob("**/*.md")) - names = (yaml["type"]["name"] for yaml in yamls if yaml) + pages = (load_markdown_metadata(path) for path in adapi.glob("**/*.md")) + names = (yaml["type"]["name"] for yaml in pages if yaml) # Create a field list for each data type. visited = set() From 3dc12ee19b8ba3eab97dde374510aba5e11c4f85 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 12:21:36 +0900 Subject: [PATCH 19/53] feat: merge planning factor and cooperation Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/cooperation/index.md | 31 --- .../list/api/cooperation/set_decisions.md | 23 -- .../list/api/cooperation/set_defaults.md | 23 -- .../ad-api/list/api/cooperation/status.md | 21 -- .../docs/cooperation-architecture.drawio.svg} | 171 ++++++++------ .../docs/cooperation-state.drawio.svg} | 222 +++++++++++------- .../docs/steering-factors-2.drawio.svg | 29 +-- .../ad-api/list/api/planning/index.md | 64 ++--- 8 files changed, 268 insertions(+), 316 deletions(-) delete mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md delete mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md delete mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md delete mode 100644 docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md rename docs/design/autoware-interfaces/ad-api/list/api/{cooperation/docs/architecture.drawio.svg => planning/docs/cooperation-architecture.drawio.svg} (77%) rename docs/design/autoware-interfaces/ad-api/list/api/{cooperation/docs/state.drawio.svg => planning/docs/cooperation-state.drawio.svg} (54%) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md deleted file mode 100644 index beb2789dcdd..00000000000 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/index.md +++ /dev/null @@ -1,31 +0,0 @@ -# Cooperation API - -- {{ link_ad_api('/api/planning/cooperation/set_decisions') }} -- {{ link_ad_api('/api/planning/cooperation/set_defaults') }} -- {{ link_ad_api('/api/planning/cooperation/get_defaults') }} - -## Description - -This API manages cooperation between an operator and Autoware. - -The cooperation module receives a decision from the planning module and returns behavior to be performed. -This behavior is determined from the operator and Autoware decisions. -The operator receives the current status and makes decisions based on that. -Also, the operator can choose the default behavior when undecided. - -![cooperation-architecture](./docs/architecture.drawio.svg) - -## Decision states - -There are three decision state. - -![state](./docs/state.drawio.svg) - -## Decision events - -The final decision event is used for the behavior state transitions and is determined from the operator and Autoware state as follows. - -| | DEFAULT
DEACTIVATE | DEACTIVATE | ACTIVATE | AUTONOMOUS | DEFAULT
AUTONOMOUS | -| :--------: | :-------------------: | :--------: | :------: | :--------: | :-------------------: | -| DEACTIVATE | deactivate | deactivate | activate | deactivate | deactivate | -| ACTIVATE | deactivate | deactivate | activate | activate | activate | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md deleted file mode 100644 index 27be54c527c..00000000000 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_decisions.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# /api/cooperation/set_decisions - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../../types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) - -## Description - -T.B.D. - -## Request - -| Name | Type | Description | -| -------- | ----------------------------------------------- | ----------- | -| requests | autoware_adapi_v1_msgs/msg/CooperationRequest[] | T.B.D. | - -## Response - -| Name | Type | Description | -| --------- | ------------------------------------------------ | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | -| responses | autoware_adapi_v1_msgs/msg/CooperationResponse[] | T.B.D. | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md deleted file mode 100644 index 2d8d229b1ac..00000000000 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/set_defaults.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# /api/cooperation/set_defaults - -- Method: function call -- Type: [autoware_adapi_v1_msgs/srv/SetCooperationDecisions](../../../types/autoware_adapi_v1_msgs/srv/set_cooperation_decisions.md) - -## Description - -T.B.D. - -## Request - -| Name | Type | Description | -| -------- | ----------------------------------------------- | ----------- | -| requests | autoware_adapi_v1_msgs/msg/CooperationRequest[] | T.B.D. | - -## Response - -| Name | Type | Description | -| --------- | ------------------------------------------------ | --------------- | -| status | autoware_adapi_v1_msgs/msg/ResponseStatus | response status | -| responses | autoware_adapi_v1_msgs/msg/CooperationResponse[] | T.B.D. | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md b/docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md deleted file mode 100644 index a956cfd12ed..00000000000 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/status.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# /api/cooperation/status - -- Method: realtime stream -- Type: [autoware_adapi_v1_msgs/msg/CooperationStatusArray](../../../types/autoware_adapi_v1_msgs/msg/cooperation_status_array.md) - -## Description - -Get the cooperation status. - -## Message - -| Name | Type | Description | -| ------------------- | ---------------------------------------------- | ----------- | -| statuses.stamp | builtin_interfaces/msg/Time | T.B.D. | -| statuses.target | autoware_adapi_v1_msgs/msg/CooperationTarget | T.B.D. | -| statuses.autonomous | autoware_adapi_v1_msgs/msg/CooperationDecision | T.B.D. | -| statuses.cooperator | autoware_adapi_v1_msgs/msg/CooperationDecision | T.B.D. | -| statuses.direction | uint8 | T.B.D. | -| statuses.distance | float32[2] | T.B.D. | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-architecture.drawio.svg similarity index 77% rename from docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg rename to docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-architecture.drawio.svg index b0993c8457c..108c6e6aae7 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/architecture.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-architecture.drawio.svg @@ -1,18 +1,16 @@ - + - - - + - + -
+
planning @@ -22,7 +20,7 @@
- + planning... @@ -36,13 +34,13 @@
- Final Decision + merged decision
- Final Decision + merged decision @@ -53,7 +51,7 @@
- Default Decision + default decision
@@ -62,36 +60,36 @@
- Default Decision + default decision - - - + + + -
+
- Operator + operator
- - Operator + + operator - + -
+
status @@ -99,157 +97,176 @@
- + status - + + + + + -
+
- set decision + operator decision
- - set decision + + operator decision - + + + -
+
- Scene State + module decision
- - Scene State + + module decision - - - - - + -
+
- Operator Decision + refer
- - Operator Decision + + refer - - - + -
-
+
+
- Planner Decision + + for each module type +
- - Planner Decision + + for each module type - + -
+
+
+
+ + for each + + module instance +
+
+
+ + + for each module instance + + + + + + + + + +
- refer + system +
+ settings
- - refer + + system...
- + -
+
- set decision + init
- - set decision + + init - + -
-
+
+
- - F - - - or each scene type - + set decision
- - For each scene type + + set decision - + -
-
+
+
- - For each scene instance - + set decision
- - For each scene instance + + set decision diff --git a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-state.drawio.svg similarity index 54% rename from docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg rename to docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-state.drawio.svg index 4a0eb1ba756..3fbebc39612 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/cooperation/docs/state.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-state.drawio.svg @@ -1,224 +1,276 @@ - + - + -
+
- Planner Decision + operator decision
- - Planner Decision + + operator decision - + -
+
- Default Decision + decided
- - Default Decision + + decided - + -
+
- Operator Decision + module decision
- - Operator Decision + + module decision + + + + + + + +
+
+
+ default decision +
+
+
+
+ + default decision + +
+
+ + + + + + + + + + + +
+
+
+ undecided +
+
+
+
+ + undecided
- - - - - - - - - - - - + + + + + + -
+
- DEFAULT + deactivate
- - DEFAULT + + deactivate - - - - - - - + + + -
+
- DEACTIVATE + autonomous
- - DEACTIVATE + + autonomous - + + + + -
+
- AUTONOMOUS + activate
- - AUTONOMOUS + + activate - - - - + + + + -
+
- ACTIVATE + deactivate
- - ACTIVATE + + deactivate - + + + -
+
- ACTIVATE + autonomous
- - ACTIVATE + + autonomous - - - - + + + + -
+
- DEACTIVATE + deactivate
- - DEACTIVATE + + deactivate - + -
+
- AUTONOMOUS + refer
- - AUTONOMOUS + + refer - - - - + + + -
+
- DEACTIVATE + activate
- - DEACTIVATE + + activate + + + + + + + +
+
+
+ refer +
+
+
+
+ + refer
- + -
+
refer @@ -226,7 +278,7 @@
- + refer diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg index b2f15b2ff99..3125a39f31f 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg @@ -1,4 +1,4 @@ - + @@ -31,25 +31,6 @@ - - - - - - -
-
-
- TRYING -
-
-
-
- - TRYING - -
-
@@ -58,11 +39,11 @@ - + -
+
TURNING @@ -70,7 +51,7 @@
- + TURNING @@ -148,7 +129,7 @@ - Viewer does not support full SVG 1.1 + Text is not SVG - cannot display diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md index fc7632cbb63..cd6a610e2d4 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md @@ -2,45 +2,30 @@ - {{ link_ad_api('/api/planning/velocity_factors') }} - {{ link_ad_api('/api/planning/steering_factors') }} +- {{ link_ad_api('/api/planning/cooperation/set_decisions') }} +- {{ link_ad_api('/api/planning/cooperation/set_defaults') }} +- {{ link_ad_api('/api/planning/cooperation/get_defaults') }} ## Description This API manages the planned behavior of the vehicle. Applications can notify the vehicle behavior to the people around and visualize it for operator and passengers. +Also provides status and commands for modules that cooperation with operators. ## Velocity factors -The velocity factors is an array of information on the behavior that the vehicle stops (or slows down). -Each factor has a type shown below, pose in the base link, distance, status, and detailed data depending on its type. +The velocity factors is an array of information on the behavior that the vehicle stops or slows down. +Each factor has a module name, pose in the base link, distance, status, and detailed data depending on its type. As the vehicle approaches the stop position, this factor appears with a status of APPROACHING. And when the vehicle reaches that position and stops, the status will be STOPPED. The pose indicates the stop position or the base link if the stop position cannot be calculated. ![velocity-factors](./docs/velocity-factors.drawio.svg) -| Factor Type | Description | -| --------------------------- | ------------------------------------------------------------------------ | -| SURROUNDING_OBSTACLE | There are obstacles immediately around the vehicle. | -| ROUTE_OBSTACLE | There are obstacles along the route ahead. | -| INTERSECTION | There are obstacles in other lanes in the path. | -| CROSSWALK | There are obstacles on the crosswalk. | -| REAR_CHECK | There are obstacles behind that would be in a human driver's blind spot. | -| USER_DEFINED_DETECTION_AREA | There are obstacles in the predefined detection area. | -| NO_STOPPING_AREA | There is not enough space beyond the no stopping area. | -| STOP_SIGN | A stop by a stop sign. | -| TRAFFIC_SIGNAL | A stop by a traffic signal. | -| V2I_GATE_CONTROL_ENTER | A stop by a V2I gate entering. | -| V2I_GATE_CONTROL_LEAVE | A stop by a V2I gate leaving. | -| MERGE | A stop before merging lanes. | -| SIDEWALK | A stop before crossing the sidewalk. | -| LANE_CHANGE | A lane change. | -| AVOIDANCE | A path change to avoid an obstacle in the current lane. | -| EMERGENCY_OPERATION | A stop by emergency instruction from the operator. | - ## Steering factors The steering factors is an array of information on the maneuver that requires use of turn indicators, such as turning left or right. -Each factor has a type shown below, pose in the base link, distance, status, and detailed data depending on its type. +Each factor has a module name, poses in the base link, distances, status, and detailed data depending on its type. As the vehicle approaches the position to start steering, this factor appears with a status of APPROACHING. And when the vehicle reaches that position, the status will be TURNING. The pose indicates the start position when APPROACHING and the end position when TURNING. @@ -56,13 +41,28 @@ The position to end steering (C to D) for TURNING depends on the position to sta ![steering-factors-2](./docs/steering-factors-2.drawio.svg) -| Factor Type | Description | -| --------------------- | ------------------------------------------------------------------------ | -| INTERSECTION | A turning left or right at an intersection. | -| LANE_CHANGE | A lane change. | -| AVOIDANCE_PATH_CHANGE | A path change to avoid an obstacle in the current lane. | -| AVOIDANCE_PATH_RETURN | A path change to return to the original lane after avoiding an obstacle. | -| STATION | T.B.D. (bus stop) | -| PULL_OUT | T.B.D. | -| PULL_OVER | T.B.D. | -| EMERGENCY_OPERATION | A path change by emergency instruction from the operator. | +## Cooperation + +Some planning modules can receive the operator's decision and reflect it in their behavior. +These modules have their own decisions, but use the the merged decision of theirs and operator's. +The operator can check the module's decision and override the decision if necessary. + +![cooperation-architecture](./docs/cooperation-architecture.drawio.svg) + +The modules that support cooperation have their own decisions that is either deactivate or activate. +Its meaning depends on the module and is shown in the table below. +The merged decision will also be either of these, and the module will decide the behavior using it. + +| Module Group | Module Type | Deactivate | Activate | +| ------------ | ----------- | ------------- | --------------- | +| velocity | slow down | slow down | pass | +| velocity | stop | stop | pass | +| steering | path change | keep the path | change the path | + +The operator's decision is either deactivate, activate, autonomous, or undecided. +If the operator selects deactivate or activate, the module's decision is ignored and the operator's is used instead. +If the operator selects autonomous, the module's decision is used. +The undecided is the initial state of the operator's decision and is replaced with the system default when merging. +The operator can also override the default decision to use when undecided. + +![cooperation-state](./docs/cooperation-state.drawio.svg) From fe931c86d64fd6709c14c60af1bd7e17d2d3f16b Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 13:41:26 +0900 Subject: [PATCH 20/53] feat: update description Signed-off-by: Takagi, Isamu --- .../docs/steering-factors-1.drawio.svg | 4 +- .../docs/steering-factors-2.drawio.svg | 73 +------------------ .../ad-api/list/api/planning/index.md | 8 +- 3 files changed, 6 insertions(+), 79 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-1.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-1.drawio.svg index a47339dbf64..b5c1d2eb3f3 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-1.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-1.drawio.svg @@ -1,4 +1,4 @@ - + @@ -60,7 +60,7 @@ - Viewer does not support full SVG 1.1 + Text is not SVG - cannot display diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg index 3125a39f31f..74511043061 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/steering-factors-2.drawio.svg @@ -1,4 +1,4 @@ - + @@ -7,8 +7,7 @@ - - + @@ -56,74 +55,6 @@ - - - - -
-
-
- A -
-
-
-
- - A - -
-
- - - - -
-
-
- B -
-
-
-
- - B - -
-
- - - - -
-
-
- C -
-
-
-
- - C - -
-
- - - - -
-
-
- D -
-
-
-
- - D - -
-
diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md index cd6a610e2d4..9fc201ffdba 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md @@ -28,16 +28,12 @@ The steering factors is an array of information on the maneuver that requires us Each factor has a module name, poses in the base link, distances, status, and detailed data depending on its type. As the vehicle approaches the position to start steering, this factor appears with a status of APPROACHING. And when the vehicle reaches that position, the status will be TURNING. -The pose indicates the start position when APPROACHING and the end position when TURNING. +The poses indicate the start and end position of the section where the status is TURNING. ![steering-factors-1](./docs/steering-factors-1.drawio.svg) In cases such as lane change and avoidance, the vehicle will start steering at any position in the range depending on the situation. -As the vehicle approaches the start position of the range, this factor appears with a status of APPROACHING. -And when the vehicle reaches that position, the status will be TRYING. -Then, when it is possible, the vehicle will start steering and the status will be TURNING. -The pose indicates the start of the range (A) when APPROACHING and the end of the range (B) when TRYING. -The position to end steering (C to D) for TURNING depends on the position to start steering. +For these types, the section where the status is TURNING will be updated dynamically and the poses will follow that. ![steering-factors-2](./docs/steering-factors-2.drawio.svg) From 462072fab4c8e6de495a27cc30b49a5cedacbfb0 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 14:16:03 +0900 Subject: [PATCH 21/53] feat: add types Signed-off-by: Takagi, Isamu --- .../msg/CooperationDecision.md | 23 ++++++++++++ .../msg/CooperationStatus.md | 21 +++++++++++ .../msg/SteeringFactor.md | 36 ++++++++++++------- .../msg/VelocityFactor.md | 28 +++++++++------ yaml/autoware-interfaces.yaml | 13 +++++++ 5 files changed, 98 insertions(+), 23 deletions(-) create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md new file mode 100644 index 00000000000..15c94a92b1a --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md @@ -0,0 +1,23 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/CooperationDecision +used: + - autoware_adapi_v1_msgs/msg/CooperationStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +# constants +uint8 UNKNOWN = 0 +uint8 DEACTIVATE = 1 +uint8 ACTIVATE = 2 +uint8 AUTONOMOUS = 3 +uint8 UNDECIDED = 4 + +# variables +uint8 decision +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md new file mode 100644 index 00000000000..dfe3d615a60 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md @@ -0,0 +1,21 @@ +--- +# This file is generated by tools/generate-autoware-interfaces.py +title: autoware_adapi_v1_msgs/msg/CooperationStatus +used: + - autoware_adapi_v1_msgs/msg/SteeringFactor + - autoware_adapi_v1_msgs/msg/VelocityFactor +uses: + - autoware_adapi_v1_msgs/msg/CooperationDecision +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +unique_identifier_msgs/UUID uuid +autoware_adapi_v1_msgs/CooperationDecision autonomous +autoware_adapi_v1_msgs/CooperationDecision cooperator +bool cancellable +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md index 5f9d92a0211..46918874ecf 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md @@ -3,6 +3,8 @@ title: autoware_adapi_v1_msgs/msg/SteeringFactor used: - autoware_adapi_v1_msgs/msg/SteeringFactorArray +uses: + - autoware_adapi_v1_msgs/msg/CooperationStatus --- {% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} @@ -12,17 +14,6 @@ used: # constants for common use uint16 UNKNOWN = 0 -# constants for type -uint16 INTERSECTION = 1 -uint16 LANE_CHANGE = 2 -uint16 AVOIDANCE_PATH_CHANGE = 3 -uint16 AVOIDANCE_PATH_RETURN = 4 -uint16 STATION = 5 -uint16 PULL_OUT = 6 -uint16 PULL_OVER = 7 # Deprecated. Use GOAL_PLANNER. -uint16 GOAL_PLANNER = 7 -uint16 EMERGENCY_OPERATION = 8 - # constants for direction uint16 LEFT = 1 uint16 RIGHT = 2 @@ -30,16 +21,35 @@ uint16 STRAIGHT = 3 # constants for status uint16 APPROACHING = 1 -uint16 TRYING = 2 uint16 TURNING = 3 # variables geometry_msgs/Pose[2] pose float32[2] distance -uint16 type uint16 direction uint16 status +string module string detail +autoware_adapi_v1_msgs/CooperationStatus[<=1] cooperation + + + +# deprecated constants for type +uint16 INTERSECTION = 1 +uint16 LANE_CHANGE = 2 +uint16 AVOIDANCE_PATH_CHANGE = 3 +uint16 AVOIDANCE_PATH_RETURN = 4 +uint16 STATION = 5 +uint16 PULL_OUT = 6 +uint16 PULL_OVER = 7 # Deprecated. Use GOAL_PLANNER. +uint16 GOAL_PLANNER = 7 +uint16 EMERGENCY_OPERATION = 8 + +# deprecated constants for status +uint16 TRYING = 2 + +# deprecated variables +uint16 type ``` {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md index 4b258a35176..4db43fdce19 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md @@ -3,6 +3,8 @@ title: autoware_adapi_v1_msgs/msg/VelocityFactor used: - autoware_adapi_v1_msgs/msg/VelocityFactorArray +uses: + - autoware_adapi_v1_msgs/msg/CooperationStatus --- {% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} @@ -12,7 +14,21 @@ used: # constants for common use uint16 UNKNOWN = 0 -# constants for type +# constants for status +uint16 APPROACHING = 1 +uint16 STOPPED = 2 + +# variables +geometry_msgs/Pose pose +float32 distance +uint16 status +string module +string detail +autoware_adapi_v1_msgs/CooperationStatus[<=1] cooperation + + + +# deprecated constants for type uint16 SURROUNDING_OBSTACLE = 1 uint16 ROUTE_OBSTACLE = 2 uint16 INTERSECTION = 3 @@ -30,16 +46,8 @@ uint16 LANE_CHANGE = 14 uint16 AVOIDANCE = 15 uint16 EMERGENCY_STOP_OPERATION = 16 -# constants for status -uint16 APPROACHING = 1 -uint16 STOPPED = 2 - -# variables -geometry_msgs/Pose pose -float32 distance +# deprecated variables uint16 type -uint16 status -string detail ``` {% endblock %} diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index b766dac0e00..fa6e3cb1ad4 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -1,4 +1,13 @@ types: + autoware_adapi_v1_msgs/msg/CooperationDecision: + msg: + decision: uint8 + autoware_adapi_v1_msgs/msg/CooperationStatus: + msg: + autonomous: autoware_adapi_v1_msgs/msg/CooperationDecision + cancellable: bool + cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision + uuid: unique_identifier_msgs/msg/UUID autoware_adapi_v1_msgs/msg/LocalizationInitializationState: msg: stamp: builtin_interfaces/msg/Time @@ -53,9 +62,11 @@ types: state: uint16 autoware_adapi_v1_msgs/msg/SteeringFactor: msg: + cooperation: autoware_adapi_v1_msgs/msg/CooperationStatus[<=1] detail: string direction: uint16 distance: float32[2] + module: string pose: geometry_msgs/msg/Pose[2] status: uint16 type: uint16 @@ -65,8 +76,10 @@ types: header: std_msgs/msg/Header autoware_adapi_v1_msgs/msg/VelocityFactor: msg: + cooperation: autoware_adapi_v1_msgs/msg/CooperationStatus[<=1] detail: string distance: float32 + module: string pose: geometry_msgs/msg/Pose status: uint16 type: uint16 From 311a4964b462e66e85fdb77b2a2caf22768fe1b8 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 14:17:46 +0900 Subject: [PATCH 22/53] feat: fix tool comment Signed-off-by: Takagi, Isamu --- .../msg/LocalizationInitializationState.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md | 2 +- .../types/autoware_adapi_v1_msgs/msg/OperationModeState.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/Route.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md | 2 +- .../types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md | 2 +- .../types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md | 2 +- .../types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md | 2 +- .../types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md | 2 +- .../ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md | 2 +- .../types/autoware_adapi_version_msgs/srv/InterfaceVersion.md | 2 +- tools/autoware-interfaces/generate.py | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md index cf84294225e..504b192dea9 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/LocalizationInitializationState --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md index 54d4c4d6c42..05a9f4f18cd 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MotionState.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/MotionState --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md index 3f72bc29f44..992090f6cfb 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/MrmState.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/MrmState --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/OperationModeState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/OperationModeState.md index 96326f4d634..ea56c87c38b 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/OperationModeState.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/OperationModeState.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/OperationModeState --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md index 9790a46d789..e6c7189c9e0 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/ResponseStatus used: - autoware_adapi_v1_msgs/srv/AcceptStart diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md index 723b99abc4c..f4455b42ccf 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/Route.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/Route uses: - autoware_adapi_v1_msgs/msg/RouteData diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md index 3e99c609705..1e27e8aa4da 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteData.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/RouteData used: - autoware_adapi_v1_msgs/msg/Route diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md index e7ac4a7c339..25deed8faf8 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteOption.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/RouteOption used: - autoware_adapi_v1_msgs/srv/SetRoute diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md index 98c943621d7..cc3b5bae5b0 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RoutePrimitive.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/RoutePrimitive used: - autoware_adapi_v1_msgs/msg/RouteSegment diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md index 4691dbbb148..c4171c24b87 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteSegment.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/RouteSegment used: - autoware_adapi_v1_msgs/msg/RouteData diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md index 689fc330213..d4985ebe361 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/RouteState.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/RouteState --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md index 5f9d92a0211..066285646d6 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/SteeringFactor used: - autoware_adapi_v1_msgs/msg/SteeringFactorArray diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md index 944f1b47965..ceafe541958 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactorArray.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/SteeringFactorArray uses: - autoware_adapi_v1_msgs/msg/SteeringFactor diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md index 4b258a35176..7cc277d2791 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/VelocityFactor used: - autoware_adapi_v1_msgs/msg/VelocityFactorArray diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md index f5e76913e6d..da90bfa1280 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactorArray.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/VelocityFactorArray uses: - autoware_adapi_v1_msgs/msg/VelocityFactor diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md index 6a2af52bb9b..e80d4e780f5 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/AcceptStart.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/AcceptStart uses: - autoware_adapi_v1_msgs/msg/ResponseStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md index de65c73f6be..e16cbda7eec 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ChangeOperationMode.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/ChangeOperationMode uses: - autoware_adapi_v1_msgs/msg/ResponseStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md index c716ed85034..e7d10672b0d 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/ClearRoute.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/ClearRoute uses: - autoware_adapi_v1_msgs/msg/ResponseStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md index e00b52783de..a43875336bd 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/InitializeLocalization.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/InitializeLocalization uses: - autoware_adapi_v1_msgs/msg/ResponseStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md index a5e6c2dcb2e..8a61fa7a7ee 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoute.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/SetRoute uses: - autoware_adapi_v1_msgs/msg/ResponseStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md index af6a0b5ef02..e73b86b62f4 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetRoutePoints.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/SetRoutePoints uses: - autoware_adapi_v1_msgs/msg/ResponseStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md index d1d605580ea..7caf613d6ed 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_version_msgs/srv/InterfaceVersion.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_version_msgs/srv/InterfaceVersion --- diff --git a/tools/autoware-interfaces/generate.py b/tools/autoware-interfaces/generate.py index 9f037832e4f..cd809c1c416 100755 --- a/tools/autoware-interfaces/generate.py +++ b/tools/autoware-interfaces/generate.py @@ -114,7 +114,7 @@ def main(): data = {"title": name, "uses": uses, "used": used} data = {k: v for k, v in data.items() if v} text = "---\n" - text += "# This file is generated by tools/generate-autoware-interfaces.py\n" + text += "# This file is generated by tools/autoware-interfaces/generate.py\n" text += yaml.safe_dump(data).strip() + "\n" text += "---\n\n" text += "{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}\n" From 093d04549ca49bdfec91ba18d20140232fe753fa Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 14:19:48 +0900 Subject: [PATCH 23/53] feat: fix tool comment Signed-off-by: Takagi, Isamu --- .../types/autoware_adapi_v1_msgs/msg/CooperationDecision.md | 2 +- .../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md index 15c94a92b1a..209612be9ca 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/CooperationDecision used: - autoware_adapi_v1_msgs/msg/CooperationStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md index dfe3d615a60..eee513f2c67 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationStatus.md @@ -1,5 +1,5 @@ --- -# This file is generated by tools/generate-autoware-interfaces.py +# This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/CooperationStatus used: - autoware_adapi_v1_msgs/msg/SteeringFactor From ecfd401a04e8bbf4ca191b7b8049593caaa4dfa7 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 14:21:47 +0900 Subject: [PATCH 24/53] feat: remove unused link Signed-off-by: Takagi, Isamu --- docs/design/autoware-interfaces/ad-api/list/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/index.md b/docs/design/autoware-interfaces/ad-api/list/index.md index ad4a2ef8003..65ee7e0efd7 100644 --- a/docs/design/autoware-interfaces/ad-api/list/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/index.md @@ -7,4 +7,3 @@ - [Motion](./api/motion/index.md) - [Planning](./api/planning/index.md) - [Fail-safe](./api/fail_safe/index.md) -- [Cooperation](./api/cooperation/index.md) From 7aa2aee1934249e4189ef7348fc146a964be735f Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 14:57:03 +0900 Subject: [PATCH 25/53] feat: add cooperatoin default Signed-off-by: Takagi, Isamu --- .../api/planning/cooperation/get_default.md | 19 +++++++++++++++++ .../api/planning/cooperation/set_decisions.md | 19 +++++++++++++++++ .../api/planning/cooperation/set_default.md | 19 +++++++++++++++++ .../ad-api/list/api/planning/index.md | 4 ++-- .../msg/CooperationCommand.md | 18 ++++++++++++++++ .../msg/CooperationDecision.md | 3 +++ .../msg/ResponseStatus.md | 3 +++ .../srv/GetCooperationDefault.md | 19 +++++++++++++++++ .../srv/SetCooperationDecisions.md | 18 ++++++++++++++++ .../srv/SetCooperationDefault.md | 19 +++++++++++++++++ main.py | 1 + yaml/autoware-interfaces.yaml | 21 +++++++++++++++++++ 12 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDecisions.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md new file mode 100644 index 00000000000..c3c8ceb2fbc --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md @@ -0,0 +1,19 @@ +--- +title: /api/planning/cooperation/get_default +method: function call +type: + name: autoware_adapi_v1_msgs/srv/GetCooperationDefault + req: + - name: module + text: The name of the target module. + res: + - name: status + text: response status + - name: cooperator + text: The default decision of the target module. +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} +Set the default decision for cooperation. For details, see the [cooperation](../index.md#cooperation). +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md new file mode 100644 index 00000000000..faa2b96044b --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md @@ -0,0 +1,19 @@ +--- +title: /api/planning/cooperation/set_decisions +method: function call +type: + name: autoware_adapi_v1_msgs/srv/SetCooperationDecisions + req: + - name: commands.uuid + text: The ID in the cooperation status. + - name: commands.cooperator + text: The operator's decision. + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} +Set the operator's decision for cooperation. For details, see the [cooperation](../index.md#cooperation). +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md new file mode 100644 index 00000000000..7992e330662 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md @@ -0,0 +1,19 @@ +--- +title: /api/planning/cooperation/set_default +method: function call +type: + name: autoware_adapi_v1_msgs/srv/SetCooperationDefault + req: + - name: module + text: The name of the target module. + - name: cooperator + text: The default decision of the target module. + res: + - name: status + text: response status +--- + +{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} +{% block description %} +Set the default decision for cooperation. For details, see the [cooperation](../index.md#cooperation). +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md index 9fc201ffdba..eed88daa611 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md @@ -3,8 +3,8 @@ - {{ link_ad_api('/api/planning/velocity_factors') }} - {{ link_ad_api('/api/planning/steering_factors') }} - {{ link_ad_api('/api/planning/cooperation/set_decisions') }} -- {{ link_ad_api('/api/planning/cooperation/set_defaults') }} -- {{ link_ad_api('/api/planning/cooperation/get_defaults') }} +- {{ link_ad_api('/api/planning/cooperation/set_default') }} +- {{ link_ad_api('/api/planning/cooperation/get_default') }} ## Description diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md new file mode 100644 index 00000000000..386298af99e --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md @@ -0,0 +1,18 @@ +--- +# This file is generated by tools/autoware-interfaces/generate.py +title: autoware_adapi_v1_msgs/msg/CooperationCommand +used: + - autoware_adapi_v1_msgs/srv/SetCooperationDecisions +uses: + - autoware_adapi_v1_msgs/msg/CooperationDecision +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +unique_identifier_msgs/UUID uuid +autoware_adapi_v1_msgs/CooperationDecision cooperator +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md index 209612be9ca..924e438f295 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md @@ -2,7 +2,10 @@ # This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/CooperationDecision used: + - autoware_adapi_v1_msgs/msg/CooperationCommand - autoware_adapi_v1_msgs/msg/CooperationStatus + - autoware_adapi_v1_msgs/srv/GetCooperationDefault + - autoware_adapi_v1_msgs/srv/SetCooperationDefault --- {% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md index e6c7189c9e0..297cb0524a2 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md @@ -5,7 +5,10 @@ used: - autoware_adapi_v1_msgs/srv/AcceptStart - autoware_adapi_v1_msgs/srv/ChangeOperationMode - autoware_adapi_v1_msgs/srv/ClearRoute + - autoware_adapi_v1_msgs/srv/GetCooperationDefault - autoware_adapi_v1_msgs/srv/InitializeLocalization + - autoware_adapi_v1_msgs/srv/SetCooperationDecisions + - autoware_adapi_v1_msgs/srv/SetCooperationDefault - autoware_adapi_v1_msgs/srv/SetRoute - autoware_adapi_v1_msgs/srv/SetRoutePoints --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md new file mode 100644 index 00000000000..c8e10e5f928 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md @@ -0,0 +1,19 @@ +--- +# This file is generated by tools/autoware-interfaces/generate.py +title: autoware_adapi_v1_msgs/srv/GetCooperationDefault +uses: + - autoware_adapi_v1_msgs/msg/CooperationDecision + - autoware_adapi_v1_msgs/msg/ResponseStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +string module +--- +autoware_adapi_v1_msgs/ResponseStatus status +autoware_adapi_v1_msgs/CooperationDecision cooperator +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDecisions.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDecisions.md new file mode 100644 index 00000000000..6551d63d0a5 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDecisions.md @@ -0,0 +1,18 @@ +--- +# This file is generated by tools/autoware-interfaces/generate.py +title: autoware_adapi_v1_msgs/srv/SetCooperationDecisions +uses: + - autoware_adapi_v1_msgs/msg/CooperationCommand + - autoware_adapi_v1_msgs/msg/ResponseStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +autoware_adapi_v1_msgs/CooperationCommand[] commands +--- +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md new file mode 100644 index 00000000000..bf1d8501d4e --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md @@ -0,0 +1,19 @@ +--- +# This file is generated by tools/autoware-interfaces/generate.py +title: autoware_adapi_v1_msgs/srv/SetCooperationDefault +uses: + - autoware_adapi_v1_msgs/msg/CooperationDecision + - autoware_adapi_v1_msgs/msg/ResponseStatus +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +string module +autoware_adapi_v1_msgs/CooperationDecision cooperator +--- +autoware_adapi_v1_msgs/ResponseStatus status +``` + +{% endblock %} diff --git a/main.py b/main.py index 5629cd8cdc5..6952a83155e 100644 --- a/main.py +++ b/main.py @@ -23,4 +23,5 @@ def resolve_msg_field(type, name, ext): for field in name.split("."): type = type.split("[")[0] type = specs[type][ext][field] + ext = "msg" return type diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index fa6e3cb1ad4..97015065304 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -1,4 +1,8 @@ types: + autoware_adapi_v1_msgs/msg/CooperationCommand: + msg: + cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision + uuid: unique_identifier_msgs/msg/UUID autoware_adapi_v1_msgs/msg/CooperationDecision: msg: decision: uint8 @@ -96,11 +100,28 @@ types: autoware_adapi_v1_msgs/srv/ClearRoute: res: status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/GetCooperationDefault: + req: + module: string + res: + cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/InitializeLocalization: req: pose: geometry_msgs/msg/PoseWithCovarianceStamped[<=1] res: status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/SetCooperationDecisions: + req: + commands: autoware_adapi_v1_msgs/msg/CooperationCommand[] + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus + autoware_adapi_v1_msgs/srv/SetCooperationDefault: + req: + cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision + module: string + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/SetRoute: req: goal: geometry_msgs/msg/Pose From e8a022ed5a22a1b95273e1471fc3b4f69cecbe55 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 15:02:28 +0900 Subject: [PATCH 26/53] feat: update module type Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/steering_factors.md | 4 ++-- .../ad-api/list/api/planning/velocity_factors.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md index e0c91b44bd5..7bdc2c22a56 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md @@ -8,12 +8,12 @@ type: text: The base link pose related to the steering factor. - name: factors.distance text: The distance from the base link to the above pose. - - name: factors.type - text: The type of the steering factor. - name: factors.direction text: The direction of the steering factor. - name: factors.status text: The status of the steering factor. + - name: factors.module + text: The module type of the steering factor. - name: factors.detail text: The additional information of the steering factor. --- diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md index 5339a0a4297..d067ddf4964 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md @@ -8,10 +8,10 @@ type: text: The base link pose related to the velocity factor. - name: factors.distance text: The distance from the base link to the above pose. - - name: factors.type - text: The type of the velocity factor. - name: factors.status text: The status of the velocity factor. + - name: factors.module + text: The module type of the velocity factor. - name: factors.detail text: The additional information of the velocity factor. --- From 1dc61f4cf3c4ac2647a2be659a6cd9bc4a88be43 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 22 May 2023 15:06:39 +0900 Subject: [PATCH 27/53] feat: add status Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/steering_factors.md | 4 +++- .../ad-api/list/api/planning/velocity_factors.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md index 7bdc2c22a56..75f608f8bd3 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md @@ -13,9 +13,11 @@ type: - name: factors.status text: The status of the steering factor. - name: factors.module - text: The module type of the steering factor. + text: The module name of the steering factor. - name: factors.detail text: The additional information of the steering factor. + - name: factors.cooperation + text: The cooperation status if the module supports. --- {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md index d067ddf4964..e5c5f7a3a67 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md @@ -11,9 +11,11 @@ type: - name: factors.status text: The status of the velocity factor. - name: factors.module - text: The module type of the velocity factor. + text: The module name of the velocity factor. - name: factors.detail text: The additional information of the velocity factor. + - name: factors.cooperation + text: The cooperation status if the module supports. --- {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} From d6711b4b904c52201026190583eb12001ef0c1ab Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 9 Jun 2023 10:58:59 +0900 Subject: [PATCH 28/53] update descriptions Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation.md | 35 ++++++++++ .../ad-api/list/api/planning/index.md | 68 ++++++++++--------- .../autoware-interfaces/ad-api/list/index.md | 1 + 3 files changed, 72 insertions(+), 32 deletions(-) create mode 100644 docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md new file mode 100644 index 00000000000..1b54280193e --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md @@ -0,0 +1,35 @@ +# Cooperation API + +- {{ link_ad_api('/api/planning/velocity_factors') }} +- {{ link_ad_api('/api/planning/steering_factors') }} +- {{ link_ad_api('/api/planning/cooperation/set_decisions') }} +- {{ link_ad_api('/api/planning/cooperation/set_default') }} +- {{ link_ad_api('/api/planning/cooperation/get_default') }} + +## Description + +Some planning modules can receive the operator's decision and reflect it in their behavior. +These modules have their own decisions, but use the the merged decision of theirs and operator's. +The operator can check the module's decision and override the decision if necessary. + +![cooperation-architecture](./docs/cooperation-architecture.drawio.svg) + +## Decisions + +The modules that support cooperation have their own decisions that is either deactivate or activate. +These are provided as cooperation status in velocity factors or steering factors. +Its meaning depends on the module and is shown in the table below. +The merged decision will also be either of these, and the module will decide the behavior using it. + +| Factor Type | Deactivate | Activate | +| ----------- | ------------- | --------------- | +| velocity | stop | pass | +| steering | keep the path | change the path | + +The operator's decision is either deactivate, activate, autonomous, or undecided. +If the operator selects deactivate or activate, the module's decision is ignored and the operator's is used instead. +If the operator selects autonomous, the module's decision is used. +The undecided is the initial state of the operator's decision and is evaluated as the default decision when merging. +The operator can also override the default decision to use when undecided. + +![cooperation-state](./docs/cooperation-state.drawio.svg) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md index eed88daa611..013e9530972 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md @@ -2,9 +2,6 @@ - {{ link_ad_api('/api/planning/velocity_factors') }} - {{ link_ad_api('/api/planning/steering_factors') }} -- {{ link_ad_api('/api/planning/cooperation/set_decisions') }} -- {{ link_ad_api('/api/planning/cooperation/set_default') }} -- {{ link_ad_api('/api/planning/cooperation/get_default') }} ## Description @@ -15,17 +12,50 @@ Also provides status and commands for modules that cooperation with operators. ## Velocity factors The velocity factors is an array of information on the behavior that the vehicle stops or slows down. -Each factor has a module name, pose in the base link, distance, status, and detailed data depending on its type. +Each factor has a behavior type which is described below. +Some behavior types have sequence and details as additional information. + +| Behavior | Description | +| --------------------------- | ----------------------------------------------------------------------------------- | +| surrounding-obstacle | There are obstacles immediately around the vehicle. | +| route-obstacle | There are obstacles along the route ahead. | +| intersection | There are obstacles in other lanes in the path. | +| crosswalk | There are obstacles on the crosswalk. | +| rear-check | There are obstacles behind that would be in a human driver's blind spot. | +| user-defined-attention-area | There are obstacles in the predefined attention area. | +| no-stopping-area | There is not enough space beyond the no stopping area. | +| stop-sign | A stop by a stop sign. | +| traffic-signal | A stop by a traffic signal. | +| v2x-gate-area | A stop by a gate area. It has enter and leave as sequences and v2x type as details. | +| merge | A stop before merging lanes. | +| sidewalk | A stop before crossing the sidewalk. | +| lane-change | A lane change. | +| avoidance | A path change to avoid an obstacle in the current lane. | +| emergency-operation | A stop by emergency instruction from the operator. | + +Each factor also provides status, poses in the base link frame, and distance from that pose. As the vehicle approaches the stop position, this factor appears with a status of APPROACHING. And when the vehicle reaches that position and stops, the status will be STOPPED. -The pose indicates the stop position or the base link if the stop position cannot be calculated. +The pose indicates the stop position, or the base link if the stop position cannot be calculated. ![velocity-factors](./docs/velocity-factors.drawio.svg) ## Steering factors The steering factors is an array of information on the maneuver that requires use of turn indicators, such as turning left or right. -Each factor has a module name, poses in the base link, distances, status, and detailed data depending on its type. +Each factor has a behavior type which is described below and steering direction. +Some behavior types have sequence and details as additional information. + +| Behavior | Description | +| ------------------- | --------------------------------------------------------------------------- | +| intersection | A turning left or right at an intersection. | +| lane-change | A lane change. | +| avoidance | A path change to avoid an obstacle. It has a sequence of change and return. | +| start-planner | T.B.D. | +| goal-planner | T.B.D. | +| emergency-operation | A path change by emergency instruction from the operator. | + +Each factor also provides status, poses in the base link frame, and distances from that poses. As the vehicle approaches the position to start steering, this factor appears with a status of APPROACHING. And when the vehicle reaches that position, the status will be TURNING. The poses indicate the start and end position of the section where the status is TURNING. @@ -36,29 +66,3 @@ In cases such as lane change and avoidance, the vehicle will start steering at a For these types, the section where the status is TURNING will be updated dynamically and the poses will follow that. ![steering-factors-2](./docs/steering-factors-2.drawio.svg) - -## Cooperation - -Some planning modules can receive the operator's decision and reflect it in their behavior. -These modules have their own decisions, but use the the merged decision of theirs and operator's. -The operator can check the module's decision and override the decision if necessary. - -![cooperation-architecture](./docs/cooperation-architecture.drawio.svg) - -The modules that support cooperation have their own decisions that is either deactivate or activate. -Its meaning depends on the module and is shown in the table below. -The merged decision will also be either of these, and the module will decide the behavior using it. - -| Module Group | Module Type | Deactivate | Activate | -| ------------ | ----------- | ------------- | --------------- | -| velocity | slow down | slow down | pass | -| velocity | stop | stop | pass | -| steering | path change | keep the path | change the path | - -The operator's decision is either deactivate, activate, autonomous, or undecided. -If the operator selects deactivate or activate, the module's decision is ignored and the operator's is used instead. -If the operator selects autonomous, the module's decision is used. -The undecided is the initial state of the operator's decision and is replaced with the system default when merging. -The operator can also override the default decision to use when undecided. - -![cooperation-state](./docs/cooperation-state.drawio.svg) diff --git a/docs/design/autoware-interfaces/ad-api/list/index.md b/docs/design/autoware-interfaces/ad-api/list/index.md index 65ee7e0efd7..d6e6cec4c12 100644 --- a/docs/design/autoware-interfaces/ad-api/list/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/index.md @@ -6,4 +6,5 @@ - [Localization](./api/localization/index.md) - [Motion](./api/motion/index.md) - [Planning](./api/planning/index.md) +- [Cooperation](./api/planning/cooperation.md) - [Fail-safe](./api/fail_safe/index.md) From 13ed4abf314e9a0edbfe3c36930d225113bade07 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 9 Jun 2023 11:05:01 +0900 Subject: [PATCH 29/53] update descriptions Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/steering_factors.md | 6 ++++-- .../ad-api/list/api/planning/velocity_factors.md | 6 ++++-- .../autoware_adapi_v1_msgs/msg/SteeringFactor.md | 3 ++- .../autoware_adapi_v1_msgs/msg/VelocityFactor.md | 3 ++- tools/autoware-interfaces/generate.py | 16 +++++++++++++--- yaml/autoware-interfaces.yaml | 6 ++++-- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md index 75f608f8bd3..3cf1ee3ffa4 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/steering_factors.md @@ -12,8 +12,10 @@ type: text: The direction of the steering factor. - name: factors.status text: The status of the steering factor. - - name: factors.module - text: The module name of the steering factor. + - name: factors.behavior + text: The behavior type of the steering factor. + - name: factors.sequence + text: The sequence type of the steering factor. - name: factors.detail text: The additional information of the steering factor. - name: factors.cooperation diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md index e5c5f7a3a67..3659246d356 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/velocity_factors.md @@ -10,8 +10,10 @@ type: text: The distance from the base link to the above pose. - name: factors.status text: The status of the velocity factor. - - name: factors.module - text: The module name of the velocity factor. + - name: factors.behavior + text: The behavior type of the velocity factor. + - name: factors.sequence + text: The sequence type of the velocity factor. - name: factors.detail text: The additional information of the velocity factor. - name: factors.cooperation diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md index feccaa4c283..c5a200682c8 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/SteeringFactor.md @@ -28,7 +28,8 @@ geometry_msgs/Pose[2] pose float32[2] distance uint16 direction uint16 status -string module +string behavior +string sequence string detail autoware_adapi_v1_msgs/CooperationStatus[<=1] cooperation diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md index 53078d23dd1..362778a7be2 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/VelocityFactor.md @@ -22,7 +22,8 @@ uint16 STOPPED = 2 geometry_msgs/Pose pose float32 distance uint16 status -string module +string behavior +string sequence string detail autoware_adapi_v1_msgs/CooperationStatus[<=1] cooperation diff --git a/tools/autoware-interfaces/generate.py b/tools/autoware-interfaces/generate.py index cd809c1c416..4d098df20bf 100755 --- a/tools/autoware-interfaces/generate.py +++ b/tools/autoware-interfaces/generate.py @@ -16,6 +16,7 @@ # This script requires "source install/setup.bash" for dependent messages/services. +import shutil import yaml from pathlib import Path @@ -25,6 +26,12 @@ from ament_index_python.packages import get_package_share_directory +# cSpell:words indentless +class MyDumper(yaml.SafeDumper): + def increase_indent(self, flow=False, *args, **kwargs): + return super().increase_indent(flow=flow, indentless=False) + + def load_markdown_metadata(path: Path): lines = path.read_text().splitlines() if (2 < len(lines)) and (lines[0] == "---"): @@ -93,7 +100,7 @@ def main(): # Export a field list. data = {"types": specs} - Path("yaml/autoware-interfaces.yaml").write_text(yaml.safe_dump(data)) + Path("yaml/autoware-interfaces.yaml").write_text(yaml.dump(data, Dumper=MyDumper)) # Create data type dependencies. type_uses = {name: set() for name in specs} @@ -106,8 +113,11 @@ def main(): type_uses[user].add(name) type_used[name].add(user) - # Generate data type pages. + # Clean up data type pages. base = Path("docs/design/autoware-interfaces/ad-api/types") + shutil.rmtree(base) + + # Generate data type pages. for name in specs: uses = list(sorted(type_uses[name])) used = list(sorted(type_used[name])) @@ -115,7 +125,7 @@ def main(): data = {k: v for k, v in data.items() if v} text = "---\n" text += "# This file is generated by tools/autoware-interfaces/generate.py\n" - text += yaml.safe_dump(data).strip() + "\n" + text += yaml.dump(data, Dumper=MyDumper).strip() + "\n" text += "---\n\n" text += "{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}\n" text += "{% block definition %}\n" diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index 97015065304..5dc08465c5c 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -66,12 +66,13 @@ types: state: uint16 autoware_adapi_v1_msgs/msg/SteeringFactor: msg: + behavior: string cooperation: autoware_adapi_v1_msgs/msg/CooperationStatus[<=1] detail: string direction: uint16 distance: float32[2] - module: string pose: geometry_msgs/msg/Pose[2] + sequence: string status: uint16 type: uint16 autoware_adapi_v1_msgs/msg/SteeringFactorArray: @@ -80,11 +81,12 @@ types: header: std_msgs/msg/Header autoware_adapi_v1_msgs/msg/VelocityFactor: msg: + behavior: string cooperation: autoware_adapi_v1_msgs/msg/CooperationStatus[<=1] detail: string distance: float32 - module: string pose: geometry_msgs/msg/Pose + sequence: string status: uint16 type: uint16 autoware_adapi_v1_msgs/msg/VelocityFactorArray: From 5a8d89d9134fcda81e36b50959dafe90430b4291 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 9 Jun 2023 11:11:03 +0900 Subject: [PATCH 30/53] update link Signed-off-by: Takagi, Isamu --- .../autoware-interfaces/ad-api/list/api/planning/cooperation.md | 2 +- .../autoware-interfaces/ad-api/list/api/planning/index.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md index 1b54280193e..5961f6cb4e6 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md @@ -17,7 +17,7 @@ The operator can check the module's decision and override the decision if necess ## Decisions The modules that support cooperation have their own decisions that is either deactivate or activate. -These are provided as cooperation status in velocity factors or steering factors. +These are provided as cooperation status in [velocity factors or steering factors](./index.md). Its meaning depends on the module and is shown in the table below. The merged decision will also be either of these, and the module will decide the behavior using it. diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md index 013e9530972..bf05e24ab76 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/index.md @@ -7,7 +7,6 @@ This API manages the planned behavior of the vehicle. Applications can notify the vehicle behavior to the people around and visualize it for operator and passengers. -Also provides status and commands for modules that cooperation with operators. ## Velocity factors From f5f9673ded9e70f4f0d3847bb098565a57ebec3e Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 9 Jun 2023 11:39:03 +0900 Subject: [PATCH 31/53] fix link Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation/get_default.md | 2 +- .../ad-api/list/api/planning/cooperation/set_decisions.md | 2 +- .../ad-api/list/api/planning/cooperation/set_default.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md index c3c8ceb2fbc..f144895ee5b 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md @@ -15,5 +15,5 @@ type: {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Set the default decision for cooperation. For details, see the [cooperation](../index.md#cooperation). +Set the default decision for cooperation. For details, see the [cooperation](../cooperation.md). {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md index faa2b96044b..4af9b9c1370 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md @@ -15,5 +15,5 @@ type: {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Set the operator's decision for cooperation. For details, see the [cooperation](../index.md#cooperation). +Set the operator's decision for cooperation. For details, see the [cooperation](../cooperation.md). {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md index 7992e330662..8959e378c4e 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md @@ -15,5 +15,5 @@ type: {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Set the default decision for cooperation. For details, see the [cooperation](../index.md#cooperation). +Set the default decision for cooperation. For details, see the [cooperation](../cooperation.md). {% endblock %} From c92a7230bd905c4c8cff375bf362394decae223d Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 9 Jun 2023 18:24:27 +0900 Subject: [PATCH 32/53] update default decision service Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation.md | 9 ++++++++- .../api/planning/cooperation/get_default.md | 9 ++++----- .../api/planning/cooperation/set_default.md | 8 ++++---- .../msg/CooperationDecision.md | 3 +-- .../msg/CooperationDefault.md | 19 +++++++++++++++++++ .../srv/GetCooperationDefault.md | 5 ++--- .../srv/SetCooperationDefault.md | 5 ++--- yaml/autoware-interfaces.yaml | 11 ++++++----- 8 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md index 5961f6cb4e6..c19e79aa899 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md @@ -11,13 +11,20 @@ Some planning modules can receive the operator's decision and reflect it in their behavior. These modules have their own decisions, but use the the merged decision of theirs and operator's. The operator can check the module's decision and override the decision if necessary. +If the module supports this feature, [cooperation status](../../../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md) is provided in [velocity factors or steering factors](./index.md). ![cooperation-architecture](./docs/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's 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 modules that support cooperation have their own decisions that is either deactivate or activate. -These are provided as cooperation status in [velocity factors or steering factors](./index.md). Its meaning depends on the module and is shown in the table below. The merged decision will also be either of these, and the module will decide the behavior using it. diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md index f144895ee5b..8ad4b1f3076 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md @@ -3,14 +3,13 @@ title: /api/planning/cooperation/get_default method: function call type: name: autoware_adapi_v1_msgs/srv/GetCooperationDefault - req: - - name: module - text: The name of the target module. res: - name: status text: response status - - name: cooperator - text: The default decision of the target module. + - name: defaults.behavior + text: The type of the target behavior. + - name: defaults.cooperator + text: The default decision of the target behavior. --- {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md index 8959e378c4e..b550b529859 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md @@ -4,10 +4,10 @@ method: function call type: name: autoware_adapi_v1_msgs/srv/SetCooperationDefault req: - - name: module - text: The name of the target module. - - name: cooperator - text: The default decision of the target module. + - name: defaults.behavior + text: The type of the target behavior. + - name: defaults.cooperator + text: The default decision of the target behavior. res: - name: status text: response status diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md index 924e438f295..6c939af3d20 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md @@ -3,9 +3,8 @@ title: autoware_adapi_v1_msgs/msg/CooperationDecision used: - autoware_adapi_v1_msgs/msg/CooperationCommand + - autoware_adapi_v1_msgs/msg/CooperationDefault - autoware_adapi_v1_msgs/msg/CooperationStatus - - autoware_adapi_v1_msgs/srv/GetCooperationDefault - - autoware_adapi_v1_msgs/srv/SetCooperationDefault --- {% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md new file mode 100644 index 00000000000..c2314b1162c --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md @@ -0,0 +1,19 @@ +--- +# This file is generated by tools/autoware-interfaces/generate.py +title: autoware_adapi_v1_msgs/msg/CooperationDefault +used: + - autoware_adapi_v1_msgs/srv/GetCooperationDefault + - autoware_adapi_v1_msgs/srv/SetCooperationDefault +uses: + - autoware_adapi_v1_msgs/msg/CooperationDecision +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +string behavior +autoware_adapi_v1_msgs/CooperationDecision cooperator +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md index c8e10e5f928..2c8469f60f4 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md @@ -2,7 +2,7 @@ # This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/GetCooperationDefault uses: - - autoware_adapi_v1_msgs/msg/CooperationDecision + - autoware_adapi_v1_msgs/msg/CooperationDefault - autoware_adapi_v1_msgs/msg/ResponseStatus --- @@ -10,10 +10,9 @@ uses: {% block definition %} ```txt -string module --- autoware_adapi_v1_msgs/ResponseStatus status -autoware_adapi_v1_msgs/CooperationDecision cooperator +autoware_adapi_v1_msgs/CooperationDefault[] defaults ``` {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md index bf1d8501d4e..fde21849d22 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md @@ -2,7 +2,7 @@ # This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/srv/SetCooperationDefault uses: - - autoware_adapi_v1_msgs/msg/CooperationDecision + - autoware_adapi_v1_msgs/msg/CooperationDefault - autoware_adapi_v1_msgs/msg/ResponseStatus --- @@ -10,8 +10,7 @@ uses: {% block definition %} ```txt -string module -autoware_adapi_v1_msgs/CooperationDecision cooperator +autoware_adapi_v1_msgs/CooperationDefault[] defaults --- autoware_adapi_v1_msgs/ResponseStatus status ``` diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index 5dc08465c5c..5a868772d36 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -6,6 +6,10 @@ types: autoware_adapi_v1_msgs/msg/CooperationDecision: msg: decision: uint8 + autoware_adapi_v1_msgs/msg/CooperationDefault: + msg: + behavior: string + cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision autoware_adapi_v1_msgs/msg/CooperationStatus: msg: autonomous: autoware_adapi_v1_msgs/msg/CooperationDecision @@ -103,10 +107,8 @@ types: res: status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/GetCooperationDefault: - req: - module: string res: - cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision + defaults: autoware_adapi_v1_msgs/msg/CooperationDefault[] status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/InitializeLocalization: req: @@ -120,8 +122,7 @@ types: status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/SetCooperationDefault: req: - cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision - module: string + defaults: autoware_adapi_v1_msgs/msg/CooperationDefault[] res: status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/SetRoute: From 061ab6ec34e0713d0c8379a15e184b6e783f048c Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 12 Jun 2023 13:13:26 +0900 Subject: [PATCH 33/53] rename service Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation.md | 6 +++--- .../cooperation/{get_default.md => get_defaults.md} | 4 ++-- .../cooperation/{set_decisions.md => set_commands.md} | 4 ++-- .../cooperation/{set_default.md => set_defaults.md} | 4 ++-- .../types/autoware_adapi_v1_msgs/msg/CooperationCommand.md | 2 +- .../types/autoware_adapi_v1_msgs/msg/CooperationDefault.md | 4 ++-- .../types/autoware_adapi_v1_msgs/msg/ResponseStatus.md | 6 +++--- .../{SetCooperationDefault.md => GetCooperationDefaults.md} | 4 ++-- ...SetCooperationDecisions.md => SetCooperationCommands.md} | 2 +- .../{GetCooperationDefault.md => SetCooperationDefaults.md} | 4 ++-- yaml/autoware-interfaces.yaml | 6 +++--- 11 files changed, 23 insertions(+), 23 deletions(-) rename docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/{get_default.md => get_defaults.md} (81%) rename docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/{set_decisions.md => set_commands.md} (81%) rename docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/{set_default.md => set_defaults.md} (82%) rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/{SetCooperationDefault.md => GetCooperationDefaults.md} (87%) rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/{SetCooperationDecisions.md => SetCooperationCommands.md} (87%) rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/{GetCooperationDefault.md => SetCooperationDefaults.md} (87%) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md index c19e79aa899..fdc31e9a112 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md @@ -2,9 +2,9 @@ - {{ link_ad_api('/api/planning/velocity_factors') }} - {{ link_ad_api('/api/planning/steering_factors') }} -- {{ link_ad_api('/api/planning/cooperation/set_decisions') }} -- {{ link_ad_api('/api/planning/cooperation/set_default') }} -- {{ link_ad_api('/api/planning/cooperation/get_default') }} +- {{ link_ad_api('/api/planning/cooperation/set_commands') }} +- {{ link_ad_api('/api/planning/cooperation/set_defaults') }} +- {{ link_ad_api('/api/planning/cooperation/get_defaults') }} ## Description diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md similarity index 81% rename from docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md rename to docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md index 8ad4b1f3076..478e26df7b3 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_default.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md @@ -1,8 +1,8 @@ --- -title: /api/planning/cooperation/get_default +title: /api/planning/cooperation/get_defaults method: function call type: - name: autoware_adapi_v1_msgs/srv/GetCooperationDefault + name: autoware_adapi_v1_msgs/srv/GetCooperationDefaults res: - name: status text: response status diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md similarity index 81% rename from docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md rename to docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md index 4af9b9c1370..4f13bfeb835 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_decisions.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md @@ -1,8 +1,8 @@ --- -title: /api/planning/cooperation/set_decisions +title: /api/planning/cooperation/set_commands method: function call type: - name: autoware_adapi_v1_msgs/srv/SetCooperationDecisions + name: autoware_adapi_v1_msgs/srv/SetCooperationCommands req: - name: commands.uuid text: The ID in the cooperation status. diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md similarity index 82% rename from docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md rename to docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md index b550b529859..c44f8d5514b 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_default.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md @@ -1,8 +1,8 @@ --- -title: /api/planning/cooperation/set_default +title: /api/planning/cooperation/set_defaults method: function call type: - name: autoware_adapi_v1_msgs/srv/SetCooperationDefault + name: autoware_adapi_v1_msgs/srv/SetCooperationDefaults req: - name: defaults.behavior text: The type of the target behavior. diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md index 386298af99e..c088129687d 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationCommand.md @@ -2,7 +2,7 @@ # This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/CooperationCommand used: - - autoware_adapi_v1_msgs/srv/SetCooperationDecisions + - autoware_adapi_v1_msgs/srv/SetCooperationCommands uses: - autoware_adapi_v1_msgs/msg/CooperationDecision --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md index c2314b1162c..707e141fddb 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md @@ -2,8 +2,8 @@ # This file is generated by tools/autoware-interfaces/generate.py title: autoware_adapi_v1_msgs/msg/CooperationDefault used: - - autoware_adapi_v1_msgs/srv/GetCooperationDefault - - autoware_adapi_v1_msgs/srv/SetCooperationDefault + - autoware_adapi_v1_msgs/srv/GetCooperationDefaults + - autoware_adapi_v1_msgs/srv/SetCooperationDefaults uses: - autoware_adapi_v1_msgs/msg/CooperationDecision --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md index 297cb0524a2..1e4e1f3a5cd 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md @@ -5,10 +5,10 @@ used: - autoware_adapi_v1_msgs/srv/AcceptStart - autoware_adapi_v1_msgs/srv/ChangeOperationMode - autoware_adapi_v1_msgs/srv/ClearRoute - - autoware_adapi_v1_msgs/srv/GetCooperationDefault + - autoware_adapi_v1_msgs/srv/GetCooperationDefaults - autoware_adapi_v1_msgs/srv/InitializeLocalization - - autoware_adapi_v1_msgs/srv/SetCooperationDecisions - - autoware_adapi_v1_msgs/srv/SetCooperationDefault + - autoware_adapi_v1_msgs/srv/SetCooperationCommands + - autoware_adapi_v1_msgs/srv/SetCooperationDefaults - autoware_adapi_v1_msgs/srv/SetRoute - autoware_adapi_v1_msgs/srv/SetRoutePoints --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefaults.md similarity index 87% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefaults.md index fde21849d22..a870770cc66 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefault.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefaults.md @@ -1,6 +1,6 @@ --- # This file is generated by tools/autoware-interfaces/generate.py -title: autoware_adapi_v1_msgs/srv/SetCooperationDefault +title: autoware_adapi_v1_msgs/srv/GetCooperationDefaults uses: - autoware_adapi_v1_msgs/msg/CooperationDefault - autoware_adapi_v1_msgs/msg/ResponseStatus @@ -10,9 +10,9 @@ uses: {% block definition %} ```txt -autoware_adapi_v1_msgs/CooperationDefault[] defaults --- autoware_adapi_v1_msgs/ResponseStatus status +autoware_adapi_v1_msgs/CooperationDefault[] defaults ``` {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDecisions.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationCommands.md similarity index 87% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDecisions.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationCommands.md index 6551d63d0a5..be9e777245a 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDecisions.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationCommands.md @@ -1,6 +1,6 @@ --- # This file is generated by tools/autoware-interfaces/generate.py -title: autoware_adapi_v1_msgs/srv/SetCooperationDecisions +title: autoware_adapi_v1_msgs/srv/SetCooperationCommands uses: - autoware_adapi_v1_msgs/msg/CooperationCommand - autoware_adapi_v1_msgs/msg/ResponseStatus diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefaults.md similarity index 87% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefaults.md index 2c8469f60f4..39641a648db 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefault.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefaults.md @@ -1,6 +1,6 @@ --- # This file is generated by tools/autoware-interfaces/generate.py -title: autoware_adapi_v1_msgs/srv/GetCooperationDefault +title: autoware_adapi_v1_msgs/srv/SetCooperationDefaults uses: - autoware_adapi_v1_msgs/msg/CooperationDefault - autoware_adapi_v1_msgs/msg/ResponseStatus @@ -10,9 +10,9 @@ uses: {% block definition %} ```txt +autoware_adapi_v1_msgs/CooperationDefault[] defaults --- autoware_adapi_v1_msgs/ResponseStatus status -autoware_adapi_v1_msgs/CooperationDefault[] defaults ``` {% endblock %} diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index 5a868772d36..62e26a7083d 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -106,7 +106,7 @@ types: autoware_adapi_v1_msgs/srv/ClearRoute: res: status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/GetCooperationDefault: + autoware_adapi_v1_msgs/srv/GetCooperationDefaults: res: defaults: autoware_adapi_v1_msgs/msg/CooperationDefault[] status: autoware_adapi_v1_msgs/msg/ResponseStatus @@ -115,12 +115,12 @@ types: pose: geometry_msgs/msg/PoseWithCovarianceStamped[<=1] res: status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/SetCooperationDecisions: + autoware_adapi_v1_msgs/srv/SetCooperationCommands: req: commands: autoware_adapi_v1_msgs/msg/CooperationCommand[] res: status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/SetCooperationDefault: + autoware_adapi_v1_msgs/srv/SetCooperationDefaults: req: defaults: autoware_adapi_v1_msgs/msg/CooperationDefault[] res: From 9840dcaf0089c038f31502596d40524dfd845882 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 14 Jun 2023 17:53:38 +0900 Subject: [PATCH 34/53] update description of default decision Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation.md | 5 +++-- .../ad-api/list/api/planning/cooperation/get_defaults.md | 2 +- .../ad-api/list/api/planning/cooperation/set_defaults.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md index fdc31e9a112..efcf9cf7011 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md @@ -36,7 +36,8 @@ The merged decision will also be either of these, and the module will decide the The operator's decision is either deactivate, activate, autonomous, or undecided. If the operator selects deactivate or activate, the module's decision is ignored and the operator's is used instead. If the operator selects autonomous, the module's decision is used. -The undecided is the initial state of the operator's decision and is evaluated as the default decision when merging. -The operator can also override the default decision to use when undecided. +The undecided is the initial state of the operator's decision. +If the operator's decision is undecided, the default decision is used instead when merging decisions. +Default decisions are set for each module type, and the operator can also select it. ![cooperation-state](./docs/cooperation-state.drawio.svg) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md index 478e26df7b3..fb59b1f4284 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md @@ -14,5 +14,5 @@ type: {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Set the default decision for cooperation. For details, see the [cooperation](../cooperation.md). +Get the default decision that is used instead when the operator's decision is undecided. For details, see the [cooperation](../cooperation.md). {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md index c44f8d5514b..0d20bdcca9a 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md @@ -15,5 +15,5 @@ type: {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Set the default decision for cooperation. For details, see the [cooperation](../cooperation.md). +Set the default decision that is used instead when the operator's decision is undecided. For details, see the [cooperation](../cooperation.md). {% endblock %} From 060a650ec0b5189802eaea8faf670d34996cf667 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 16 Jun 2023 22:13:03 +0900 Subject: [PATCH 35/53] update description Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation.md | 54 +++++++++++++------ .../docs/cooperation-state.drawio.svg | 6 +-- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md index efcf9cf7011..d935d27b2e5 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md @@ -8,9 +8,9 @@ ## Description -Some planning modules can receive the operator's decision and reflect it in their behavior. -These modules have their own decisions, but use the the merged decision of theirs and operator's. -The operator can check the module's decision and override the decision if necessary. +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. If the module supports this feature, [cooperation status](../../../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md) is provided in [velocity factors or steering factors](./index.md). ![cooperation-architecture](./docs/cooperation-architecture.drawio.svg) @@ -19,25 +19,45 @@ If the module supports this feature, [cooperation status](../../../types/autowar 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's decision, it needs to specify the ID by selecting the target scene from the cooperation status. +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 modules that support cooperation have their own decisions that is either deactivate or activate. +The module decision is either deactivate or activate. The operator decision is also evaluated in one of these. Its meaning depends on the module and is shown in the table below. -The merged decision will also be either of these, and the module will decide the behavior using it. +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 default. +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 default is the initial value of the operator decision. +If the operator decision is default, it is evaluated according to the default policy set for each module type. + +The default policy is either deactivate or autonomous, and is initialized by system settings. +These meanings are the same as the operator decision. +The purpose of the default policy is to set whether the operator decision is required. +The deactivate policy is a defensive setting and not perform risky behavior until instructed by the operator. +The autonomous policy can perform both behavior without operator instruction. +Also, the operator can change the default policies. -| Factor Type | Deactivate | Activate | -| ----------- | ------------- | --------------- | -| velocity | stop | pass | -| steering | keep the path | change the path | +![cooperation-state](./docs/cooperation-state.drawio.svg) -The operator's decision is either deactivate, activate, autonomous, or undecided. -If the operator selects deactivate or activate, the module's decision is ignored and the operator's is used instead. -If the operator selects autonomous, the module's decision is used. -The undecided is the initial state of the operator's decision. -If the operator's decision is undecided, the default decision is used instead when merging decisions. -Default decisions are set for each module type, and the operator can also select it. +## Examples -![cooperation-state](./docs/cooperation-state.drawio.svg) +This is an example of cooperation for lane change module. The behaviors by the combination of decisions are as follows. + +| Operator decision | Default 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. | +| default | deactivate | - | The deactivate default policy is used because no operator instruction. So it keeps lane by deactivate policy. | +| default | autonomous | deactivate | The autonomous default policy is used because no operator instruction. So it keeps lane by module decision. | +| default | autonomous | activate | The autonomous default policy is used because no operator instruction. So it change lane by module decision. | diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-state.drawio.svg b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-state.drawio.svg index 3fbebc39612..075b319ab3a 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-state.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/docs/cooperation-state.drawio.svg @@ -1,4 +1,4 @@ - + @@ -59,13 +59,13 @@
- default decision + default policy
- default decision + default policy
From 45cc1e7adf2604a46dc25e42c0393944513775df Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Thu, 22 Jun 2023 18:53:06 +0900 Subject: [PATCH 36/53] update description Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation.md | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md index d935d27b2e5..8e5bc30ec70 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md @@ -33,18 +33,19 @@ These decisions are designed to assign behavior to activate that is considered h | velocity (stop) | stop | pass | | steering (path) | keep the path | change the path | -The operator decision is actually either deactivate, activate, autonomous, or default. +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 default is the initial value of the operator decision. -If the operator decision is default, it is evaluated according to the default policy set for each module type. +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 default policy is either deactivate or autonomous, and is initialized by system settings. -These meanings are the same as the operator decision. -The purpose of the default policy is to set whether the operator decision is required. -The deactivate policy is a defensive setting and not perform risky behavior until instructed by the operator. -The autonomous policy can perform both behavior without operator instruction. -Also, the operator can change the default policies. +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](./docs/cooperation-state.drawio.svg) @@ -52,12 +53,12 @@ Also, the operator can change the default policies. This is an example of cooperation for lane change module. The behaviors by the combination of decisions are as follows. -| Operator decision | Default 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. | -| default | deactivate | - | The deactivate default policy is used because no operator instruction. So it keeps lane by deactivate policy. | -| default | autonomous | deactivate | The autonomous default policy is used because no operator instruction. So it keeps lane by module decision. | -| default | autonomous | activate | The autonomous default policy is used because no operator instruction. So it change lane by module decision. | +| 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. | From cd5047877f60ba115878c1be0ed07ee7ec08a928 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 23 Jun 2023 19:07:25 +0900 Subject: [PATCH 37/53] rename policy Signed-off-by: Takagi, Isamu --- .../api/planning => features}/cooperation.md | 14 +- .../cooperation/architecture.drawio.svg | 277 ++++++++++++++++ .../features/cooperation/state.drawio.svg | 297 ++++++++++++++++++ .../{get_defaults.md => get_policies.md} | 13 +- .../api/planning/cooperation/set_commands.md | 3 +- .../{set_defaults.md => set_policies.md} | 13 +- .../autoware-interfaces/ad-api/list/index.md | 3 + .../msg/CooperationDecision.md | 1 - .../msg/CooperationDefault.md | 19 -- .../msg/CooperationPolicy.md | 20 ++ .../msg/ResponseStatus.md | 4 +- ...nDefaults.md => GetCooperationPolicies.md} | 6 +- ...nDefaults.md => SetCooperationPolicies.md} | 6 +- .../autoware-interfaces/ad-api/types/index.md | 7 + yaml/autoware-interfaces.yaml | 13 +- 15 files changed, 643 insertions(+), 53 deletions(-) rename docs/design/autoware-interfaces/ad-api/{list/api/planning => features}/cooperation.md (89%) create mode 100644 docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg create mode 100644 docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg rename docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/{get_defaults.md => get_policies.md} (50%) rename docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/{set_defaults.md => set_policies.md} (51%) delete mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md create mode 100644 docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/{SetCooperationDefaults.md => GetCooperationPolicies.md} (65%) rename docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/{GetCooperationDefaults.md => SetCooperationPolicies.md} (65%) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md similarity index 89% rename from docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md rename to docs/design/autoware-interfaces/ad-api/features/cooperation.md index 8e5bc30ec70..8042f12ac6d 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -1,19 +1,21 @@ -# Cooperation API +# 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_defaults') }} -- {{ link_ad_api('/api/planning/cooperation/get_defaults') }} +- {{ 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. -If the module supports this feature, [cooperation status](../../../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md) is provided in [velocity factors or steering factors](./index.md). +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](./docs/cooperation-architecture.drawio.svg) +![cooperation-architecture](./cooperation/architecture.drawio.svg) ## Scene ID @@ -47,7 +49,7 @@ 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](./docs/cooperation-state.drawio.svg) +![cooperation-state](./cooperation/state.drawio.svg) ## Examples diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg new file mode 100644 index 00000000000..e92dab1c418 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg @@ -0,0 +1,277 @@ + + + + + + + + + + + + +
+
+
+ planning +
+ module +
+
+
+
+ + planning... + +
+
+ + + + + + +
+
+
+ merged decision +
+
+
+
+ + merged decision + +
+
+ + + + +
+
+
+ cooperation policy + +
+
+
+
+
+
+ + cooperation policy + +
+
+ + + + + + + + +
+
+
+ operator +
+
+
+
+ + operator + +
+
+ + + + +
+
+
+ status +
+
+
+
+ + status + +
+
+ + + + + + + + +
+
+
+ operator decision +
+
+
+
+ + operator decision + +
+
+ + + + + + +
+
+
+ module decision +
+
+
+
+ + module decision + +
+
+ + + + +
+
+
+ use +
+
+
+
+ + use + +
+
+ + + + + + +
+
+
+ system +
+ settings +
+
+
+
+ + system... + +
+
+ + + + +
+
+
+ init +
+
+
+
+ + init + +
+
+ + + + +
+
+
+ set decision +
+
+
+
+ + set decision + +
+
+ + + + +
+
+
+ set policy +
+
+
+
+ + set policy + +
+
+ + + + +
+
+
+ for each module type +
+
+
+
+ + for each module type + +
+
+ + + + +
+
+
+ for each scene +
+
+
+
+ + for each scene + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg new file mode 100644 index 00000000000..f83729c9778 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg @@ -0,0 +1,297 @@ + + + + + + + +
+
+
+ operator decision +
+
+
+
+ + operator decision + +
+
+ + + + +
+
+
+ decided +
+
+
+
+ + decided + +
+
+ + + + +
+
+
+ module decision +
+
+
+
+ + module decision + +
+
+ + + + +
+
+
+ + cooperation policy + +
+
+
+
+ + cooperation policy + +
+
+ + + + + + + + + + + +
+
+
+ none +
+
+
+
+ + none + +
+
+ + + + + + + + + +
+
+
+ deactivate +
+
+
+
+ + deactivate + +
+
+ + + + + + +
+
+
+ autonomous +
+
+
+
+ + autonomous + +
+
+ + + + + + + +
+
+
+ activate +
+
+
+
+ + activate + +
+
+ + + + + + + +
+
+
+ required +
+
+
+
+ + required + +
+
+ + + + + + +
+
+
+ optional +
+
+
+
+ + optional + +
+
+ + + + + + + +
+
+
+ deactivate +
+
+
+
+ + deactivate + +
+
+ + + + +
+
+
+ use +
+
+
+
+ + use + +
+
+ + + + + + +
+
+
+ activate +
+
+
+
+ + activate + +
+
+ + + + +
+
+
+ use +
+
+
+
+ + use + +
+
+ + + + +
+
+
+ use +
+
+
+
+ + use + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md similarity index 50% rename from docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md rename to docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md index fb59b1f4284..41d12944321 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_defaults.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md @@ -1,18 +1,19 @@ --- -title: /api/planning/cooperation/get_defaults +title: /api/planning/cooperation/get_policies method: function call type: - name: autoware_adapi_v1_msgs/srv/GetCooperationDefaults + name: autoware_adapi_v1_msgs/srv/GetCooperationPolicies res: - name: status text: response status - - name: defaults.behavior + - name: policies.behavior text: The type of the target behavior. - - name: defaults.cooperator - text: The default decision of the target behavior. + - name: policies.type + text: The type of the cooporation policy. --- {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Get the default decision that is used instead when the operator's decision is undecided. For details, see the [cooperation](../cooperation.md). +Get the default decision that is used instead when the operator's decision is undecided. +For details, see the [cooperation](../../../../features/cooperation.md). {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md index 4f13bfeb835..4b42b76d6d5 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md @@ -15,5 +15,6 @@ type: {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Set the operator's decision for cooperation. For details, see the [cooperation](../cooperation.md). +Set the operator's decision for cooperation. +For details, see the [cooperation](../../../../features/cooperation.md). {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md similarity index 51% rename from docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md rename to docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md index 0d20bdcca9a..6ba44d59bba 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_defaults.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md @@ -1,13 +1,13 @@ --- -title: /api/planning/cooperation/set_defaults +title: /api/planning/cooperation/set_policies method: function call type: - name: autoware_adapi_v1_msgs/srv/SetCooperationDefaults + name: autoware_adapi_v1_msgs/srv/SetCooperationPolicies req: - - name: defaults.behavior + - name: policies.behavior text: The type of the target behavior. - - name: defaults.cooperator - text: The default decision of the target behavior. + - name: policies.type + text: The type of the cooporation policy. res: - name: status text: response status @@ -15,5 +15,6 @@ type: {% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %} {% block description %} -Set the default decision that is used instead when the operator's decision is undecided. For details, see the [cooperation](../cooperation.md). +Set the default decision that is used instead when the operator's decision is undecided. +For details, see the [cooperation](../../../../features/cooperation.md). {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/list/index.md b/docs/design/autoware-interfaces/ad-api/list/index.md index 56622573d0f..d8b37634453 100644 --- a/docs/design/autoware-interfaces/ad-api/list/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/index.md @@ -13,6 +13,9 @@ - [/api/operation_mode/disable_autoware_control](./api/operation_mode/disable_autoware_control.md) - [/api/operation_mode/enable_autoware_control](./api/operation_mode/enable_autoware_control.md) - [/api/operation_mode/state](./api/operation_mode/state.md) +- [/api/planning/cooperation/get_policies](./api/planning/cooperation/get_policies.md) +- [/api/planning/cooperation/set_commands](./api/planning/cooperation/set_commands.md) +- [/api/planning/cooperation/set_policies](./api/planning/cooperation/set_policies.md) - [/api/planning/steering_factors](./api/planning/steering_factors.md) - [/api/planning/velocity_factors](./api/planning/velocity_factors.md) - [/api/routing/clear_route](./api/routing/clear_route.md) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md index 6c939af3d20..5f99788bca5 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md @@ -3,7 +3,6 @@ title: autoware_adapi_v1_msgs/msg/CooperationDecision used: - autoware_adapi_v1_msgs/msg/CooperationCommand - - autoware_adapi_v1_msgs/msg/CooperationDefault - autoware_adapi_v1_msgs/msg/CooperationStatus --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md deleted file mode 100644 index 707e141fddb..00000000000 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDefault.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -# This file is generated by tools/autoware-interfaces/generate.py -title: autoware_adapi_v1_msgs/msg/CooperationDefault -used: - - autoware_adapi_v1_msgs/srv/GetCooperationDefaults - - autoware_adapi_v1_msgs/srv/SetCooperationDefaults -uses: - - autoware_adapi_v1_msgs/msg/CooperationDecision ---- - -{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} -{% block definition %} - -```txt -string behavior -autoware_adapi_v1_msgs/CooperationDecision cooperator -``` - -{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md new file mode 100644 index 00000000000..cf410cd08e8 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md @@ -0,0 +1,20 @@ +--- +# This file is generated by tools/autoware-interfaces/generate.py +title: autoware_adapi_v1_msgs/msg/CooperationPolicy +used: + - autoware_adapi_v1_msgs/srv/GetCooperationPolicies + - autoware_adapi_v1_msgs/srv/SetCooperationPolicies +--- + +{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %} +{% block definition %} + +```txt +uint8 OPTIONAL = 1 +uint8 REQUIRED = 2 + +string behavior +uint8 type +``` + +{% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md index fbba5c07b57..fc167187e02 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/ResponseStatus.md @@ -5,12 +5,12 @@ used: - autoware_adapi_v1_msgs/srv/AcceptStart - autoware_adapi_v1_msgs/srv/ChangeOperationMode - autoware_adapi_v1_msgs/srv/ClearRoute - - autoware_adapi_v1_msgs/srv/GetCooperationDefaults + - autoware_adapi_v1_msgs/srv/GetCooperationPolicies - autoware_adapi_v1_msgs/srv/GetDoorLayout - autoware_adapi_v1_msgs/srv/GetVehicleDimensions - autoware_adapi_v1_msgs/srv/InitializeLocalization - autoware_adapi_v1_msgs/srv/SetCooperationCommands - - autoware_adapi_v1_msgs/srv/SetCooperationDefaults + - autoware_adapi_v1_msgs/srv/SetCooperationPolicies - autoware_adapi_v1_msgs/srv/SetRoute - autoware_adapi_v1_msgs/srv/SetRoutePoints --- diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefaults.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationPolicies.md similarity index 65% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefaults.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationPolicies.md index 39641a648db..e6cc04266b2 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationDefaults.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationPolicies.md @@ -1,8 +1,8 @@ --- # This file is generated by tools/autoware-interfaces/generate.py -title: autoware_adapi_v1_msgs/srv/SetCooperationDefaults +title: autoware_adapi_v1_msgs/srv/GetCooperationPolicies uses: - - autoware_adapi_v1_msgs/msg/CooperationDefault + - autoware_adapi_v1_msgs/msg/CooperationPolicy - autoware_adapi_v1_msgs/msg/ResponseStatus --- @@ -10,9 +10,9 @@ uses: {% block definition %} ```txt -autoware_adapi_v1_msgs/CooperationDefault[] defaults --- autoware_adapi_v1_msgs/ResponseStatus status +autoware_adapi_v1_msgs/CooperationPolicy[] policies ``` {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefaults.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationPolicies.md similarity index 65% rename from docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefaults.md rename to docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationPolicies.md index a870770cc66..b25068edd9a 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/GetCooperationDefaults.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/srv/SetCooperationPolicies.md @@ -1,8 +1,8 @@ --- # This file is generated by tools/autoware-interfaces/generate.py -title: autoware_adapi_v1_msgs/srv/GetCooperationDefaults +title: autoware_adapi_v1_msgs/srv/SetCooperationPolicies uses: - - autoware_adapi_v1_msgs/msg/CooperationDefault + - autoware_adapi_v1_msgs/msg/CooperationPolicy - autoware_adapi_v1_msgs/msg/ResponseStatus --- @@ -10,9 +10,9 @@ uses: {% block definition %} ```txt +autoware_adapi_v1_msgs/CooperationPolicy[] policies --- autoware_adapi_v1_msgs/ResponseStatus status -autoware_adapi_v1_msgs/CooperationDefault[] defaults ``` {% endblock %} diff --git a/docs/design/autoware-interfaces/ad-api/types/index.md b/docs/design/autoware-interfaces/ad-api/types/index.md index e4dd953c36a..d8e74d1f8d1 100644 --- a/docs/design/autoware-interfaces/ad-api/types/index.md +++ b/docs/design/autoware-interfaces/ad-api/types/index.md @@ -1,5 +1,9 @@ # Types of Autoware AD API +- [autoware_adapi_v1_msgs/msg/CooperationCommand](./autoware_adapi_v1_msgs/msg/CooperationCommand.md) +- [autoware_adapi_v1_msgs/msg/CooperationDecision](./autoware_adapi_v1_msgs/msg/CooperationDecision.md) +- [autoware_adapi_v1_msgs/msg/CooperationPolicy](./autoware_adapi_v1_msgs/msg/CooperationPolicy.md) +- [autoware_adapi_v1_msgs/msg/CooperationStatus](./autoware_adapi_v1_msgs/msg/CooperationStatus.md) - [autoware_adapi_v1_msgs/msg/DoorLayout](./autoware_adapi_v1_msgs/msg/DoorLayout.md) - [autoware_adapi_v1_msgs/msg/DoorStatus](./autoware_adapi_v1_msgs/msg/DoorStatus.md) - [autoware_adapi_v1_msgs/msg/DoorStatusArray](./autoware_adapi_v1_msgs/msg/DoorStatusArray.md) @@ -27,9 +31,12 @@ - [autoware_adapi_v1_msgs/srv/AcceptStart](./autoware_adapi_v1_msgs/srv/AcceptStart.md) - [autoware_adapi_v1_msgs/srv/ChangeOperationMode](./autoware_adapi_v1_msgs/srv/ChangeOperationMode.md) - [autoware_adapi_v1_msgs/srv/ClearRoute](./autoware_adapi_v1_msgs/srv/ClearRoute.md) +- [autoware_adapi_v1_msgs/srv/GetCooperationPolicies](./autoware_adapi_v1_msgs/srv/GetCooperationPolicies.md) - [autoware_adapi_v1_msgs/srv/GetDoorLayout](./autoware_adapi_v1_msgs/srv/GetDoorLayout.md) - [autoware_adapi_v1_msgs/srv/GetVehicleDimensions](./autoware_adapi_v1_msgs/srv/GetVehicleDimensions.md) - [autoware_adapi_v1_msgs/srv/InitializeLocalization](./autoware_adapi_v1_msgs/srv/InitializeLocalization.md) +- [autoware_adapi_v1_msgs/srv/SetCooperationCommands](./autoware_adapi_v1_msgs/srv/SetCooperationCommands.md) +- [autoware_adapi_v1_msgs/srv/SetCooperationPolicies](./autoware_adapi_v1_msgs/srv/SetCooperationPolicies.md) - [autoware_adapi_v1_msgs/srv/SetRoute](./autoware_adapi_v1_msgs/srv/SetRoute.md) - [autoware_adapi_v1_msgs/srv/SetRoutePoints](./autoware_adapi_v1_msgs/srv/SetRoutePoints.md) - [autoware_adapi_version_msgs/srv/InterfaceVersion](./autoware_adapi_version_msgs/srv/InterfaceVersion.md) diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index 39dff9dfbdc..10e29784737 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -6,10 +6,10 @@ types: autoware_adapi_v1_msgs/msg/CooperationDecision: msg: decision: uint8 - autoware_adapi_v1_msgs/msg/CooperationDefault: + autoware_adapi_v1_msgs/msg/CooperationPolicy: msg: behavior: string - cooperator: autoware_adapi_v1_msgs/msg/CooperationDecision + type: uint8 autoware_adapi_v1_msgs/msg/CooperationStatus: msg: autonomous: autoware_adapi_v1_msgs/msg/CooperationDecision @@ -152,9 +152,10 @@ types: autoware_adapi_v1_msgs/srv/ClearRoute: res: status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/GetCooperationDefaults: + autoware_adapi_v1_msgs/srv/GetCooperationPolicies: res: - defaults: autoware_adapi_v1_msgs/msg/CooperationDefault[] + policies: autoware_adapi_v1_msgs/msg/CooperationPolicy[] + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/GetDoorLayout: res: doors: autoware_adapi_v1_msgs/msg/DoorLayout @@ -173,9 +174,9 @@ types: commands: autoware_adapi_v1_msgs/msg/CooperationCommand[] res: status: autoware_adapi_v1_msgs/msg/ResponseStatus - autoware_adapi_v1_msgs/srv/SetCooperationDefaults: + autoware_adapi_v1_msgs/srv/SetCooperationPolicies: req: - defaults: autoware_adapi_v1_msgs/msg/CooperationDefault[] + policies: autoware_adapi_v1_msgs/msg/CooperationPolicy[] res: status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/SetRoute: From 4d833e4215f5481a1b576a764f4c95bd598e85f8 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 5 Jul 2023 14:53:35 +0900 Subject: [PATCH 38/53] add version status Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation/get_policies.md | 1 + .../ad-api/list/api/planning/cooperation/set_commands.md | 1 + .../ad-api/list/api/planning/cooperation/set_policies.md | 1 + 3 files changed, 3 insertions(+) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md index 41d12944321..df65dc783e0 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md @@ -1,5 +1,6 @@ --- title: /api/planning/cooperation/get_policies +status: not released method: function call type: name: autoware_adapi_v1_msgs/srv/GetCooperationPolicies diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md index 4b42b76d6d5..bcca69658ed 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_commands.md @@ -1,5 +1,6 @@ --- title: /api/planning/cooperation/set_commands +status: not released method: function call type: name: autoware_adapi_v1_msgs/srv/SetCooperationCommands diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md index 6ba44d59bba..5d2947fc8c8 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md @@ -1,5 +1,6 @@ --- title: /api/planning/cooperation/set_policies +status: not released method: function call type: name: autoware_adapi_v1_msgs/srv/SetCooperationPolicies From 5f66ea5059e9744f6fa5cedf8234807070ba52af Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 12 Jul 2023 19:12:26 +0900 Subject: [PATCH 39/53] update use case Signed-off-by: Takagi, Isamu --- docs/design/autoware-interfaces/ad-api/index.md | 3 ++- .../ad-api/use-cases/request-to-cooperate.md | 7 ------- .../ad-api/use-cases/vehicle-operation.md | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 docs/design/autoware-interfaces/ad-api/use-cases/request-to-cooperate.md create mode 100644 docs/design/autoware-interfaces/ad-api/use-cases/vehicle-operation.md diff --git a/docs/design/autoware-interfaces/ad-api/index.md b/docs/design/autoware-interfaces/ad-api/index.md index 1ff4e4148cd..ccd5135a97e 100644 --- a/docs/design/autoware-interfaces/ad-api/index.md +++ b/docs/design/autoware-interfaces/ad-api/index.md @@ -25,7 +25,7 @@ Service providers can combine these use cases to define user stories and check i - [Drive to the designated position](./use-cases/drive-designated-position.md) - [Get on and get off](./use-cases/get-on-off.md) - [Vehicle monitoring](./use-cases/vehicle-monitoring.md) -- [Request to cooperate](./use-cases/request-to-cooperate.md) +- [Vehicle operation](./use-cases/vehicle-operation.md) ## Features @@ -35,5 +35,6 @@ Service providers can combine these use cases to define user stories and check i - [Localization](./features/localization.md) - [Motion](./features/motion.md) - [Planning](./features/planning-factors.md) +- [Cooperation](./features/cooperation.md) - [Fail-safe](./features/fail-safe.md) - [Vehicle status](./features/vehicle-status.md) diff --git a/docs/design/autoware-interfaces/ad-api/use-cases/request-to-cooperate.md b/docs/design/autoware-interfaces/ad-api/use-cases/request-to-cooperate.md deleted file mode 100644 index 7b0dc2385d3..00000000000 --- a/docs/design/autoware-interfaces/ad-api/use-cases/request-to-cooperate.md +++ /dev/null @@ -1,7 +0,0 @@ -# Request to cooperate - -!!! warning - - Under Construction - -AD API supports operator cooperation for vehicle decisions. diff --git a/docs/design/autoware-interfaces/ad-api/use-cases/vehicle-operation.md b/docs/design/autoware-interfaces/ad-api/use-cases/vehicle-operation.md new file mode 100644 index 00000000000..4cfb7b2639e --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/use-cases/vehicle-operation.md @@ -0,0 +1,14 @@ +# Vehicle operation + +## Request to intervene + +Request to intervene (RTI) is a feature that requires the operator to switch to manual driving mode. It is also called Take Over Request (TOR). +Interfaces for RTI are currently being discussed. For now assume that manual driving is requested if the MRM state is not NORMAL. +See [fail-safe](../features/fail-safe.md) for details. + +## Request to cooperate + +Request to cooperate (RTC) is a feature that the operator supports the decision in autonomous driving mode. +Autoware usually drives the vehicle using its own decisions, but the operator may prefer to make their own decisions in complex situations. +Since RTC only overrides the decision and does not need to change operation mode, the vehicle can continue autonomous driving, unlike RTC. +See [cooperation](../features/cooperation.md) for details. From 82d39bdaca5b9680e8185e5d56a070c22bcd6409 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 21 Jul 2023 17:19:57 +0900 Subject: [PATCH 40/53] update description Signed-off-by: Takagi, Isamu --- .../ad-api/features/cooperation.md | 38 +++-- .../cooperation/architecture.drawio.svg | 95 +++++------- .../features/cooperation/scenes.drawio.svg | 140 ++++++++++++++++++ 3 files changed, 207 insertions(+), 66 deletions(-) create mode 100644 docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index 8042f12ac6d..d1ef46be85d 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -10,22 +10,40 @@ ## 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. -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). +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. -![cooperation-architecture](./cooperation/architecture.drawio.svg) +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. + +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. +Here Autoware decides not to change lanes a second time due to the obstacle, so the vehicle will stop there. -## Scene ID +![cooperation-scenes](./cooperation/scenes.drawio.svg) -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. +## Architecture + +Modules that support RTC use the merged decisions shown in the following architecture instead of their own module decisions. +These modules provides [cooperation status](../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md) in [velocity factors or steering factors](./planning-factors.md), +and can receive the operator decision and cooperation policy. +The cooperation policy is used when there is no operator decision and has a default value set by the system settings. + +![cooperation-architecture](./cooperation/architecture.drawio.svg) + +The merged decision is determined from the module decision, operator decision, and cooperation policy. ## Decisions +| Name | Values | +| ------------------ | -------------------------------------- | +| merged decision | deactivate, activate | +| module decision | deactivate, activate | +| operator decision | deactivate, activate, autonomous, none | +| cooperation policy | required, optional | + The module decision is either deactivate or activate. The operator decision is also evaluated in one of these. 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. diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg index e92dab1c418..77f18865950 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation/architecture.drawio.svg @@ -1,9 +1,9 @@ - + - - - + + + @@ -27,11 +27,11 @@ - + -
+
merged decision @@ -39,16 +39,18 @@
- + merged decision - + + + -
+
cooperation policy @@ -59,20 +61,20 @@
- + cooperation policy - - - - - + + + + + -
+
operator @@ -80,37 +82,35 @@
- + operator - + -
+
- status + cooperation status
- - status + + cooperation stat... - - - - - + + + -
+
operator decision @@ -118,7 +118,7 @@
- + operator decision @@ -142,23 +142,6 @@ - - - - -
-
-
- use -
-
-
-
- - use - -
-
@@ -197,11 +180,11 @@ - + -
+
set decision @@ -209,16 +192,16 @@
- + set decision - + -
+
set policy @@ -226,7 +209,7 @@
- + set policy @@ -238,13 +221,13 @@
- for each module type + for each scene class
- for each module type + for each scene class @@ -255,13 +238,13 @@
- for each scene + for each scene instance
- for each scene + for each scene instance diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg new file mode 100644 index 00000000000..7a4567cb853 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ obstacle +
+
+
+
+ + obstacle + +
+
+ + + + + + + + + + +
+
+
+
+ Scene ID: AAAA +
+
+ Behavior: lane-change +
+
+ Decision: activate +
+
+
+
+
+ + Scene ID: AAAA... + +
+
+ + + + + +
+
+
+ Scene ID + + : BBBB + +
+
+ Behavior: lane-change +
+
+ Decision: deactivate +
+
+
+
+
+ + Scene ID: BBBB... + +
+
+ + + + + +
+
+
+ Scene ID + + : CCCC + +
+
+ Behavior: intersection +
+
+ Decision: activate +
+
+
+
+
+ + Scene ID: CCCC... + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file From dba2f82f769d19c3969df7f9b493872d5d3f19ea Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Fri, 21 Jul 2023 22:45:21 +0900 Subject: [PATCH 41/53] update description Signed-off-by: Takagi, Isamu --- .../autoware-interfaces/ad-api/features/cooperation.md | 10 ++++++---- .../ad-api/features/cooperation/scenes.drawio.svg | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index d1ef46be85d..e61096713ca 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -26,14 +26,16 @@ Here Autoware decides not to change lanes a second time due to the obstacle, so ## Architecture -Modules that support RTC use the merged decisions shown in the following architecture instead of their own module decisions. -These modules provides [cooperation status](../types/autoware_adapi_v1_msgs/msg/CooperationStatus.md) in [velocity factors or steering factors](./planning-factors.md), -and can receive the operator decision and cooperation policy. +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 instead of module decision when planning vehicle behavior. 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) -The merged decision is determined from the module decision, operator decision, and cooperation policy. +## Sequence + +T.B.D. ## Decisions diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg index 7a4567cb853..7c20b7c9962 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg @@ -1,4 +1,4 @@ - + From 6ba32d9e8fd30350be14096659975cfb89a89cf3 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 26 Jul 2023 10:21:36 +0900 Subject: [PATCH 42/53] update description Signed-off-by: Takagi, Isamu --- .../ad-api/features/cooperation.md | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index e61096713ca..b5cd9b27b2b 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -27,18 +27,33 @@ Here Autoware decides not to change lanes a second time due to the obstacle, so ## 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 instead of module decision when planning vehicle behavior. +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) . +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 -T.B.D. +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. + +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. +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 +There are four variables used for RTC, each of which takes the value shown in the table. + | Name | Values | | ------------------ | -------------------------------------- | | merged decision | deactivate, activate | @@ -46,7 +61,6 @@ T.B.D. | operator decision | deactivate, activate, autonomous, none | | cooperation policy | required, optional | -The module decision is either deactivate or activate. The operator decision is also evaluated in one of these. 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. From 154bb633490fd7ae7bc0ad88dc281422b5984680 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 26 Jul 2023 13:54:08 +0900 Subject: [PATCH 43/53] update description Signed-off-by: Takagi, Isamu --- .../ad-api/features/cooperation.md | 53 ++- .../features/cooperation/decisions.drawio.svg | 337 ++++++++++++++++++ .../features/cooperation/state.drawio.svg | 297 --------------- 3 files changed, 359 insertions(+), 328 deletions(-) create mode 100644 docs/design/autoware-interfaces/ad-api/features/cooperation/decisions.drawio.svg delete mode 100644 docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index b5cd9b27b2b..84b98a4c679 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -52,49 +52,40 @@ Here is an example sequence that overrides the scene decision to force a lane ch ## Decisions -There are four variables used for RTC, each of which takes the value shown in the table. +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. -| Name | Values | +| Status | Values | | ------------------ | -------------------------------------- | | merged decision | deactivate, activate | | module decision | deactivate, activate | | operator decision | deactivate, activate, autonomous, none | | cooperation policy | required, optional | -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. +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. -| Factor Type | Deactivate | Activate | -| --------------- | ------------- | --------------- | -| velocity (stop) | stop | pass | -| steering (path) | keep the path | change the path | +| 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 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 following flow is how the merged decision is determined. -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) +![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 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. | +| 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. | diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/decisions.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/decisions.drawio.svg new file mode 100644 index 00000000000..14ce9fee5f4 --- /dev/null +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation/decisions.drawio.svg @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + +
+
+
+ Check the operator decision. +
+
+
+
+ + Check the operator decision. + +
+
+ + + + + + + + + + + + + + + +
+
+
+ Check the cooperation policy. +
+
+
+
+ + Check the cooperation policy. + +
+
+ + + + +
+
+
+ [autonomous] +
+
+
+
+ + [autonomous] + +
+
+ + + + + + +
+
+
+ The merged decision is deactivate +
+ by the cooperation policy. +
+
+
+
+ + The merged decision is deactivate... + +
+
+ + + + +
+
+
+ [optional] +
+
+
+
+ + [optional] + +
+
+ + + + + + +
+
+
+ The merged decision is activate +
+ by the operator decision. +
+
+
+
+ + The merged decision is activate... + +
+
+ + + + + + + + + +
+
+
+ [none] +
+
+
+
+ + [none] + +
+
+ + + + +
+
+
+ [deactivate] +
+
+
+
+ + [deactivate] + +
+
+ + + + +
+
+
+ [activate] +
+
+
+
+ + [activate] + +
+
+ + + + +
+
+
+ + [required] + +
+
+
+
+ + [required] + +
+
+ + + + +
+
+
+ [deactivate] +
+
+
+
+ + [deactivate] + +
+
+ + + + + + +
+
+
+ Check the module decision. +
+
+
+
+ + Check the module decision. + +
+
+ + + + + + + + + + + +
+
+
+ The merged decision is activate +
+ by the module decision. +
+
+
+
+ + The merged decision is activate... + +
+
+ + + + + + +
+
+
+ The merged decision is deactivate +
+ by the module decision. +
+
+
+
+ + The merged decision is deactivate... + +
+
+ + + + + + +
+
+
+ The merged decision is deactivate +
+ by the operator decision. +
+
+
+
+ + The merged decision is deactivate... + +
+
+ + + + +
+
+
+ [activate] +
+
+
+
+ + [activate] + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg deleted file mode 100644 index f83729c9778..00000000000 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation/state.drawio.svg +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - -
-
-
- operator decision -
-
-
-
- - operator decision - -
-
- - - - -
-
-
- decided -
-
-
-
- - decided - -
-
- - - - -
-
-
- module decision -
-
-
-
- - module decision - -
-
- - - - -
-
-
- - cooperation policy - -
-
-
-
- - cooperation policy - -
-
- - - - - - - - - - - -
-
-
- none -
-
-
-
- - none - -
-
- - - - - - - - - -
-
-
- deactivate -
-
-
-
- - deactivate - -
-
- - - - - - -
-
-
- autonomous -
-
-
-
- - autonomous - -
-
- - - - - - - -
-
-
- activate -
-
-
-
- - activate - -
-
- - - - - - - -
-
-
- required -
-
-
-
- - required - -
-
- - - - - - -
-
-
- optional -
-
-
-
- - optional - -
-
- - - - - - - -
-
-
- deactivate -
-
-
-
- - deactivate - -
-
- - - - -
-
-
- use -
-
-
-
- - use - -
-
- - - - - - -
-
-
- activate -
-
-
-
- - activate - -
-
- - - - -
-
-
- use -
-
-
-
- - use - -
-
- - - - -
-
-
- use -
-
-
-
- - use - -
-
-
- - - - - Text is not SVG - cannot display - - - -
\ No newline at end of file From 6d5754bf84fbab868bbc02e852135d0a35b54f4f Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" <43976882+isamu-takagi@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:21:52 +0900 Subject: [PATCH 44/53] Update docs/design/autoware-interfaces/ad-api/features/cooperation.md Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> --- .../design/autoware-interfaces/ad-api/features/cooperation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index 84b98a4c679..1403670e73c 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -10,10 +10,10 @@ ## 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. +Request to cooperate (RTC) is a feature that enables a human operator to support the decision in autonomous driving mode. Autoware usually drives the vehicle using its own decisions, but the operator may prefer to make their decisions in experiments and complex situations. +The planning component manages each situation that requires decision as a scene. 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. From a0bb7e8645bacfd4aa9803905fa33cd9c508aa3b Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 2 Aug 2023 13:58:32 +0900 Subject: [PATCH 45/53] update scenes diagram Signed-off-by: Takagi, Isamu --- .../features/cooperation/scenes.drawio.svg | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg b/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg index 7c20b7c9962..9b813850ed5 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation/scenes.drawio.svg @@ -1,4 +1,4 @@ - + @@ -24,11 +24,11 @@ - + -
+
obstacle @@ -36,7 +36,7 @@
- + obstacle @@ -55,7 +55,7 @@
- Scene ID: AAAA + Scene ID: 1234
Behavior: lane-change @@ -68,7 +68,7 @@
- Scene ID: AAAA... + Scene ID: 1234... @@ -82,7 +82,7 @@
Scene ID - : BBBB + : 5678
@@ -96,7 +96,7 @@
- Scene ID: BBBB... + Scene ID: 5678... @@ -110,7 +110,7 @@
Scene ID - : CCCC + : ABCD
@@ -124,7 +124,7 @@
- Scene ID: CCCC... + Scene ID: ABCD... From 2e4095a68daf18cbfa426a3d9e447bbb43311534 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 2 Aug 2023 13:58:40 +0900 Subject: [PATCH 46/53] update sequence Signed-off-by: Takagi, Isamu --- .../ad-api/features/cooperation.md | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index 1403670e73c..9f55213b307 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -36,19 +36,20 @@ If the module supports RTC, these information are available in [velocity factors ## 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. - -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. +This is an example sequence that overrides the scene decision to force a lane change. It is for the second scene in the diagram in the architecture section. +Here let's assume the cooperation policy is set to optional, see the decisions section described later for details. + +1. A planning module creates a scene instance with unique ID when approaching a place where a lane change is needed. +2. The scene instance generates the module decision from the current situation. In this case, the module decision is not to do a lane change due to the obstacle. +3. The scene instance generates the merged decision. At this point, there is no operator decision yet, so it is based on the module decision. +4. The scene instance plans the vehicle to keep the lane according to the merged decision. +5. The scene instance sends a cooperation status. 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. +7. The operator sends a cooperation command to override the module decision and to do a lane change. +8. The scene instance receives the cooperation command and update the operator decision. +9. The scene instance updates the module decision from the current situation. +10. The scene instance updates the merged decision. It is based on the operator decision received. +11. The scene instance plans the vehicle to change the lane according to the merged decision. ## Decisions From a740bfc65a6965c4ecbb538c8aaa4abc05a8c071 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 2 Aug 2023 14:07:48 +0900 Subject: [PATCH 47/53] update description Signed-off-by: Takagi, Isamu --- docs/design/autoware-interfaces/ad-api/features/cooperation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index 9f55213b307..aa668383651 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -21,6 +21,7 @@ In practice, the user interface application can hides the specification of the I 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. Here Autoware decides not to change lanes a second time due to the obstacle, so the vehicle will stop there. +Using RTC, the operator can override these decisions to continue driving the vehicle to the goal. ![cooperation-scenes](./cooperation/scenes.drawio.svg) From 27cf05231d005f6b3f12bb755c7027ed16b3c3e9 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" <43976882+isamu-takagi@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:13:16 +0900 Subject: [PATCH 48/53] Update docs/design/autoware-interfaces/ad-api/features/cooperation.md Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> --- docs/design/autoware-interfaces/ad-api/features/cooperation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index aa668383651..d55413cff90 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -21,6 +21,7 @@ In practice, the user interface application can hides the specification of the I 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. Here Autoware decides not to change lanes a second time due to the obstacle, so the vehicle will stop there. +However, operator could overwrite that decision through RTC function and force the lane change so that vehicle could reach to it's goal. Using RTC, the operator can override these decisions to continue driving the vehicle to the goal. ![cooperation-scenes](./cooperation/scenes.drawio.svg) From 1d06ce90e41dc7ea8d43218d3107a66013a93583 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 30 Aug 2023 15:53:02 +0900 Subject: [PATCH 49/53] generate interface documents Signed-off-by: Takagi, Isamu --- docs/design/autoware-interfaces/ad-api/list/index.md | 2 +- yaml/autoware-interfaces.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/index.md b/docs/design/autoware-interfaces/ad-api/list/index.md index 67c45b0a65b..a95a73b670b 100644 --- a/docs/design/autoware-interfaces/ad-api/list/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/index.md @@ -13,10 +13,10 @@ - [/api/operation_mode/disable_autoware_control](./api/operation_mode/disable_autoware_control.md) - [/api/operation_mode/enable_autoware_control](./api/operation_mode/enable_autoware_control.md) - [/api/operation_mode/state](./api/operation_mode/state.md) +- [/api/perception/objects](./api/perception/objects.md) - [/api/planning/cooperation/get_policies](./api/planning/cooperation/get_policies.md) - [/api/planning/cooperation/set_commands](./api/planning/cooperation/set_commands.md) - [/api/planning/cooperation/set_policies](./api/planning/cooperation/set_policies.md) -- [/api/perception/objects](./api/perception/objects.md) - [/api/planning/steering_factors](./api/planning/steering_factors.md) - [/api/planning/velocity_factors](./api/planning/velocity_factors.md) - [/api/routing/clear_route](./api/routing/clear_route.md) diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index de57514f3ea..11aed1328e3 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -207,6 +207,8 @@ types: autoware_adapi_v1_msgs/srv/SetCooperationPolicies: req: policies: autoware_adapi_v1_msgs/msg/CooperationPolicy[] + res: + status: autoware_adapi_v1_msgs/msg/ResponseStatus autoware_adapi_v1_msgs/srv/SetDoorCommand: req: doors: autoware_adapi_v1_msgs/msg/DoorCommand[] From 35f3f7e4d0c746c5272453dd3ee658f4119c440e Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" <43976882+isamu-takagi@users.noreply.github.com> Date: Mon, 4 Sep 2023 13:38:21 +0900 Subject: [PATCH 50/53] Update docs/design/autoware-interfaces/ad-api/features/cooperation.md Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> --- .../design/autoware-interfaces/ad-api/features/cooperation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index d55413cff90..a0bc6246f9f 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -18,8 +18,8 @@ Each scene has an ID that doesn't change until the scene is completed or cancele 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. -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. +For example, in the situation in the diagram below, vehicle is expected to make two lane changes and turning left at the intersection. +Therefore the planning component generates three scene instances for each required action, and each scene instance will wait for the decision to be made, in this case "changing or keeping lane" and "turning left or waiting at the intersection". Here Autoware decides not to change lanes a second time due to the obstacle, so the vehicle will stop there. However, operator could overwrite that decision through RTC function and force the lane change so that vehicle could reach to it's goal. Using RTC, the operator can override these decisions to continue driving the vehicle to the goal. From 4fcb02532a6dc913f04425d9b74393f5e1e4c823 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Mon, 4 Sep 2023 13:41:05 +0900 Subject: [PATCH 51/53] fix pre-commit --- docs/design/autoware-interfaces/ad-api/features/cooperation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/design/autoware-interfaces/ad-api/features/cooperation.md b/docs/design/autoware-interfaces/ad-api/features/cooperation.md index a0bc6246f9f..b094e41340f 100644 --- a/docs/design/autoware-interfaces/ad-api/features/cooperation.md +++ b/docs/design/autoware-interfaces/ad-api/features/cooperation.md @@ -21,7 +21,7 @@ In practice, the user interface application can hides the specification of the I For example, in the situation in the diagram below, vehicle is expected to make two lane changes and turning left at the intersection. Therefore the planning component generates three scene instances for each required action, and each scene instance will wait for the decision to be made, in this case "changing or keeping lane" and "turning left or waiting at the intersection". Here Autoware decides not to change lanes a second time due to the obstacle, so the vehicle will stop there. -However, operator could overwrite that decision through RTC function and force the lane change so that vehicle could reach to it's goal. +However, operator could overwrite that decision through RTC function and force the lane change so that vehicle could reach to it's goal. Using RTC, the operator can override these decisions to continue driving the vehicle to the goal. ![cooperation-scenes](./cooperation/scenes.drawio.svg) From 7e92dbc4ce8380d19a61abf7dcde5d7d37264a96 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 5 Sep 2023 14:22:00 +0900 Subject: [PATCH 52/53] update Signed-off-by: Takagi, Isamu --- .../types/autoware_adapi_v1_msgs/msg/CooperationDecision.md | 2 -- .../types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md | 3 ++- yaml/autoware-interfaces.yaml | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md index 5f99788bca5..1725dd81f79 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationDecision.md @@ -10,14 +10,12 @@ used: {% block definition %} ```txt -# constants uint8 UNKNOWN = 0 uint8 DEACTIVATE = 1 uint8 ACTIVATE = 2 uint8 AUTONOMOUS = 3 uint8 UNDECIDED = 4 -# variables uint8 decision ``` diff --git a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md index cf410cd08e8..58bfbc9ae8d 100644 --- a/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md +++ b/docs/design/autoware-interfaces/ad-api/types/autoware_adapi_v1_msgs/msg/CooperationPolicy.md @@ -14,7 +14,8 @@ uint8 OPTIONAL = 1 uint8 REQUIRED = 2 string behavior -uint8 type +string sequence +uint8 policy ``` {% endblock %} diff --git a/yaml/autoware-interfaces.yaml b/yaml/autoware-interfaces.yaml index 11aed1328e3..7ee9a89be63 100644 --- a/yaml/autoware-interfaces.yaml +++ b/yaml/autoware-interfaces.yaml @@ -9,7 +9,8 @@ types: autoware_adapi_v1_msgs/msg/CooperationPolicy: msg: behavior: string - type: uint8 + policy: uint8 + sequence: string autoware_adapi_v1_msgs/msg/CooperationStatus: msg: autonomous: autoware_adapi_v1_msgs/msg/CooperationDecision From 68b0fb2754eb867cf72ede523e21388da15cb310 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Tue, 5 Sep 2023 20:08:36 +0900 Subject: [PATCH 53/53] fix field name Signed-off-by: Takagi, Isamu --- .../ad-api/list/api/planning/cooperation/get_policies.md | 4 +++- .../ad-api/list/api/planning/cooperation/set_policies.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md index df65dc783e0..6ffce00a8a1 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/get_policies.md @@ -9,7 +9,9 @@ type: text: response status - name: policies.behavior text: The type of the target behavior. - - name: policies.type + - name: policies.sequence + text: The type of the target sequence. + - name: policies.policy text: The type of the cooporation policy. --- diff --git a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md index 5d2947fc8c8..463bf6af96c 100644 --- a/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md +++ b/docs/design/autoware-interfaces/ad-api/list/api/planning/cooperation/set_policies.md @@ -7,7 +7,9 @@ type: req: - name: policies.behavior text: The type of the target behavior. - - name: policies.type + - name: policies.sequence + text: The type of the target sequence. + - name: policies.policy text: The type of the cooporation policy. res: - name: status