Skip to content

Commit

Permalink
feat(ad-api): add method to list page (autowarefoundation#630)
Browse files Browse the repository at this point in the history
* feat(ad-api): add method column to list page

Signed-off-by: Takagi, Isamu <[email protected]>

* update api list page

Signed-off-by: Takagi, Isamu <[email protected]>

---------

Signed-off-by: Takagi, Isamu <[email protected]>
  • Loading branch information
isamu-takagi authored Nov 28, 2024
1 parent 6b3260e commit c295a7e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 50 deletions.
74 changes: 37 additions & 37 deletions docs/design/autoware-interfaces/ad-api/list/index.md
Original file line number Diff line number Diff line change
@@ -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 |
35 changes: 22 additions & 13 deletions tools/autoware-interfaces/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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()

0 comments on commit c295a7e

Please sign in to comment.