Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: system diagnostic monitor #4722

Merged
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
05facb3
feat: add package template
isamu-takagi May 31, 2023
f8747fb
feat: add ros interface
isamu-takagi May 31, 2023
f499cdc
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Jun 1, 2023
df22dff
feat: add diag leaf
isamu-takagi Jun 1, 2023
591a462
feat: add report
isamu-takagi Jun 1, 2023
2154c7f
feat: add key
isamu-takagi Jun 5, 2023
678a5f5
feat: add debug
isamu-takagi Jun 5, 2023
9b6eb1e
feat: update debug
isamu-takagi Jun 6, 2023
867e099
feat: load file
isamu-takagi Jun 6, 2023
8e3fa38
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Jun 8, 2023
c0f1aad
add config loading
isamu-takagi Jun 9, 2023
1f924c3
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Jun 9, 2023
d5ddaf5
update diag node
isamu-takagi Jun 9, 2023
0e6df85
create node links
isamu-takagi Jun 13, 2023
88e719a
add topological sort
isamu-takagi Jun 13, 2023
b48d3c8
add status update
isamu-takagi Jun 13, 2023
33ff440
publish graph
isamu-takagi Jun 14, 2023
fa33de5
add timeout
isamu-takagi Jun 14, 2023
6737d22
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Jul 18, 2023
017c615
update message
isamu-takagi Jul 19, 2023
2ad7a98
split struct message
isamu-takagi Jul 19, 2023
56edc8a
update type name
isamu-takagi Jul 19, 2023
14d01f7
add hardware id
isamu-takagi Jul 19, 2023
e26d9ee
update docs
isamu-takagi Jul 19, 2023
dbe4475
update docs
isamu-takagi Jul 20, 2023
00e3af2
update config
isamu-takagi Jul 20, 2023
f4072e2
update config
isamu-takagi Jul 20, 2023
7fad07d
update example
isamu-takagi Jul 20, 2023
67893d9
update debug tool
isamu-takagi Jul 20, 2023
501dae0
add debug type
isamu-takagi Jul 20, 2023
64f761d
update docs
isamu-takagi Jul 20, 2023
594be47
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Jul 21, 2023
911609b
update message
isamu-takagi Aug 4, 2023
63dd813
move dir
isamu-takagi Aug 4, 2023
283350d
add converter
isamu-takagi Aug 4, 2023
6e092cf
add monitor package
isamu-takagi Aug 4, 2023
bf780ea
add component state diagnostics
isamu-takagi Aug 4, 2023
f45d6cf
update planning
isamu-takagi Aug 4, 2023
6cd8423
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 4, 2023
725e878
fix
isamu-takagi Aug 4, 2023
f19eedb
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 7, 2023
834086c
WIP
isamu-takagi Aug 7, 2023
cde7182
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 8, 2023
2859664
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 10, 2023
79d5cd9
fix build
isamu-takagi Aug 10, 2023
eff5e8b
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 10, 2023
460431d
add ref expr
isamu-takagi Aug 10, 2023
39c5f9f
update graph
isamu-takagi Aug 10, 2023
f2a27a8
publish summary
isamu-takagi Aug 10, 2023
411a7c0
update config
isamu-takagi Aug 10, 2023
85d5016
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 14, 2023
9896703
update expr result
isamu-takagi Aug 15, 2023
8e5e125
add link
isamu-takagi Aug 16, 2023
a316a11
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 22, 2023
4417e5a
add precondition
isamu-takagi Aug 22, 2023
c3c6ea8
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 23, 2023
65f5c15
update if expr
isamu-takagi Aug 23, 2023
ed2e7fe
update config
isamu-takagi Aug 23, 2023
be9bfc5
fix typo
isamu-takagi Aug 23, 2023
6a65dd8
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Aug 24, 2023
7549214
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 4, 2023
e6bae73
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 5, 2023
a872168
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 6, 2023
d32e72a
update message type
isamu-takagi Sep 6, 2023
1fc26c6
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 6, 2023
bace02b
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 7, 2023
6953dfd
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 7, 2023
65fb05b
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 8, 2023
322832b
fix typo
isamu-takagi Sep 8, 2023
6c83ed2
Merge branch 'main' into feat/system-diagnostic-graph
isamu-takagi Sep 11, 2023
af0f5b2
fix availability
isamu-takagi Sep 11, 2023
123428c
rename availability
isamu-takagi Sep 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions system/system_diagnostic_graph/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.14)
project(system_diagnostic_graph)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_executable(aggregator
src/main.cpp
src/core/config.cpp
src/core/debug.cpp
src/core/graph.cpp
src/core/node.cpp
src/core/expr.cpp
src/core/update.cpp
)

ament_auto_add_executable(converter
src/tool.cpp
)

install(
PROGRAMS util/debug.py
DESTINATION lib/${PROJECT_NAME}
)

ament_auto_package(INSTALL_TO_SHARE config example launch)
45 changes: 45 additions & 0 deletions system/system_diagnostic_graph/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# System diagnostic graph

## Overview

The system diagnostic graph node subscribes to diagnostic status and publishes aggregated diagnostic status.
As shown in the diagram below, this node introduces extra diagnostic status for intermediate functional unit.
Diagnostic status dependencies will be directed acyclic graph (DAG).

![overview](./doc/overview.drawio.svg)

## Interface

| Interface Type | Interface Name | Data Type | Description |
| -------------- | --------------------------- | --------------------------------------- | ------------------ |
| subscription | `/diagnostics` | `diagnostic_msgs/msg/DiagnosticArray` | Input diagnostics. |
| publisher | `/diagnostics_graph/status` | `diagnostic_msgs/msg/DiagnosticArray` | Graph status. |
| publisher | `/diagnostics_graph/struct` | `tier4_system_msgs/msg/DiagnosticGraph` | Graph structure. |

## Parameters

| Parameter Name | Data Type | Description |
| ------------------ | --------- | ------------------------------------------ |
| `graph_file` | `string` | Path of the config file. |
| `rate` | `double` | Rate of aggregation and topic publication. |
| `status_qos_depth` | `uint` | QoS depth of status topic. |
| `source_qos_depth` | `uint` | QoS depth of source topic. |

## Graph file format

- [GraphFile](./doc/format/graph-file.md)
- [Path](./doc/format/path.md)
- [Node](./doc/format/node.md)
- [Diag](./doc/format/diag.md)
- [Unit](./doc/format/unit.md)
- [And](./doc/format/and.md)
- [Or](./doc/format/or.md)

## Example

- [example1.yaml](./example/example1.yaml)
- [example2.yaml](./example/example2.yaml)

```bash
ros2 launch system_diagnostic_graph example.launch.xml
```
5 changes: 5 additions & 0 deletions system/system_diagnostic_graph/config/default.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**:
ros__parameters:
rate: 1.0
input_qos_depth: 1000
graph_qos_depth: 1
11 changes: 11 additions & 0 deletions system/system_diagnostic_graph/doc/format/and.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Unit

And is a node that is evaluated as the AND of the input nodes.

## Format

| Name | Type | Required | Description |
| ---- | ------------------------------------------ | -------- | ------------------------------------- |
| type | string | yes | Specify `and` when using this object. |
| name | string | yes | Name of diagnostic status. |
| list | List<[Diag](./diag.md)\|[Unit](./unit.md)> | yes | List of input node references. |
11 changes: 11 additions & 0 deletions system/system_diagnostic_graph/doc/format/diag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Diag

Diag is a node that refers to a source diagnostics.

## Format

| Name | Type | Required | Description |
| -------- | ------ | -------- | -------------------------------------- |
| type | string | yes | Specify `diag` when using this object. |
| name | string | yes | Name of diagnostic status. |
| hardware | string | yes | Hardware ID of diagnostic status. |
10 changes: 10 additions & 0 deletions system/system_diagnostic_graph/doc/format/graph-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# GraphFile

GraphFile is the top level object that makes up the configuration file.

## Format

| Name | Type | Required | Description |
| ----- | ----------------------- | -------- | ------------------------------ |
| files | List<[Path](./path.md)> | no | Paths of the files to include. |
| nodes | List<[Node](./node.md)> | no | Nodes of the diagnostic graph. |
9 changes: 9 additions & 0 deletions system/system_diagnostic_graph/doc/format/node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Node

Node is a base object that makes up the diagnostic graph.

## Format

| Name | Type | Required | Description |
| ---- | ------ | -------- | ------------------------------------------- |
| type | string | yes | Node type. See derived objects for details. |
11 changes: 11 additions & 0 deletions system/system_diagnostic_graph/doc/format/or.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Unit

Or is a node that is evaluated as the OR of the input nodes.

## Format

| Name | Type | Required | Description |
| ---- | ------------------------------------------ | -------- | ------------------------------------ |
| type | string | yes | Specify `or` when using this object. |
| name | string | yes | Name of diagnostic status. |
| list | List<[Diag](./diag.md)\|[Unit](./unit.md)> | yes | List of input node references. |
10 changes: 10 additions & 0 deletions system/system_diagnostic_graph/doc/format/path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Path

Path is an object that indicates the path of the file to include.

## Format

| Name | Type | Required | Description |
| ------- | ------ | -------- | ----------------------------- |
| package | string | yes | Package name. |
| path | string | yes | Relative path in the package. |
10 changes: 10 additions & 0 deletions system/system_diagnostic_graph/doc/format/unit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Unit

Diag is a node that refers to a functional unit.

## Format

| Name | Type | Required | Description |
| ---- | ------ | -------- | -------------------------------------- |
| type | string | yes | Specify `unit` when using this object. |
| name | string | yes | Name of diagnostic status. |
Loading
Loading