File tree 5 files changed +17
-20
lines changed
system/diagnostic_graph_aggregator
5 files changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,6 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
13
13
src/common/graph/units.cpp
14
14
)
15
15
16
- ament_auto_add_executable(aggregator
17
- src/node/aggregator.cpp
18
- src/node/availability.cpp
19
- )
20
- target_include_directories (aggregator PRIVATE src/common)
21
-
22
16
ament_auto_add_executable(tree
23
17
src/tool/tree .cpp
24
18
)
@@ -29,6 +23,17 @@ ament_auto_add_executable(plantuml
29
23
)
30
24
target_include_directories (plantuml PRIVATE src/common)
31
25
26
+ ament_auto_add_library(aggregator SHARED
27
+ src/node/aggregator.cpp
28
+ src/node/availability.cpp
29
+ )
30
+ target_include_directories (aggregator PRIVATE src/common)
31
+
32
+ rclcpp_components_register_node(aggregator
33
+ PLUGIN "diagnostic_graph_aggregator::AggregatorNode"
34
+ EXECUTABLE aggregator_node
35
+ )
36
+
32
37
if (BUILD_TESTING)
33
38
get_filename_component (RESOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /test /files ABSOLUTE )
34
39
ament_auto_add_gtest(gtest_${PROJECT_NAME}
Original file line number Diff line number Diff line change 1
1
<launch >
2
2
<arg name =" param_file" default =" $(find-pkg-share diagnostic_graph_aggregator)/config/default.param.yaml" />
3
3
<arg name =" graph_file" />
4
- <node pkg =" diagnostic_graph_aggregator" exec =" aggregator " name = " aggregator " >
4
+ <node pkg =" diagnostic_graph_aggregator" exec =" aggregator_node " >
5
5
<param from =" $(var param_file)" />
6
6
<param name =" graph_file" value =" $(var graph_file)" />
7
7
</node >
Original file line number Diff line number Diff line change 12
12
13
13
<depend >diagnostic_msgs</depend >
14
14
<depend >rclcpp</depend >
15
+ <depend >rclcpp_components</depend >
15
16
<depend >tier4_system_msgs</depend >
16
17
<depend >yaml_cpp_vendor</depend >
17
18
Original file line number Diff line number Diff line change 21
21
namespace diagnostic_graph_aggregator
22
22
{
23
23
24
- AggregatorNode::AggregatorNode () : Node(" aggregator" )
24
+ AggregatorNode::AggregatorNode (const rclcpp::NodeOptions & options ) : Node(" aggregator" , options )
25
25
{
26
26
const auto stamp = now ();
27
27
@@ -99,14 +99,5 @@ void AggregatorNode::on_diag(const DiagnosticArray & msg)
99
99
100
100
} // namespace diagnostic_graph_aggregator
101
101
102
- int main (int argc, char ** argv)
103
- {
104
- using diagnostic_graph_aggregator::AggregatorNode;
105
- rclcpp::init (argc, argv);
106
- rclcpp::executors::SingleThreadedExecutor executor;
107
- auto node = std::make_shared<AggregatorNode>();
108
- executor.add_node (node);
109
- executor.spin ();
110
- executor.remove_node (node);
111
- rclcpp::shutdown ();
112
- }
102
+ #include < rclcpp_components/register_node_macro.hpp>
103
+ RCLCPP_COMPONENTS_REGISTER_NODE (diagnostic_graph_aggregator::AggregatorNode)
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ namespace diagnostic_graph_aggregator
30
30
class AggregatorNode : public rclcpp ::Node
31
31
{
32
32
public:
33
- AggregatorNode ();
33
+ explicit AggregatorNode (const rclcpp::NodeOptions & options );
34
34
~AggregatorNode ();
35
35
36
36
private:
You can’t perform that action at this time.
0 commit comments