Skip to content

Commit

Permalink
feat(diagnostic_graph_aggregator): rename system_diagnostic_graph pac…
Browse files Browse the repository at this point in the history
…kage (#5827)

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
  • Loading branch information
isamu-takagi authored Dec 14, 2023
1 parent d4d632a commit 4fc8a4e
Show file tree
Hide file tree
Showing 56 changed files with 835 additions and 144 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
cmake_minimum_required(VERSION 3.14)
project(system_diagnostic_graph)
project(diagnostic_graph_aggregator)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(${PROJECT_NAME} SHARED
src/core/config.cpp
src/core/debug.cpp
src/core/graph.cpp
src/core/units.cpp
src/core/modes.cpp
src/common/graph/config.cpp
src/common/graph/debug.cpp
src/common/graph/graph.cpp
src/common/graph/units.cpp
)

ament_auto_add_executable(aggregator
src/main.cpp
src/node/aggregator.cpp
src/node/plugin/modes.cpp
)
target_include_directories(aggregator PRIVATE src/common)

ament_auto_add_executable(converter
src/tool.cpp
src/node/converter.cpp
)
target_include_directories(converter PRIVATE src/common)

ament_auto_add_executable(tool
src/tool/main.cpp
src/tool/tool.cpp
)
target_include_directories(tool PRIVATE src/core)
target_include_directories(tool PRIVATE src/common)

if(BUILD_TESTING)
get_filename_component(RESOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/test/files ABSOLUTE)
Expand All @@ -33,7 +35,7 @@ if(BUILD_TESTING)
test/src/utils.cpp
)
target_compile_definitions(gtest_${PROJECT_NAME} PRIVATE TEST_RESOURCE_PATH="${RESOURCE_PATH}")
target_include_directories(gtest_${PROJECT_NAME} PRIVATE src)
target_include_directories(gtest_${PROJECT_NAME} PRIVATE src/common)
endif()

ament_auto_package(INSTALL_TO_SHARE config example launch)
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# System diagnostic graph
# diagnostic_graph_aggregator

## Overview

The system diagnostic graph node subscribes to diagnostic array and publishes aggregated diagnostic graph.
The diagnostic graph aggregator node subscribes to diagnostic array and publishes aggregated diagnostic graph.
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)

## Diagnostics graph message

The diagnostics graph that this node outputs is a combination of diagnostic status and connections between them.
This graph consists of an array of diagnostic nodes, and each node has a status and links.
This link contains an index indicating the position of the node in the graph.
Therefore, the graph can be reconstructed from the array of nodes using links.
The following is an example of a message representing the graph in the overview section.

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

## Operation mode availability

For MRM, this node publishes the status of the top-level functional units in the dedicated message.
Expand All @@ -22,7 +32,7 @@ This feature breaks the generality of the graph and may be changed to a plugin o
- /autoware/operation/comfortable-stop
- /autoware/operation/pull-over

## Interface
## Interfaces

| Interface Type | Interface Name | Data Type | Description |
| -------------- | ------------------------------------- | ------------------------------------------------- | ------------------ |
Expand All @@ -32,12 +42,24 @@ This feature breaks the generality of the graph and may be changed to a plugin o

## Parameters

| Parameter Name | Data Type | Description |
| ----------------- | --------- | ------------------------------------------ |
| `graph_file` | `string` | Path of the config file. |
| `rate` | `double` | Rate of aggregation and topic publication. |
| `input_qos_depth` | `uint` | QoS depth of input array topic. |
| `graph_qos_depth` | `uint` | QoS depth of output graph topic. |
| Parameter Name | Data Type | Description |
| --------------------------------- | --------- | ------------------------------------------ |
| `graph_file` | `string` | Path of the config file. |
| `rate` | `double` | Rate of aggregation and topic publication. |
| `input_qos_depth` | `uint` | QoS depth of input array topic. |
| `graph_qos_depth` | `uint` | QoS depth of output graph topic. |
| `use_operation_mode_availability` | `bool` | Use operation mode availability publisher. |
| `use_debug_mode` | `bool` | Use debug output to stdout. |

## Examples

- [example_0.yaml](./example/example_0.yaml)
- [example_1.yaml](./example/example_1.yaml)
- [example_2.yaml](./example/example_2.yaml)

```bash
ros2 launch diagnostic_graph_aggregator example.launch.xml
```

## Graph file format

Expand All @@ -48,12 +70,3 @@ This feature breaks the generality of the graph and may be changed to a plugin o
- [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
```
10 changes: 10 additions & 0 deletions system/diagnostic_graph_aggregator/doc/format/diag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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. |
| diag | string | yes | Name of diagnostic status. |
Loading

0 comments on commit 4fc8a4e

Please sign in to comment.