diff --git a/system/system_diagnostic_graph/CMakeLists.txt b/system/diagnostic_graph_aggregator/CMakeLists.txt
similarity index 56%
rename from system/system_diagnostic_graph/CMakeLists.txt
rename to system/diagnostic_graph_aggregator/CMakeLists.txt
index be0fc19188a0b..188b1509dfca0 100644
--- a/system/system_diagnostic_graph/CMakeLists.txt
+++ b/system/diagnostic_graph_aggregator/CMakeLists.txt
@@ -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)
@@ -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)
diff --git a/system/system_diagnostic_graph/README.md b/system/diagnostic_graph_aggregator/README.md
similarity index 51%
rename from system/system_diagnostic_graph/README.md
rename to system/diagnostic_graph_aggregator/README.md
index df22121a778fb..4dc44feaafc33 100644
--- a/system/system_diagnostic_graph/README.md
+++ b/system/diagnostic_graph_aggregator/README.md
@@ -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.
@@ -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 |
| -------------- | ------------------------------------- | ------------------------------------------------- | ------------------ |
@@ -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
@@ -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
-```
diff --git a/system/system_diagnostic_graph/config/default.param.yaml b/system/diagnostic_graph_aggregator/config/default.param.yaml
similarity index 100%
rename from system/system_diagnostic_graph/config/default.param.yaml
rename to system/diagnostic_graph_aggregator/config/default.param.yaml
diff --git a/system/system_diagnostic_graph/doc/format/and.md b/system/diagnostic_graph_aggregator/doc/format/and.md
similarity index 100%
rename from system/system_diagnostic_graph/doc/format/and.md
rename to system/diagnostic_graph_aggregator/doc/format/and.md
diff --git a/system/diagnostic_graph_aggregator/doc/format/diag.md b/system/diagnostic_graph_aggregator/doc/format/diag.md
new file mode 100644
index 0000000000000..04e850129cbbf
--- /dev/null
+++ b/system/diagnostic_graph_aggregator/doc/format/diag.md
@@ -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. |
diff --git a/system/system_diagnostic_graph/doc/format/graph-file.md b/system/diagnostic_graph_aggregator/doc/format/graph-file.md
similarity index 100%
rename from system/system_diagnostic_graph/doc/format/graph-file.md
rename to system/diagnostic_graph_aggregator/doc/format/graph-file.md
diff --git a/system/system_diagnostic_graph/doc/format/node.md b/system/diagnostic_graph_aggregator/doc/format/node.md
similarity index 100%
rename from system/system_diagnostic_graph/doc/format/node.md
rename to system/diagnostic_graph_aggregator/doc/format/node.md
diff --git a/system/system_diagnostic_graph/doc/format/or.md b/system/diagnostic_graph_aggregator/doc/format/or.md
similarity index 100%
rename from system/system_diagnostic_graph/doc/format/or.md
rename to system/diagnostic_graph_aggregator/doc/format/or.md
diff --git a/system/system_diagnostic_graph/doc/format/path.md b/system/diagnostic_graph_aggregator/doc/format/path.md
similarity index 100%
rename from system/system_diagnostic_graph/doc/format/path.md
rename to system/diagnostic_graph_aggregator/doc/format/path.md
diff --git a/system/system_diagnostic_graph/doc/format/unit.md b/system/diagnostic_graph_aggregator/doc/format/unit.md
similarity index 100%
rename from system/system_diagnostic_graph/doc/format/unit.md
rename to system/diagnostic_graph_aggregator/doc/format/unit.md
diff --git a/system/diagnostic_graph_aggregator/doc/message.drawio.svg b/system/diagnostic_graph_aggregator/doc/message.drawio.svg
new file mode 100644
index 0000000000000..aef836dccf235
--- /dev/null
+++ b/system/diagnostic_graph_aggregator/doc/message.drawio.svg
@@ -0,0 +1,677 @@
+
diff --git a/system/system_diagnostic_graph/doc/overview.drawio.svg b/system/diagnostic_graph_aggregator/doc/overview.drawio.svg
similarity index 100%
rename from system/system_diagnostic_graph/doc/overview.drawio.svg
rename to system/diagnostic_graph_aggregator/doc/overview.drawio.svg
diff --git a/system/diagnostic_graph_aggregator/example/example.launch.xml b/system/diagnostic_graph_aggregator/example/example.launch.xml
new file mode 100644
index 0000000000000..71e59a1833d6e
--- /dev/null
+++ b/system/diagnostic_graph_aggregator/example/example.launch.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/system/system_diagnostic_graph/example/example_0.yaml b/system/diagnostic_graph_aggregator/example/example_0.yaml
similarity index 83%
rename from system/system_diagnostic_graph/example/example_0.yaml
rename to system/diagnostic_graph_aggregator/example/example_0.yaml
index ed92259b50721..7b01883723c76 100644
--- a/system/system_diagnostic_graph/example/example_0.yaml
+++ b/system/diagnostic_graph_aggregator/example/example_0.yaml
@@ -1,6 +1,6 @@
files:
- - { path: $(find-pkg-share system_diagnostic_graph)/example/example_1.yaml }
- - { path: $(find-pkg-share system_diagnostic_graph)/example/example_2.yaml }
+ - { path: $(find-pkg-share diagnostic_graph_aggregator)/example/example_1.yaml }
+ - { path: $(find-pkg-share diagnostic_graph_aggregator)/example/example_2.yaml }
nodes:
- path: /autoware/modes/stop
diff --git a/system/system_diagnostic_graph/example/example_1.yaml b/system/diagnostic_graph_aggregator/example/example_1.yaml
similarity index 100%
rename from system/system_diagnostic_graph/example/example_1.yaml
rename to system/diagnostic_graph_aggregator/example/example_1.yaml
diff --git a/system/system_diagnostic_graph/example/example_2.yaml b/system/diagnostic_graph_aggregator/example/example_2.yaml
similarity index 100%
rename from system/system_diagnostic_graph/example/example_2.yaml
rename to system/diagnostic_graph_aggregator/example/example_2.yaml
diff --git a/system/system_diagnostic_graph/example/example_diags.py b/system/diagnostic_graph_aggregator/example/example_diags.py
similarity index 100%
rename from system/system_diagnostic_graph/example/example_diags.py
rename to system/diagnostic_graph_aggregator/example/example_diags.py
diff --git a/system/diagnostic_graph_aggregator/launch/diagnostic_graph_aggregator.launch.xml b/system/diagnostic_graph_aggregator/launch/diagnostic_graph_aggregator.launch.xml
new file mode 100644
index 0000000000000..272901a3f8045
--- /dev/null
+++ b/system/diagnostic_graph_aggregator/launch/diagnostic_graph_aggregator.launch.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/system/system_diagnostic_graph/package.xml b/system/diagnostic_graph_aggregator/package.xml
similarity index 87%
rename from system/system_diagnostic_graph/package.xml
rename to system/diagnostic_graph_aggregator/package.xml
index 7855edcde9c62..2a9efad2c0d6e 100644
--- a/system/system_diagnostic_graph/package.xml
+++ b/system/diagnostic_graph_aggregator/package.xml
@@ -1,9 +1,9 @@
- system_diagnostic_graph
+ diagnostic_graph_aggregator
0.1.0
- The system_diagnostic_graph package
+ The diagnostic_graph_aggregator package
Takagi, Isamu
Apache License 2.0
diff --git a/system/system_diagnostic_graph/src/core/config.cpp b/system/diagnostic_graph_aggregator/src/common/graph/config.cpp
similarity index 99%
rename from system/system_diagnostic_graph/src/core/config.cpp
rename to system/diagnostic_graph_aggregator/src/common/graph/config.cpp
index 4a32398a1b08f..39044d1c82bf9 100644
--- a/system/system_diagnostic_graph/src/core/config.cpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/config.cpp
@@ -30,7 +30,7 @@
// DEBUG
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
template
@@ -351,4 +351,4 @@ RootConfig load_root_config(const std::string & path)
return load_root_config(root);
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
diff --git a/system/system_diagnostic_graph/src/core/config.hpp b/system/diagnostic_graph_aggregator/src/common/graph/config.hpp
similarity index 94%
rename from system/system_diagnostic_graph/src/core/config.hpp
rename to system/diagnostic_graph_aggregator/src/common/graph/config.hpp
index d7cdd0ec3c5f7..40f16235ed5d6 100644
--- a/system/system_diagnostic_graph/src/core/config.hpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/config.hpp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CORE__CONFIG_HPP_
-#define CORE__CONFIG_HPP_
+#ifndef COMMON__GRAPH__CONFIG_HPP_
+#define COMMON__GRAPH__CONFIG_HPP_
#include
@@ -23,7 +23,7 @@
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
struct ConfigData
@@ -124,6 +124,6 @@ T error(const std::string & text, const std::string & value)
RootConfig load_root_config(const std::string & path);
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // CORE__CONFIG_HPP_
+#endif // COMMON__GRAPH__CONFIG_HPP_
diff --git a/system/system_diagnostic_graph/src/core/debug.cpp b/system/diagnostic_graph_aggregator/src/common/graph/debug.cpp
similarity index 96%
rename from system/system_diagnostic_graph/src/core/debug.cpp
rename to system/diagnostic_graph_aggregator/src/common/graph/debug.cpp
index e2771f08f9f1e..8f2b741edd805 100644
--- a/system/system_diagnostic_graph/src/core/debug.cpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/debug.cpp
@@ -23,7 +23,7 @@
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
std::string get_level_text(DiagnosticLevel level)
@@ -72,4 +72,4 @@ void Graph::debug()
}
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
diff --git a/system/system_diagnostic_graph/src/core/debug.hpp b/system/diagnostic_graph_aggregator/src/common/graph/debug.hpp
similarity index 79%
rename from system/system_diagnostic_graph/src/core/debug.hpp
rename to system/diagnostic_graph_aggregator/src/common/graph/debug.hpp
index 297356cd36bab..69a0eeb2c8023 100644
--- a/system/system_diagnostic_graph/src/core/debug.hpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/debug.hpp
@@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CORE__DEBUG_HPP_
-#define CORE__DEBUG_HPP_
+#ifndef COMMON__GRAPH__DEBUG_HPP_
+#define COMMON__GRAPH__DEBUG_HPP_
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
constexpr size_t diag_debug_size = 4;
using DiagDebugData = std::array;
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // CORE__DEBUG_HPP_
+#endif // COMMON__GRAPH__DEBUG_HPP_
diff --git a/system/system_diagnostic_graph/src/core/error.hpp b/system/diagnostic_graph_aggregator/src/common/graph/error.hpp
similarity index 87%
rename from system/system_diagnostic_graph/src/core/error.hpp
rename to system/diagnostic_graph_aggregator/src/common/graph/error.hpp
index 7e110654bf475..dadfab450c783 100644
--- a/system/system_diagnostic_graph/src/core/error.hpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/error.hpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CORE__ERROR_HPP_
-#define CORE__ERROR_HPP_
+#ifndef COMMON__GRAPH__ERROR_HPP_
+#define COMMON__GRAPH__ERROR_HPP_
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
struct Exception : public std::runtime_error
@@ -65,6 +65,6 @@ class GraphStructure : public Exception
using Exception::Exception;
};
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // CORE__ERROR_HPP_
+#endif // COMMON__GRAPH__ERROR_HPP_
diff --git a/system/system_diagnostic_graph/src/core/graph.cpp b/system/diagnostic_graph_aggregator/src/common/graph/graph.cpp
similarity index 98%
rename from system/system_diagnostic_graph/src/core/graph.cpp
rename to system/diagnostic_graph_aggregator/src/common/graph/graph.cpp
index 5ad7df09de1d1..5d7c11879a9cc 100644
--- a/system/system_diagnostic_graph/src/core/graph.cpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/graph.cpp
@@ -28,7 +28,7 @@
// DEBUG
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
BaseUnit::UniquePtrList topological_sort(BaseUnit::UniquePtrList && input)
@@ -223,4 +223,4 @@ std::vector Graph::nodes() const
return result;
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
diff --git a/system/system_diagnostic_graph/src/core/graph.hpp b/system/diagnostic_graph_aggregator/src/common/graph/graph.hpp
similarity index 86%
rename from system/system_diagnostic_graph/src/core/graph.hpp
rename to system/diagnostic_graph_aggregator/src/common/graph/graph.hpp
index 7b0a5bf563106..8c29a303814b8 100644
--- a/system/system_diagnostic_graph/src/core/graph.hpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/graph.hpp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CORE__GRAPH_HPP_
-#define CORE__GRAPH_HPP_
+#ifndef COMMON__GRAPH__GRAPH_HPP_
+#define COMMON__GRAPH__GRAPH_HPP_
#include "types.hpp"
@@ -25,7 +25,7 @@
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
class Graph final
@@ -47,6 +47,6 @@ class Graph final
std::unordered_map unknowns_;
};
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // CORE__GRAPH_HPP_
+#endif // COMMON__GRAPH__GRAPH_HPP_
diff --git a/system/system_diagnostic_graph/src/core/types.hpp b/system/diagnostic_graph_aggregator/src/common/graph/types.hpp
similarity index 86%
rename from system/system_diagnostic_graph/src/core/types.hpp
rename to system/diagnostic_graph_aggregator/src/common/graph/types.hpp
index c0b901d1e4511..693094914db1d 100644
--- a/system/system_diagnostic_graph/src/core/types.hpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/types.hpp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CORE__TYPES_HPP_
-#define CORE__TYPES_HPP_
+#ifndef COMMON__GRAPH__TYPES_HPP_
+#define COMMON__GRAPH__TYPES_HPP_
#include
#include
@@ -21,7 +21,7 @@
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
using diagnostic_msgs::msg::DiagnosticArray;
@@ -34,6 +34,6 @@ using DiagnosticLevel = DiagnosticStatus::_level_type;
class BaseUnit;
class DiagUnit;
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // CORE__TYPES_HPP_
+#endif // COMMON__GRAPH__TYPES_HPP_
diff --git a/system/system_diagnostic_graph/src/core/units.cpp b/system/diagnostic_graph_aggregator/src/common/graph/units.cpp
similarity index 98%
rename from system/system_diagnostic_graph/src/core/units.cpp
rename to system/diagnostic_graph_aggregator/src/common/graph/units.cpp
index cb830c8d1df51..6048cae85e633 100644
--- a/system/system_diagnostic_graph/src/core/units.cpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/units.cpp
@@ -21,7 +21,7 @@
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
using LinkList = std::vector>;
@@ -178,4 +178,4 @@ void DebugUnit::update(const rclcpp::Time &)
{
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
diff --git a/system/system_diagnostic_graph/src/core/units.hpp b/system/diagnostic_graph_aggregator/src/common/graph/units.hpp
similarity index 95%
rename from system/system_diagnostic_graph/src/core/units.hpp
rename to system/diagnostic_graph_aggregator/src/common/graph/units.hpp
index 2b94b5f83a216..dce223b30f728 100644
--- a/system/system_diagnostic_graph/src/core/units.hpp
+++ b/system/diagnostic_graph_aggregator/src/common/graph/units.hpp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CORE__UNITS_HPP_
-#define CORE__UNITS_HPP_
+#ifndef COMMON__GRAPH__UNITS_HPP_
+#define COMMON__GRAPH__UNITS_HPP_
#include "config.hpp"
#include "types.hpp"
@@ -27,7 +27,7 @@
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
class BaseUnit
@@ -131,6 +131,6 @@ class DebugUnit : public BaseUnit
std::string type() const override { return "const"; }
};
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // CORE__UNITS_HPP_
+#endif // COMMON__GRAPH__UNITS_HPP_
diff --git a/system/system_diagnostic_graph/src/main.cpp b/system/diagnostic_graph_aggregator/src/node/aggregator.cpp
similarity index 90%
rename from system/system_diagnostic_graph/src/main.cpp
rename to system/diagnostic_graph_aggregator/src/node/aggregator.cpp
index 7393d9fb086f6..48f489c186bdb 100644
--- a/system/system_diagnostic_graph/src/main.cpp
+++ b/system/diagnostic_graph_aggregator/src/node/aggregator.cpp
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "main.hpp"
+#include "aggregator.hpp"
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
-MainNode::MainNode() : Node("system_diagnostic_graph_aggregator")
+MainNode::MainNode() : Node("diagnostic_graph_aggregator_aggregator")
{
// Init diagnostics graph.
{
@@ -69,11 +69,11 @@ void MainNode::on_diag(const DiagnosticArray::ConstSharedPtr msg)
graph_.callback(now(), *msg);
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
int main(int argc, char ** argv)
{
- using system_diagnostic_graph::MainNode;
+ using diagnostic_graph_aggregator::MainNode;
rclcpp::init(argc, argv);
rclcpp::executors::SingleThreadedExecutor executor;
auto node = std::make_shared();
diff --git a/system/system_diagnostic_graph/src/main.hpp b/system/diagnostic_graph_aggregator/src/node/aggregator.hpp
similarity index 80%
rename from system/system_diagnostic_graph/src/main.hpp
rename to system/diagnostic_graph_aggregator/src/node/aggregator.hpp
index 495c51218cabc..dd64809e939cc 100644
--- a/system/system_diagnostic_graph/src/main.hpp
+++ b/system/diagnostic_graph_aggregator/src/node/aggregator.hpp
@@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef MAIN_HPP_
-#define MAIN_HPP_
+#ifndef NODE__AGGREGATOR_HPP_
+#define NODE__AGGREGATOR_HPP_
-#include "core/graph.hpp"
-#include "core/modes.hpp"
-#include "core/types.hpp"
+#include "graph/graph.hpp"
+#include "graph/types.hpp"
+#include "plugin/modes.hpp"
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
class MainNode : public rclcpp::Node
@@ -44,6 +44,6 @@ class MainNode : public rclcpp::Node
bool debug_;
};
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // MAIN_HPP_
+#endif // NODE__AGGREGATOR_HPP_
diff --git a/system/system_diagnostic_graph/src/tool.cpp b/system/diagnostic_graph_aggregator/src/node/converter.cpp
similarity index 90%
rename from system/system_diagnostic_graph/src/tool.cpp
rename to system/diagnostic_graph_aggregator/src/node/converter.cpp
index fda2c88a691a2..89acfce31a5ab 100644
--- a/system/system_diagnostic_graph/src/tool.cpp
+++ b/system/diagnostic_graph_aggregator/src/node/converter.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "tool.hpp"
+#include "converter.hpp"
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
std::string level_to_string(DiagnosticLevel level)
@@ -35,7 +35,7 @@ std::string level_to_string(DiagnosticLevel level)
return "UNKNOWN";
}
-ToolNode::ToolNode() : Node("system_diagnostic_graph_converter")
+ToolNode::ToolNode() : Node("diagnostic_graph_aggregator_converter")
{
using std::placeholders::_1;
const auto qos_graph = rclcpp::QoS(1);
@@ -66,11 +66,11 @@ void ToolNode::on_graph(const DiagnosticGraph::ConstSharedPtr msg)
pub_array_->publish(message);
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
int main(int argc, char ** argv)
{
- using system_diagnostic_graph::ToolNode;
+ using diagnostic_graph_aggregator::ToolNode;
rclcpp::init(argc, argv);
rclcpp::executors::SingleThreadedExecutor executor;
auto node = std::make_shared();
diff --git a/system/system_diagnostic_graph/src/tool.hpp b/system/diagnostic_graph_aggregator/src/node/converter.hpp
similarity index 81%
rename from system/system_diagnostic_graph/src/tool.hpp
rename to system/diagnostic_graph_aggregator/src/node/converter.hpp
index 5ad19b8460c4b..7a3e8e4e58033 100644
--- a/system/system_diagnostic_graph/src/tool.hpp
+++ b/system/diagnostic_graph_aggregator/src/node/converter.hpp
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef TOOL_HPP_
-#define TOOL_HPP_
+#ifndef NODE__CONVERTER_HPP_
+#define NODE__CONVERTER_HPP_
-#include "core/types.hpp"
+#include "graph/types.hpp"
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
class ToolNode : public rclcpp::Node
@@ -33,6 +33,6 @@ class ToolNode : public rclcpp::Node
void on_graph(const DiagnosticGraph::ConstSharedPtr msg);
};
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // TOOL_HPP_
+#endif // NODE__CONVERTER_HPP_
diff --git a/system/system_diagnostic_graph/src/core/modes.cpp b/system/diagnostic_graph_aggregator/src/node/plugin/modes.cpp
similarity index 93%
rename from system/system_diagnostic_graph/src/core/modes.cpp
rename to system/diagnostic_graph_aggregator/src/node/plugin/modes.cpp
index 1488387811d67..c73de86cba439 100644
--- a/system/system_diagnostic_graph/src/core/modes.cpp
+++ b/system/diagnostic_graph_aggregator/src/node/plugin/modes.cpp
@@ -14,15 +14,15 @@
#include "modes.hpp"
-#include "config.hpp"
-#include "error.hpp"
-#include "units.hpp"
+#include "graph/config.hpp"
+#include "graph/error.hpp"
+#include "graph/units.hpp"
#include
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
OperationModes::OperationModes(rclcpp::Node & node, const std::vector & graph)
@@ -73,4 +73,4 @@ void OperationModes::update(const rclcpp::Time & stamp) const
pub_->publish(message);
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
diff --git a/system/system_diagnostic_graph/src/core/modes.hpp b/system/diagnostic_graph_aggregator/src/node/plugin/modes.hpp
similarity index 85%
rename from system/system_diagnostic_graph/src/core/modes.hpp
rename to system/diagnostic_graph_aggregator/src/node/plugin/modes.hpp
index 47a31b8d2a152..1ed22c7d9d058 100644
--- a/system/system_diagnostic_graph/src/core/modes.hpp
+++ b/system/diagnostic_graph_aggregator/src/node/plugin/modes.hpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CORE__MODES_HPP_
-#define CORE__MODES_HPP_
+#ifndef NODE__PLUGIN__MODES_HPP_
+#define NODE__PLUGIN__MODES_HPP_
-#include "types.hpp"
+#include "graph/types.hpp"
#include
@@ -23,7 +23,7 @@
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
class OperationModes
@@ -46,6 +46,6 @@ class OperationModes
BaseUnit * pull_over_mrm_;
};
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
-#endif // CORE__MODES_HPP_
+#endif // NODE__PLUGIN__MODES_HPP_
diff --git a/system/system_diagnostic_graph/src/tool/main.cpp b/system/diagnostic_graph_aggregator/src/tool/tool.cpp
similarity index 94%
rename from system/system_diagnostic_graph/src/tool/main.cpp
rename to system/diagnostic_graph_aggregator/src/tool/tool.cpp
index 6efb911d8e2d3..657f76c2d91b7 100644
--- a/system/system_diagnostic_graph/src/tool/main.cpp
+++ b/system/diagnostic_graph_aggregator/src/tool/tool.cpp
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "graph.hpp"
-#include "types.hpp"
-#include "units.hpp"
+#include "graph/graph.hpp"
+#include "graph/types.hpp"
+#include "graph/units.hpp"
#include
#include
#include
-namespace system_diagnostic_graph
+namespace diagnostic_graph_aggregator
{
struct GraphNode
@@ -128,7 +128,7 @@ void dump_tree_path(const std::string & path)
}
}
-} // namespace system_diagnostic_graph
+} // namespace diagnostic_graph_aggregator
int main(int argc, char ** argv)
{
@@ -136,5 +136,5 @@ int main(int argc, char ** argv)
std::cerr << "usage: " << argv[0] << " " << std::endl;
return 1;
}
- system_diagnostic_graph::dump_tree_path(argv[1]);
+ diagnostic_graph_aggregator::dump_tree_path(argv[1]);
}
diff --git a/system/system_diagnostic_graph/test/files/test1/field-not-found.yaml b/system/diagnostic_graph_aggregator/test/files/test1/field-not-found.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/field-not-found.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/field-not-found.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/file-not-found.yaml b/system/diagnostic_graph_aggregator/test/files/test1/file-not-found.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/file-not-found.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/file-not-found.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/graph-circulation.yaml b/system/diagnostic_graph_aggregator/test/files/test1/graph-circulation.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/graph-circulation.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/graph-circulation.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/invalid-dict-type.yaml b/system/diagnostic_graph_aggregator/test/files/test1/invalid-dict-type.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/invalid-dict-type.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/invalid-dict-type.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/invalid-list-type.yaml b/system/diagnostic_graph_aggregator/test/files/test1/invalid-list-type.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/invalid-list-type.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/invalid-list-type.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/path-conflict.yaml b/system/diagnostic_graph_aggregator/test/files/test1/path-conflict.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/path-conflict.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/path-conflict.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/path-not-found.yaml b/system/diagnostic_graph_aggregator/test/files/test1/path-not-found.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/path-not-found.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/path-not-found.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/unknown-node-type.yaml b/system/diagnostic_graph_aggregator/test/files/test1/unknown-node-type.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/unknown-node-type.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/unknown-node-type.yaml
diff --git a/system/system_diagnostic_graph/test/files/test1/unknown-substitution.yaml b/system/diagnostic_graph_aggregator/test/files/test1/unknown-substitution.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test1/unknown-substitution.yaml
rename to system/diagnostic_graph_aggregator/test/files/test1/unknown-substitution.yaml
diff --git a/system/system_diagnostic_graph/test/files/test2/and.yaml b/system/diagnostic_graph_aggregator/test/files/test2/and.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test2/and.yaml
rename to system/diagnostic_graph_aggregator/test/files/test2/and.yaml
diff --git a/system/system_diagnostic_graph/test/files/test2/or.yaml b/system/diagnostic_graph_aggregator/test/files/test2/or.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test2/or.yaml
rename to system/diagnostic_graph_aggregator/test/files/test2/or.yaml
diff --git a/system/system_diagnostic_graph/test/files/test2/warn-to-error.yaml b/system/diagnostic_graph_aggregator/test/files/test2/warn-to-error.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test2/warn-to-error.yaml
rename to system/diagnostic_graph_aggregator/test/files/test2/warn-to-error.yaml
diff --git a/system/system_diagnostic_graph/test/files/test2/warn-to-ok.yaml b/system/diagnostic_graph_aggregator/test/files/test2/warn-to-ok.yaml
similarity index 100%
rename from system/system_diagnostic_graph/test/files/test2/warn-to-ok.yaml
rename to system/diagnostic_graph_aggregator/test/files/test2/warn-to-ok.yaml
diff --git a/system/system_diagnostic_graph/test/src/test1.cpp b/system/diagnostic_graph_aggregator/test/src/test1.cpp
similarity index 94%
rename from system/system_diagnostic_graph/test/src/test1.cpp
rename to system/diagnostic_graph_aggregator/test/src/test1.cpp
index d01822e93c2eb..48a0e1f45ce07 100644
--- a/system/system_diagnostic_graph/test/src/test1.cpp
+++ b/system/diagnostic_graph_aggregator/test/src/test1.cpp
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "core/error.hpp"
-#include "core/graph.hpp"
+#include "graph/error.hpp"
+#include "graph/graph.hpp"
#include "utils.hpp"
#include
-using namespace system_diagnostic_graph; // NOLINT(build/namespaces)
+using namespace diagnostic_graph_aggregator; // NOLINT(build/namespaces)
TEST(ConfigFile, RootNotFound)
{
diff --git a/system/system_diagnostic_graph/test/src/test2.cpp b/system/diagnostic_graph_aggregator/test/src/test2.cpp
similarity index 97%
rename from system/system_diagnostic_graph/test/src/test2.cpp
rename to system/diagnostic_graph_aggregator/test/src/test2.cpp
index 3e4c946f73fb7..1098ff9efb0db 100644
--- a/system/system_diagnostic_graph/test/src/test2.cpp
+++ b/system/diagnostic_graph_aggregator/test/src/test2.cpp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "core/error.hpp"
-#include "core/graph.hpp"
+#include "graph/error.hpp"
+#include "graph/graph.hpp"
#include "utils.hpp"
#include
@@ -22,7 +22,7 @@
#include
-using namespace system_diagnostic_graph; // NOLINT(build/namespaces)
+using namespace diagnostic_graph_aggregator; // NOLINT(build/namespaces)
using diagnostic_msgs::msg::DiagnosticArray;
using diagnostic_msgs::msg::DiagnosticStatus;
diff --git a/system/system_diagnostic_graph/test/src/utils.cpp b/system/diagnostic_graph_aggregator/test/src/utils.cpp
similarity index 100%
rename from system/system_diagnostic_graph/test/src/utils.cpp
rename to system/diagnostic_graph_aggregator/test/src/utils.cpp
diff --git a/system/system_diagnostic_graph/test/src/utils.hpp b/system/diagnostic_graph_aggregator/test/src/utils.hpp
similarity index 100%
rename from system/system_diagnostic_graph/test/src/utils.hpp
rename to system/diagnostic_graph_aggregator/test/src/utils.hpp
diff --git a/system/system_diagnostic_graph/doc/format/diag.md b/system/system_diagnostic_graph/doc/format/diag.md
deleted file mode 100644
index 9835924f08996..0000000000000
--- a/system/system_diagnostic_graph/doc/format/diag.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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. |
diff --git a/system/system_diagnostic_graph/example/example.launch.xml b/system/system_diagnostic_graph/example/example.launch.xml
deleted file mode 100644
index 1456bfd5c6593..0000000000000
--- a/system/system_diagnostic_graph/example/example.launch.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/system/system_diagnostic_graph/launch/system_diagnostic_graph.launch.xml b/system/system_diagnostic_graph/launch/system_diagnostic_graph.launch.xml
deleted file mode 100644
index 5b9a84947d179..0000000000000
--- a/system/system_diagnostic_graph/launch/system_diagnostic_graph.launch.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-