Skip to content

feat(ad-api): update diagnostics api #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/design/autoware-interfaces/ad-api/features/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- {{ link_ad_api('/api/system/diagnostics/struct') }}
- {{ link_ad_api('/api/system/diagnostics/status') }}
- {{ link_ad_api('/api/system/diagnostics/reset') }}

## Description

Expand All @@ -19,9 +20,16 @@ For error level, the same value as `diagnostic_msgs/msg/DiagnosticStatus` is use

The diagnostics data has static and dynamic parts, so the API provides these separately for efficiency.
Below is an example of a message that corresponds to the above diagram.
The static part of the diagnostic is published only once as the DiagGraphStruct that contains nodes and links.
The links specify dependencies between nodes by index into an array of nodes.
The static part of the diagnostic is published only once as the DiagGraphStruct that contains nodes, diags, and links.
The links specify dependencies between nodes and nodes/diags by index into an array of them.
Note that the index for diags is offset by the size of the nodes.
The dynamic part of the diagnostic is published periodically as DiagGraphStatus.
The status has an array of nodes of the same length as the struct, with the same index representing the same functional unit.
The status has nodes and diags of the same length as the struct, with the same index representing the same functional unit.

![graph-data](./diagnostics/data.drawio.svg)

Some functional unit levels may be latched. If the abnormality continues for a certain period, the level value will not return to normal.
Use input_level to know the level before it was latched. Also, use latch_level to know if the latch is currently activated.
To restore the level after the latch has been activated, use the reset API.

![level](./diagnostics/level.drawio.svg)
3,756 changes: 2,738 additions & 1,018 deletions docs/design/autoware-interfaces/ad-api/features/diagnostics/data.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,763 changes: 1,261 additions & 502 deletions docs/design/autoware-interfaces/ad-api/features/diagnostics/tree.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: /api/system/diagnostics/reset
status: not released
method: function call
type:
name: autoware_adapi_v1_msgs/srv/ResetDiagGraph
res:
- name: status
text: response status
---

{% extends 'design/autoware-interfaces/templates/autoware-interface.jinja2' %}
{% block description %}
Reset the latch state of the diagnostic graph.
See [diagnostics](../../../../features/diagnostics.md) for details.
{% endblock %}
1 change: 1 addition & 0 deletions docs/design/autoware-interfaces/ad-api/list/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
| [/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/reset](./api/system/diagnostics/reset.md) | not released | function call |
| [/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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# This file is generated by tools/autoware-interfaces/generate.py
title: autoware_adapi_v1_msgs/msg/DiagGraphStatus
uses:
- autoware_adapi_v1_msgs/msg/DiagLeafStatus
- autoware_adapi_v1_msgs/msg/DiagNodeStatus
---

Expand All @@ -12,6 +13,7 @@ uses:
builtin_interfaces/Time stamp
string id
autoware_adapi_v1_msgs/DiagNodeStatus[] nodes
autoware_adapi_v1_msgs/DiagLeafStatus[] diags
```

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# This file is generated by tools/autoware-interfaces/generate.py
title: autoware_adapi_v1_msgs/msg/DiagGraphStruct
uses:
- autoware_adapi_v1_msgs/msg/DiagLeafStruct
- autoware_adapi_v1_msgs/msg/DiagLinkStruct
- autoware_adapi_v1_msgs/msg/DiagNodeStruct
---
Expand All @@ -13,6 +14,7 @@ uses:
builtin_interfaces/Time stamp
string id
autoware_adapi_v1_msgs/DiagNodeStruct[] nodes
autoware_adapi_v1_msgs/DiagLeafStruct[] diags
autoware_adapi_v1_msgs/DiagLinkStruct[] links
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# This file is generated by tools/autoware-interfaces/generate.py
title: autoware_adapi_v1_msgs/msg/DiagLeafStatus
used:
- autoware_adapi_v1_msgs/msg/DiagGraphStatus
uses:
- autoware_adapi_v1_msgs/msg/KvString
---

{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}
{% block definition %}

```txt
# The level of diagnostic_msgs/msg/DiagnosticStatus.
byte level
byte input_level
string message
string hardware_id
autoware_adapi_v1_msgs/KvString[] values
```

{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# This file is generated by tools/autoware-interfaces/generate.py
title: autoware_adapi_v1_msgs/msg/DiagLeafStruct
used:
- autoware_adapi_v1_msgs/msg/DiagGraphStruct
---

{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}
{% block definition %}

```txt
string name
```

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ used:
```txt
# The level of diagnostic_msgs/msg/DiagnosticStatus.
byte level
byte input_level
byte latch_level
bool is_dependent
```

{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# This file is generated by tools/autoware-interfaces/generate.py
title: autoware_adapi_v1_msgs/msg/KvString
used:
- autoware_adapi_v1_msgs/msg/DiagLeafStatus
---

{% extends 'design/autoware-interfaces/templates/autoware-data-type.jinja2' %}
{% block definition %}

```txt
string key
string value
```

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ used:
- autoware_adapi_v1_msgs/srv/GetVehicleSpecs
- autoware_adapi_v1_msgs/srv/InitializeLocalization
- autoware_adapi_v1_msgs/srv/ListManualControlMode
- autoware_adapi_v1_msgs/srv/ResetDiagGraph
- autoware_adapi_v1_msgs/srv/SelectManualControlMode
- autoware_adapi_v1_msgs/srv/SendMrmRequest
- autoware_adapi_v1_msgs/srv/SetCooperationCommands
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# This file is generated by tools/autoware-interfaces/generate.py
title: autoware_adapi_v1_msgs/srv/ResetDiagGraph
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 %}
4 changes: 4 additions & 0 deletions docs/design/autoware-interfaces/ad-api/types/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- [autoware_adapi_v1_msgs/msg/CooperationStatus](./autoware_adapi_v1_msgs/msg/CooperationStatus.md)
- [autoware_adapi_v1_msgs/msg/DiagGraphStatus](./autoware_adapi_v1_msgs/msg/DiagGraphStatus.md)
- [autoware_adapi_v1_msgs/msg/DiagGraphStruct](./autoware_adapi_v1_msgs/msg/DiagGraphStruct.md)
- [autoware_adapi_v1_msgs/msg/DiagLeafStatus](./autoware_adapi_v1_msgs/msg/DiagLeafStatus.md)
- [autoware_adapi_v1_msgs/msg/DiagLeafStruct](./autoware_adapi_v1_msgs/msg/DiagLeafStruct.md)
- [autoware_adapi_v1_msgs/msg/DiagLinkStruct](./autoware_adapi_v1_msgs/msg/DiagLinkStruct.md)
- [autoware_adapi_v1_msgs/msg/DiagNodeStatus](./autoware_adapi_v1_msgs/msg/DiagNodeStatus.md)
- [autoware_adapi_v1_msgs/msg/DiagNodeStruct](./autoware_adapi_v1_msgs/msg/DiagNodeStruct.md)
Expand All @@ -23,6 +25,7 @@
- [autoware_adapi_v1_msgs/msg/HazardLights](./autoware_adapi_v1_msgs/msg/HazardLights.md)
- [autoware_adapi_v1_msgs/msg/HazardLightsCommand](./autoware_adapi_v1_msgs/msg/HazardLightsCommand.md)
- [autoware_adapi_v1_msgs/msg/Heartbeat](./autoware_adapi_v1_msgs/msg/Heartbeat.md)
- [autoware_adapi_v1_msgs/msg/KvString](./autoware_adapi_v1_msgs/msg/KvString.md)
- [autoware_adapi_v1_msgs/msg/LocalizationInitializationState](./autoware_adapi_v1_msgs/msg/LocalizationInitializationState.md)
- [autoware_adapi_v1_msgs/msg/ManualControlMode](./autoware_adapi_v1_msgs/msg/ManualControlMode.md)
- [autoware_adapi_v1_msgs/msg/ManualControlModeStatus](./autoware_adapi_v1_msgs/msg/ManualControlModeStatus.md)
Expand Down Expand Up @@ -64,6 +67,7 @@
- [autoware_adapi_v1_msgs/srv/GetVehicleSpecs](./autoware_adapi_v1_msgs/srv/GetVehicleSpecs.md)
- [autoware_adapi_v1_msgs/srv/InitializeLocalization](./autoware_adapi_v1_msgs/srv/InitializeLocalization.md)
- [autoware_adapi_v1_msgs/srv/ListManualControlMode](./autoware_adapi_v1_msgs/srv/ListManualControlMode.md)
- [autoware_adapi_v1_msgs/srv/ResetDiagGraph](./autoware_adapi_v1_msgs/srv/ResetDiagGraph.md)
- [autoware_adapi_v1_msgs/srv/SelectManualControlMode](./autoware_adapi_v1_msgs/srv/SelectManualControlMode.md)
- [autoware_adapi_v1_msgs/srv/SendMrmRequest](./autoware_adapi_v1_msgs/srv/SendMrmRequest.md)
- [autoware_adapi_v1_msgs/srv/SetCooperationCommands](./autoware_adapi_v1_msgs/srv/SetCooperationCommands.md)
Expand Down
22 changes: 22 additions & 0 deletions yaml/autoware-interfaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,36 @@ types:
uuid: unique_identifier_msgs/msg/UUID
autoware_adapi_v1_msgs/msg/DiagGraphStatus:
msg:
diags: autoware_adapi_v1_msgs/msg/DiagLeafStatus[]
id: string
nodes: autoware_adapi_v1_msgs/msg/DiagNodeStatus[]
stamp: builtin_interfaces/msg/Time
autoware_adapi_v1_msgs/msg/DiagGraphStruct:
msg:
diags: autoware_adapi_v1_msgs/msg/DiagLeafStruct[]
id: string
links: autoware_adapi_v1_msgs/msg/DiagLinkStruct[]
nodes: autoware_adapi_v1_msgs/msg/DiagNodeStruct[]
stamp: builtin_interfaces/msg/Time
autoware_adapi_v1_msgs/msg/DiagLeafStatus:
msg:
hardware_id: string
input_level: byte
level: byte
message: string
values: autoware_adapi_v1_msgs/msg/KvString[]
autoware_adapi_v1_msgs/msg/DiagLeafStruct:
msg:
name: string
autoware_adapi_v1_msgs/msg/DiagLinkStruct:
msg:
child: uint32
parent: uint32
autoware_adapi_v1_msgs/msg/DiagNodeStatus:
msg:
input_level: byte
is_dependent: bool
latch_level: byte
level: byte
autoware_adapi_v1_msgs/msg/DiagNodeStruct:
msg:
Expand Down Expand Up @@ -97,6 +112,10 @@ types:
msg:
seq: uint16
stamp: builtin_interfaces/msg/Time
autoware_adapi_v1_msgs/msg/KvString:
msg:
key: string
value: string
autoware_adapi_v1_msgs/msg/LocalizationInitializationState:
msg:
stamp: builtin_interfaces/msg/Time
Expand Down Expand Up @@ -291,6 +310,9 @@ types:
res:
modes: autoware_adapi_v1_msgs/msg/ManualControlMode[]
status: autoware_adapi_v1_msgs/msg/ResponseStatus
autoware_adapi_v1_msgs/srv/ResetDiagGraph:
res:
status: autoware_adapi_v1_msgs/msg/ResponseStatus
autoware_adapi_v1_msgs/srv/SelectManualControlMode:
req:
mode: autoware_adapi_v1_msgs/msg/ManualControlMode
Expand Down
Loading