Skip to content

Commit

Permalink
feat: apply autoware prefix for component_state_monitor and its d…
Browse files Browse the repository at this point in the history
…ependencies (#9961)

Signed-off-by: Junya Sasaki <[email protected]>
Signed-off-by: Takagi, Isamu <[email protected]>
Signed-off-by: Ryohsuke Mitsudome <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
  • Loading branch information
sasakisasaki authored Jan 27, 2025
1 parent f89ea33 commit 4c13bb0
Show file tree
Hide file tree
Showing 105 changed files with 158 additions and 154 deletions.
4 changes: 2 additions & 2 deletions launch/tier4_system_launch/launch/system.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

<!-- Component State Monitor -->
<group>
<include file="$(find-pkg-share component_state_monitor)/launch/component_state_monitor.launch.py">
<include file="$(find-pkg-share autoware_component_state_monitor)/launch/component_state_monitor.launch.py">
<arg name="mode" value="$(var run_mode)"/>
<arg name="file" value="$(var component_state_monitor_topic_path)"/>
</include>
Expand All @@ -92,7 +92,7 @@

<!-- Diagnostic Graph Aggregator -->
<group>
<include file="$(find-pkg-share system_diagnostic_monitor)/launch/system_diagnostic_monitor.launch.xml">
<include file="$(find-pkg-share autoware_system_diagnostic_monitor)/launch/system_diagnostic_monitor.launch.xml">
<arg name="param_file" value="$(var diagnostic_graph_aggregator_param_path)"/>
<arg name="graph_file" value="$(var diagnostic_graph_aggregator_graph_path)"/>
</include>
Expand Down
2 changes: 1 addition & 1 deletion launch/tier4_system_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<exec_depend>autoware_component_state_monitor</exec_depend>
<exec_depend>autoware_system_monitor</exec_depend>
<exec_depend>component_state_monitor</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package component_state_monitor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package autoware_component_state_monitor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.40.0 (2024-12-12)
-------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(component_state_monitor)
project(autoware_component_state_monitor)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand All @@ -9,7 +9,7 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
)

rclcpp_components_register_nodes(${PROJECT_NAME}
"component_state_monitor::StateMonitor"
"autoware::component_state_monitor::StateMonitor"
)

ament_auto_package(INSTALL_TO_SHARE config launch)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# component_state_monitor
# autoware_component_state_monitor

The component state monitor checks the state of each component using topic state monitor.
This is an implementation for backward compatibility with the AD service state monitor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_topic_monitor_name(row):

def create_topic_monitor_node(row):
tf_mode = "" if "topic_type" in row["args"] else "_tf"
package = FindPackageShare("topic_state_monitor")
package = FindPackageShare("autoware_topic_state_monitor")
include = PathJoinSubstitution([package, f"launch/topic_state_monitor{tf_mode}.launch.xml"])
diag_name = create_diagnostic_name(row)
arguments = [("diag_name", diag_name)] + [(k, str(v)) for k, v in row["args"].items()]
Expand All @@ -62,8 +62,8 @@ def launch_setup(context, *args, **kwargs):
component = ComposableNode(
namespace="component_state_monitor",
name="component",
package="component_state_monitor",
plugin="component_state_monitor::StateMonitor",
package="autoware_component_state_monitor",
plugin="autoware::component_state_monitor::StateMonitor",
parameters=[{"topic_monitor_names": topic_monitor_names}, topic_monitor_param],
)
container = ComposableNodeContainer(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>component_state_monitor</name>
<name>autoware_component_state_monitor</name>
<version>0.40.0</version>
<description>The component_state_monitor package</description>
<description>The autoware_component_state_monitor package</description>
<maintainer email="[email protected]">Takagi, Isamu</maintainer>
<maintainer email="[email protected]">Junya Sasaki</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand All @@ -15,7 +16,7 @@
<depend>rclcpp_components</depend>
<depend>tier4_system_msgs</depend>

<exec_depend>topic_state_monitor</exec_depend>
<exec_depend>autoware_topic_state_monitor</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <unordered_map>
#include <vector>

namespace component_state_monitor
namespace autoware::component_state_monitor
{

// clang-format off
Expand Down Expand Up @@ -129,7 +129,7 @@ void StateMonitor::on_diag(const DiagnosticArray::ConstSharedPtr msg)
}
}

} // namespace component_state_monitor
} // namespace autoware::component_state_monitor

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(component_state_monitor::StateMonitor)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::component_state_monitor::StateMonitor)
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <unordered_map>
#include <vector>

namespace component_state_monitor
namespace autoware::component_state_monitor
{

// clang-format off
Expand Down Expand Up @@ -73,6 +73,6 @@ class StateMonitor : public rclcpp::Node
void on_diag(const DiagnosticArray::ConstSharedPtr msg);
};

} // namespace component_state_monitor
} // namespace autoware::component_state_monitor

#endif // MAIN_HPP_
2 changes: 1 addition & 1 deletion system/autoware_default_adapi/document/autoware-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Overview

Since `/autoware/state` was so widely used, this packages creates it from the states of AD API for backwards compatibility.
The diagnostic checks that ad_service_state_monitor used to perform have been replaced by component_state_monitor.
The diagnostic checks that ad_service_state_monitor used to perform have been replaced by autoware_component_state_monitor.
The service `/autoware/shutdown` to change autoware state to finalizing is also supported for compatibility.

![autoware-state-architecture](images/autoware-state-architecture.drawio.svg)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package diagnostic_graph_aggregator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package autoware_diagnostic_graph_aggregator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.40.0 (2024-12-12)
-------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(diagnostic_graph_aggregator)
project(autoware_diagnostic_graph_aggregator)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down Expand Up @@ -30,8 +30,8 @@ ament_auto_add_library(aggregator SHARED
target_include_directories(aggregator PRIVATE src/common)

rclcpp_components_register_node(aggregator
PLUGIN "diagnostic_graph_aggregator::AggregatorNode"
EXECUTABLE aggregator_node
PLUGIN "autoware::diagnostic_graph_aggregator::AggregatorNode"
EXECUTABLE ${PROJECT_NAME}_node
)

if(BUILD_TESTING)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# diagnostic_graph_aggregator
# autoware_diagnostic_graph_aggregator

## Overview

Expand Down Expand Up @@ -66,15 +66,15 @@ This is an example of a diagnostic graph configuration. The configuration can be
- [module2.yaml](./example/graph/module2.yaml)

```bash
ros2 launch diagnostic_graph_aggregator example-main.launch.xml
ros2 launch autoware_diagnostic_graph_aggregator example-main.launch.xml
```

You can reuse the graph by making partial edits. For example, disable hardware checks for simulation.

- [edit.yaml](./example/graph/edit.yaml)

```bash
ros2 launch diagnostic_graph_aggregator example-edit.launch.xml
ros2 launch autoware_diagnostic_graph_aggregator example-edit.launch.xml
```

## Debug tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ This tool displays the graph structure of the configuration file in tree format.
## Usage

```bash
ros2 run diagnostic_graph_aggregator tree <graph-config-path>
ros2 run autoware_diagnostic_graph_aggregator tree <graph-config-path>
```

## Examples

```bash
ros2 run diagnostic_graph_aggregator tree '$(find-pkg-share diagnostic_graph_aggregator)/example/graph/main.yaml'
ros2 run autoware_diagnostic_graph_aggregator tree '$(find-pkg-share autoware_diagnostic_graph_aggregator)/example/graph/main.yaml'
```

```txt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<include file="$(find-pkg-share autoware_diagnostic_graph_aggregator)/launch/aggregator.launch.xml">
<arg name="graph_file" value="$(find-pkg-share autoware_diagnostic_graph_aggregator)/example/graph/edit.yaml"/>
</include>
<executable cmd="python3 $(find-pkg-share autoware_diagnostic_graph_aggregator)/example/dummy-diags.py"/>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<include file="$(find-pkg-share autoware_diagnostic_graph_aggregator)/launch/aggregator.launch.xml">
<arg name="graph_file" value="$(find-pkg-share autoware_diagnostic_graph_aggregator)/example/graph/main.yaml"/>
</include>
<executable cmd="python3 $(find-pkg-share autoware_diagnostic_graph_aggregator)/example/dummy-diags.py"/>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<launch>
<arg name="param_file" default="$(find-pkg-share autoware_diagnostic_graph_aggregator)/config/default.param.yaml"/>
<arg name="graph_file"/>
<node pkg="autoware_diagnostic_graph_aggregator" exec="autoware_diagnostic_graph_aggregator_node">
<param from="$(var param_file)"/>
<param name="graph_file" value="$(var graph_file)"/>
</node>
</launch>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>diagnostic_graph_aggregator</name>
<name>autoware_diagnostic_graph_aggregator</name>
<version>0.40.0</version>
<description>The diagnostic_graph_aggregator package</description>
<maintainer email="[email protected]">Takagi, Isamu</maintainer>
<maintainer email="[email protected]">Junya Sasaki</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <utility>
#include <vector>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

std::string resolve_substitution(const std::string & substitution, const TreeData & data)
Expand Down Expand Up @@ -309,4 +309,4 @@ FileConfig TreeLoader::construct()
return config;
}

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <string>
#include <vector>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

struct PathConfig
Expand Down Expand Up @@ -98,6 +98,6 @@ class TreeLoader
std::vector<FileLoader> files_;
};

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator

#endif // COMMON__GRAPH__CONFIG_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <string>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

TreeData TreeData::Load(const std::string & path)
Expand Down Expand Up @@ -96,4 +96,4 @@ double TreeData::real(double fail)
return yaml_.as<double>(fail);
}

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <string>
#include <vector>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

class TreeData
Expand Down Expand Up @@ -51,6 +51,6 @@ class TreeData
TreePath path_;
};

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator

#endif // COMMON__GRAPH__DATA_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <string>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

TreePath::TreePath(const std::string & file)
Expand Down Expand Up @@ -57,4 +57,4 @@ std::string TreePath::text() const
return " (" + file_ + sep + node_ + ")";
}

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <stdexcept>
#include <string>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

struct TreePath
Expand Down Expand Up @@ -127,6 +127,6 @@ struct GraphStructure : public Exception
using Exception::Exception;
};

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator

#endif // COMMON__GRAPH__ERROR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <string>
#include <unordered_map>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

void Graph::create(const std::string & file, const std::string & id)
Expand Down Expand Up @@ -77,4 +77,4 @@ DiagGraphStatus Graph::create_status(const rclcpp::Time & stamp) const
Graph::Graph() = default;
Graph::~Graph() = default;

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <unordered_map>
#include <vector>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

class Graph
Expand All @@ -51,6 +51,6 @@ class Graph
std::string id_;
};

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator

#endif // COMMON__GRAPH__GRAPH_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <utility>
#include <vector>

namespace diagnostic_graph_aggregator
namespace autoware::diagnostic_graph_aggregator
{

struct UnitLoader::GraphLinks
Expand Down Expand Up @@ -190,4 +190,4 @@ std::unique_ptr<NodeUnit> GraphLoader::create_node(const UnitLoader & unit)
throw UnknownUnitType(unit.data().path(), unit.type());
}

} // namespace diagnostic_graph_aggregator
} // namespace autoware::diagnostic_graph_aggregator
Loading

0 comments on commit 4c13bb0

Please sign in to comment.