diff --git a/docs/design/autoware-interfaces/ad-api/list/index.md b/docs/design/autoware-interfaces/ad-api/list/index.md index 985452b2df4..e9737114e3d 100644 --- a/docs/design/autoware-interfaces/ad-api/list/index.md +++ b/docs/design/autoware-interfaces/ad-api/list/index.md @@ -1,39 +1,39 @@ # List of Autoware AD API -| API | Release | -| ------------------------------------------------------------------------------------------------ | ------------ | -| [/api/fail_safe/mrm_state](./api/fail_safe/mrm_state.md) | v1.1.0 | -| [/api/interface/version](./api/interface/version.md) | v1.0.0 | -| [/api/localization/initialization_state](./api/localization/initialization_state.md) | v1.0.0 | -| [/api/localization/initialize](./api/localization/initialize.md) | v1.0.0 | -| [/api/motion/accept_start](./api/motion/accept_start.md) | not released | -| [/api/motion/state](./api/motion/state.md) | not released | -| [/api/operation_mode/change_to_autonomous](./api/operation_mode/change_to_autonomous.md) | v1.0.0 | -| [/api/operation_mode/change_to_local](./api/operation_mode/change_to_local.md) | v1.0.0 | -| [/api/operation_mode/change_to_remote](./api/operation_mode/change_to_remote.md) | v1.0.0 | -| [/api/operation_mode/change_to_stop](./api/operation_mode/change_to_stop.md) | v1.0.0 | -| [/api/operation_mode/disable_autoware_control](./api/operation_mode/disable_autoware_control.md) | v1.0.0 | -| [/api/operation_mode/enable_autoware_control](./api/operation_mode/enable_autoware_control.md) | v1.0.0 | -| [/api/operation_mode/state](./api/operation_mode/state.md) | v1.0.0 | -| [/api/perception/objects](./api/perception/objects.md) | not released | -| [/api/planning/cooperation/get_policies](./api/planning/cooperation/get_policies.md) | not released | -| [/api/planning/cooperation/set_commands](./api/planning/cooperation/set_commands.md) | not released | -| [/api/planning/cooperation/set_policies](./api/planning/cooperation/set_policies.md) | not released | -| [/api/planning/steering_factors](./api/planning/steering_factors.md) | not released | -| [/api/planning/velocity_factors](./api/planning/velocity_factors.md) | not released | -| [/api/routing/change_route](./api/routing/change_route.md) | v1.5.0 | -| [/api/routing/change_route_points](./api/routing/change_route_points.md) | v1.5.0 | -| [/api/routing/clear_route](./api/routing/clear_route.md) | v1.0.0 | -| [/api/routing/route](./api/routing/route.md) | v1.0.0 | -| [/api/routing/set_route](./api/routing/set_route.md) | v1.0.0 | -| [/api/routing/set_route_points](./api/routing/set_route_points.md) | v1.0.0 | -| [/api/routing/state](./api/routing/state.md) | v1.0.0 | -| [/api/system/diagnostics/status](./api/system/diagnostics/status.md) | v1.3.0 | -| [/api/system/diagnostics/struct](./api/system/diagnostics/struct.md) | v1.3.0 | -| [/api/system/heartbeat](./api/system/heartbeat.md) | v1.3.0 | -| [/api/vehicle/dimensions](./api/vehicle/dimensions.md) | v1.1.0 | -| [/api/vehicle/doors/command](./api/vehicle/doors/command.md) | v1.2.0 | -| [/api/vehicle/doors/layout](./api/vehicle/doors/layout.md) | v1.2.0 | -| [/api/vehicle/doors/status](./api/vehicle/doors/status.md) | v1.2.0 | -| [/api/vehicle/kinematics](./api/vehicle/kinematics.md) | v1.1.0 | -| [/api/vehicle/status](./api/vehicle/status.md) | v1.4.0 | +| API | Release | Method | +| ------------------------------------------------------------------------------------------------ | ------------ | --------------- | +| [/api/fail_safe/mrm_state](./api/fail_safe/mrm_state.md) | v1.1.0 | notification | +| [/api/interface/version](./api/interface/version.md) | v1.0.0 | function call | +| [/api/localization/initialization_state](./api/localization/initialization_state.md) | v1.0.0 | notification | +| [/api/localization/initialize](./api/localization/initialize.md) | v1.0.0 | function call | +| [/api/motion/accept_start](./api/motion/accept_start.md) | not released | function call | +| [/api/motion/state](./api/motion/state.md) | not released | notification | +| [/api/operation_mode/change_to_autonomous](./api/operation_mode/change_to_autonomous.md) | v1.0.0 | function call | +| [/api/operation_mode/change_to_local](./api/operation_mode/change_to_local.md) | v1.0.0 | function call | +| [/api/operation_mode/change_to_remote](./api/operation_mode/change_to_remote.md) | v1.0.0 | function call | +| [/api/operation_mode/change_to_stop](./api/operation_mode/change_to_stop.md) | v1.0.0 | function call | +| [/api/operation_mode/disable_autoware_control](./api/operation_mode/disable_autoware_control.md) | v1.0.0 | function call | +| [/api/operation_mode/enable_autoware_control](./api/operation_mode/enable_autoware_control.md) | v1.0.0 | function call | +| [/api/operation_mode/state](./api/operation_mode/state.md) | v1.0.0 | notification | +| [/api/perception/objects](./api/perception/objects.md) | not released | realtime stream | +| [/api/planning/cooperation/get_policies](./api/planning/cooperation/get_policies.md) | not released | function call | +| [/api/planning/cooperation/set_commands](./api/planning/cooperation/set_commands.md) | not released | function call | +| [/api/planning/cooperation/set_policies](./api/planning/cooperation/set_policies.md) | not released | function call | +| [/api/planning/steering_factors](./api/planning/steering_factors.md) | not released | realtime stream | +| [/api/planning/velocity_factors](./api/planning/velocity_factors.md) | not released | realtime stream | +| [/api/routing/change_route](./api/routing/change_route.md) | v1.5.0 | function call | +| [/api/routing/change_route_points](./api/routing/change_route_points.md) | v1.5.0 | function call | +| [/api/routing/clear_route](./api/routing/clear_route.md) | v1.0.0 | function call | +| [/api/routing/route](./api/routing/route.md) | v1.0.0 | notification | +| [/api/routing/set_route](./api/routing/set_route.md) | v1.0.0 | function call | +| [/api/routing/set_route_points](./api/routing/set_route_points.md) | v1.0.0 | function call | +| [/api/routing/state](./api/routing/state.md) | v1.0.0 | notification | +| [/api/system/diagnostics/status](./api/system/diagnostics/status.md) | v1.3.0 | realtime stream | +| [/api/system/diagnostics/struct](./api/system/diagnostics/struct.md) | v1.3.0 | notification | +| [/api/system/heartbeat](./api/system/heartbeat.md) | v1.3.0 | realtime stream | +| [/api/vehicle/dimensions](./api/vehicle/dimensions.md) | v1.1.0 | function call | +| [/api/vehicle/doors/command](./api/vehicle/doors/command.md) | v1.2.0 | function call | +| [/api/vehicle/doors/layout](./api/vehicle/doors/layout.md) | v1.2.0 | function call | +| [/api/vehicle/doors/status](./api/vehicle/doors/status.md) | v1.2.0 | notification | +| [/api/vehicle/kinematics](./api/vehicle/kinematics.md) | v1.1.0 | realtime stream | +| [/api/vehicle/status](./api/vehicle/status.md) | v1.4.0 | realtime stream | diff --git a/tools/autoware-interfaces/generate.py b/tools/autoware-interfaces/generate.py index 3fe256deacd..b4acc652c65 100755 --- a/tools/autoware-interfaces/generate.py +++ b/tools/autoware-interfaces/generate.py @@ -102,12 +102,7 @@ def tabulate(data, header): return "\n".join(format.format(*line) for line in [header, border, *data]) -def main(): - # Create a list of data types used in adapi. - adapi = Path("docs/design/autoware-interfaces/ad-api/list/api") - pages = (load_markdown_metadata(path) for path in adapi.glob("**/*.md")) - pages = [page for page in pages if page] - +def update_type_page(pages): # Create a field list for each data type. names = (page["type"]["name"] for page in pages) specs = {} @@ -158,18 +153,32 @@ def main(): path.parent.mkdir(parents=True, exist_ok=True) path.write_text(text) + ## Generate api type page. + text = "# Types of Autoware AD API\n\n" + for spec in sorted(specs): + text += f"- [{spec}](./{spec}.md)\n" + Path("docs/design/autoware-interfaces/ad-api/types/index.md").write_text(text) + + +def update_list_page(pages): ## Generate api list page. data = [] for page in sorted(pages, key=lambda page: page["title"]): title = page["title"] - data.append([f"[{title}](.{title}.md)", page['status']]) - text = "# List of Autoware AD API\n\n" + tabulate(data, ["API", "Release"]) + "\n" + data.append([f"[{title}](.{title}.md)", page["status"], page["method"]]) + text = "# List of Autoware AD API\n\n" + tabulate(data, ["API", "Release", "Method"]) + "\n" Path("docs/design/autoware-interfaces/ad-api/list/index.md").write_text(text) - ## Generate api type page. - text = "# Types of Autoware AD API\n\n" - for spec in sorted(specs): - text += f"- [{spec}](./{spec}.md)\n" - Path("docs/design/autoware-interfaces/ad-api/types/index.md").write_text(text) + +def main(): + # Create a list of data types used in adapi. + adapi = Path("docs/design/autoware-interfaces/ad-api/list/api") + pages = (load_markdown_metadata(path) for path in adapi.glob("**/*.md")) + pages = [page for page in pages if page] + + update_list_page(pages) + update_type_page(pages) + + main()