Skip to content

Commit 4917b54

Browse files
authored
feat: remake diagnostic graph packages (#6715)
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
1 parent 8adf18e commit 4917b54

File tree

108 files changed

+3429
-2292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+3429
-2292
lines changed

system/diagnostic_graph_aggregator/CMakeLists.txt

+4-15
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,27 @@ find_package(autoware_cmake REQUIRED)
55
autoware_package()
66

77
ament_auto_add_library(${PROJECT_NAME} SHARED
8+
src/common/graph/error.cpp
9+
src/common/graph/data.cpp
810
src/common/graph/config.cpp
9-
src/common/graph/debug.cpp
11+
src/common/graph/loader.cpp
1012
src/common/graph/graph.cpp
1113
src/common/graph/units.cpp
1214
)
1315

1416
ament_auto_add_executable(aggregator
1517
src/node/aggregator.cpp
16-
src/node/plugin/modes.cpp
18+
src/node/availability.cpp
1719
)
1820
target_include_directories(aggregator PRIVATE src/common)
1921

20-
ament_auto_add_executable(converter
21-
src/node/converter.cpp
22-
)
23-
target_include_directories(converter PRIVATE src/common)
24-
2522
ament_auto_add_executable(tree
2623
src/tool/tree.cpp
27-
src/tool/utils/loader.cpp
2824
)
2925
target_include_directories(tree PRIVATE src/common)
3026

3127
ament_auto_add_executable(plantuml
3228
src/tool/plantuml.cpp
33-
src/tool/utils/loader.cpp
3429
)
3530
target_include_directories(plantuml PRIVATE src/common)
3631

@@ -45,10 +40,4 @@ if(BUILD_TESTING)
4540
target_include_directories(gtest_${PROJECT_NAME} PRIVATE src/common)
4641
endif()
4742

48-
install(PROGRAMS
49-
script/dump.py
50-
RENAME dump
51-
DESTINATION lib/${PROJECT_NAME}
52-
)
53-
5443
ament_auto_package(INSTALL_TO_SHARE config example launch)

system/diagnostic_graph_aggregator/README.md

+23-18
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33
## Overview
44

55
The diagnostic graph aggregator node subscribes to diagnostic array and publishes aggregated diagnostic graph.
6-
As shown in the diagram below, this node introduces extra diagnostic status for intermediate functional unit.
7-
Diagnostic status dependencies will be directed acyclic graph (DAG).
6+
As shown in the diagram below, this node introduces extra diagnostic status for intermediate functional units.
87

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

11-
## Diagnostics graph message
10+
## Diagnostic graph structures
1211

13-
The diagnostics graph that this node outputs is a combination of diagnostic status and connections between them.
14-
This graph consists of an array of diagnostic nodes, and each node has a status and links.
15-
This link contains an index indicating the position of the node in the graph.
16-
Therefore, the graph can be reconstructed from the array of nodes using links.
17-
The following is an example of a message representing the graph in the overview section.
12+
The diagnostic graph is actually a set of fault tree analysis (FTA) for each operation mode of Autoware.
13+
Since the status of the same node may be referenced by multiple nodes, the overall structure is a directed acyclic graph (DAG).
14+
Each node in the diagnostic graph represents the diagnostic status of a specific functional unit, including the input diagnostics.
15+
So we define this as "unit", and call the unit corresponding to the input diagnosis "diag unit" and the others "node unit".
1816

19-
![message](./doc/message.drawio.svg)
17+
Every unit has an error level that is the same as DiagnosticStatus, a unit type, and optionally a unit path.
18+
In addition, every diag unit has a message, a hardware_id, and values that are the same as DiagnosticStatus.
19+
The unit type represents how the unit status is calculated, such as AND or OR.
20+
The unit path is any unique string that represents the functionality of the unit.
21+
22+
NOTE: This feature is currently under development.
23+
The diagnostic graph also supports "link" because there are cases where connections between units have additional status.
24+
For example, it is natural that many functional units will have an error status until initialization is complete.
2025

2126
## Operation mode availability
2227

@@ -34,11 +39,13 @@ This feature breaks the generality of the graph and may be changed to a plugin o
3439

3540
## Interfaces
3641

37-
| Interface Type | Interface Name | Data Type | Description |
38-
| -------------- | ------------------------------------- | ------------------------------------------------- | ------------------ |
39-
| subscription | `/diagnostics` | `diagnostic_msgs/msg/DiagnosticArray` | Diagnostics input. |
40-
| publisher | `/diagnostics_graph` | `tier4_system_msgs/msg/DiagnosticGraph` | Diagnostics graph. |
41-
| publisher | `/system/operation_mode/availability` | `tier4_system_msgs/msg/OperationModeAvailability` | mode availability. |
42+
| Interface Type | Interface Name | Data Type | Description |
43+
| -------------- | ------------------------------------- | ------------------------------------------------- | ---------------------------------- |
44+
| subscription | `/diagnostics` | `diagnostic_msgs/msg/DiagnosticArray` | Diagnostics input. |
45+
| publisher | `/diagnostics_graph/unknowns` | `diagnostic_msgs/msg/DiagnosticArray` | Diagnostics not included in graph. |
46+
| publisher | `/diagnostics_graph/struct` | `tier4_system_msgs/msg/DiagGraphStruct` | Diagnostic graph (static part). |
47+
| publisher | `/diagnostics_graph/status` | `tier4_system_msgs/msg/DiagGraphStatus` | Diagnostic graph (dynamic part). |
48+
| publisher | `/system/operation_mode/availability` | `tier4_system_msgs/msg/OperationModeAvailability` | Operation mode availability. |
4249

4350
## Parameters
4451

@@ -49,7 +56,6 @@ This feature breaks the generality of the graph and may be changed to a plugin o
4956
| `input_qos_depth` | `uint` | QoS depth of input array topic. |
5057
| `graph_qos_depth` | `uint` | QoS depth of output graph topic. |
5158
| `use_operation_mode_availability` | `bool` | Use operation mode availability publisher. |
52-
| `use_debug_mode` | `bool` | Use debug output to stdout. |
5359

5460
## Examples
5561

@@ -73,13 +79,12 @@ ros2 launch diagnostic_graph_aggregator example-edit.launch.xml
7379

7480
## Debug tools
7581

76-
- [dump](./doc/tool/dump.md)
77-
- [converter](./doc/tool/converter.md)
7882
- [tree](./doc/tool/tree.md)
83+
- [diagnostic_graph_utils](../diagnostic_graph_utils/README.md)
7984

8085
## Graph file format
8186

8287
- [graph](./doc/format/graph.md)
8388
- [path](./doc/format/path.md)
84-
- [node](./doc/format/node.md)
89+
- [unit](./doc/format/unit.md)
8590
- [edit](./doc/format/edit.md)
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**:
22
ros__parameters:
33
use_operation_mode_availability: true
4-
use_debug_mode: false
54
rate: 10.0
65
input_qos_depth: 1000
76
graph_qos_depth: 1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Remove
22

3-
The `remove` object is a edit that removes other nodes.
3+
The `remove` object is a edit that removes other units.
44

55
## Format
66

77
| Name | Type | Required | Description |
88
| ------ | -------- | -------- | ---------------------------------------- |
99
| `type` | `string` | yes | Specify `remove` when using this object. |
10-
| `path` | `string` | yes | The path of the node to remove. |
10+
| `path` | `string` | yes | The path of the unit to remove. |

system/diagnostic_graph_aggregator/doc/format/graph.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ The graph object is the top level structure that makes up the configuration file
77
| Name | Type | Required | Description |
88
| ------- | -------------------------------------- | -------- | ------------------------------------------------- |
99
| `files` | <code>list\[[path](./path.md)\]</code> | no | List of path objects for importing subgraphs. |
10-
| `nodes` | <code>list\[[node](./node.md)\]</code> | no | List of node objects that make up the graph. |
10+
| `units` | <code>list\[[unit](./unit.md)\]</code> | no | List of unit objects that make up the graph. |
1111
| `edits` | <code>list\[[edit](./edit.md)\]</code> | no | List of edit objects to partially edit the graph. |

system/diagnostic_graph_aggregator/doc/format/node/remap.md

-21
This file was deleted.

system/diagnostic_graph_aggregator/doc/format/node.md system/diagnostic_graph_aggregator/doc/format/unit.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Node
1+
# Unit
22

3-
The `node` is a base object that makes up the diagnostic graph.
4-
Any derived object can be used where a node object is required.
3+
The `unit` is a base object that makes up the diagnostic graph.
4+
Any derived object can be used where a unit object is required.
55

66
## Format
77

88
| Name | Type | Required | Description |
99
| ------ | -------- | -------- | ------------------------------------------------- |
1010
| `type` | `string` | yes | The string indicating the type of derived object. |
11-
| `path` | `string` | no | Any string to reference from other nodes. |
11+
| `path` | `string` | no | Any string to reference from other units. |
1212

1313
## Derived objects
1414

15-
- [diag](./node/diag.md)
16-
- [and](./node/and.md)
17-
- [or](./node/or.md)
18-
- [remapping](./node/remap.md)
15+
- [diag](./unit/diag.md)
16+
- [and](./unit/and.md)
17+
- [or](./unit/or.md)
18+
- [remapping](./unit/remap.md)
1919
- warn-to-ok
2020
- warn-to-error
21-
- [constant](./node/const.md)
21+
- [constant](./unit/const.md)
2222
- ok
2323
- warn
2424
- error

system/diagnostic_graph_aggregator/doc/format/node/and.md system/diagnostic_graph_aggregator/doc/format/unit/and.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# And
22

3-
The `and` object is a node that is evaluated as the maximum error level of the input nodes.
3+
The `and` object is a unit that is evaluated as the maximum error level of the input units.
44
Note that error level `stale` is treated as `error`.
55

66
## Format
77

88
| Name | Type | Required | Description |
99
| ------ | -------------------------------------- | -------- | ------------------------------------------------------------ |
1010
| `type` | <code>string</code> | yes | Specify `and` or `short-circuit-and` when using this object. |
11-
| `list` | <code>list\[[node](../node.md)]</code> | yes | List of input node objects. |
11+
| `list` | <code>list\[[unit](../unit.md)]</code> | yes | List of input unit objects. |
1212

1313
## Short-circuit evaluation
1414

system/diagnostic_graph_aggregator/doc/format/node/const.md system/diagnostic_graph_aggregator/doc/format/unit/const.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Constant
22

3-
The constant object is a node with a fixed error level.
3+
The constant object is a unit with a fixed error level.
44

55
## Format
66

system/diagnostic_graph_aggregator/doc/format/node/diag.md system/diagnostic_graph_aggregator/doc/format/unit/diag.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Diag
22

3-
The `diag` object is a node that refers to a specific status within the source diagnostics.
3+
The `diag` object is a unit that refers to a specific status within the source diagnostics.
44

55
## Format
66

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Link
22

3-
The `link` object is a node that refers to other nodes.
3+
The `link` object is a unit that refers to another unit.
44

55
## Format
66

77
| Name | Type | Required | Description |
88
| ------ | -------- | -------- | -------------------------------------- |
99
| `type` | `string` | yes | Specify `link` when using this object. |
10-
| `link` | `string` | yes | The path of the node to reference. |
10+
| `link` | `string` | yes | The path of the unit to reference. |
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Or
22

3-
The `or` object is a node that is evaluated as the minimum error level of the input nodes.
3+
The `or` object is a unit that is evaluated as the minimum error level of the input units.
44
Note that error level `stale` is treated as `error`.
55

66
## Format
77

88
| Name | Type | Required | Description |
99
| ------ | -------------------------------------- | -------- | ------------------------------------ |
1010
| `type` | <code>string</code> | yes | Specify `or` when using this object. |
11-
| `list` | <code>list\[[node](../node.md)]</code> | yes | List of input node objects. |
11+
| `list` | <code>list\[[unit](../unit.md)]</code> | yes | List of input unit objects. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Constant
2+
3+
!!! warning
4+
5+
This object is under development. It may be removed in the future.
6+
7+
The remapping object is a unit that converts error levels.
8+
9+
## Format
10+
11+
| Name | Type | Required | Description |
12+
| ------ | ------------------------------- | -------- | ---------------------------------------------- |
13+
| `type` | `string` | yes | Specify remapping type when using this object. |
14+
| `item` | <code>[unit](../unit.md)</code> | yes | Input unit object. |
15+
16+
## Remapping types
17+
18+
The supported remapping types are as follows.
19+
20+
- `warn-to-ok`
21+
- `warn-to-error`

0 commit comments

Comments
 (0)