forked from BehaviorTree/BehaviorTree.ROS2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.cpp
More file actions
100 lines (85 loc) · 5.84 KB
/
plugin.cpp
File metadata and controls
100 lines (85 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include "behaviortree_ros2/behaviortree_ros2.hpp"
#include "behaviortree_ros2/actions/ros_log.hpp"
#include "behaviortree_ros2/actions/GetTransformAnglesNode.hpp"
#include "behaviortree_ros2/actions/GetTransformDistanceNode.hpp"
#include "behaviortree_ros2/actions/GetTransformHorizontalDistance.hpp"
#include "behaviortree_ros2/actions/LookupTransformNode.hpp"
#include <std_msgs/msg/empty.hpp>
#include <std_msgs/msg/bool.hpp>
#include <std_msgs/msg/int8.hpp>
#include <std_msgs/msg/u_int8.hpp>
#include <std_msgs/msg/int16.hpp>
#include <std_msgs/msg/u_int16.hpp>
#include <std_msgs/msg/int32.hpp>
#include <std_msgs/msg/u_int32.hpp>
#include <std_msgs/msg/int64.hpp>
#include <std_msgs/msg/u_int64.hpp>
#include <std_msgs/msg/float32.hpp>
#include <std_msgs/msg/float64.hpp>
#include <std_msgs/msg/string.hpp>
#include <std_srvs/srv/empty.hpp>
#include <std_srvs/srv/set_bool.hpp>
#include <std_srvs/srv/trigger.hpp>
//TEST
#include <std_msgs/msg/int8_multi_array.hpp>
#include "btcpp_ros2_interfaces/action/sleep.hpp"
#include "btcpp_ros2_interfaces/action/execute_tree.hpp"
#include "btcpp_ros2_interfaces/msg/custom_msg.hpp"
using namespace BT;
BT_REGISTER_ROS_NODES(factory, params)
{
//LOGS
factory.registerNodeType<DebugLog>("DebugLog");
factory.registerNodeType<InfoLog>("InfoLog");
factory.registerNodeType<WarnLog>("WarnLog");
factory.registerNodeType<ErrorLog>("ErrorLog");
factory.registerNodeType<FatalLog>("FatalLog");
//TF
factory.registerNodeType<LookupTransformNode>("LookupTransform");
factory.registerNodeType<GetTransformDistanceNode>("GetTransformDistance");
factory.registerNodeType<GetTransformAnglesNode>("GetTransformAngles");
factory.registerNodeType<GetTransformHorizontalDistanceNode>("GetTransformHorizontalDistance");
//PRIMITIVE SUBSCRIBERS
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Empty>>("MonitorAutoStdEmpty",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Bool>>("MonitorAutoStdBool",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Int8>>("MonitorAutoStdChar",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::UInt8>>("MonitorAutoStdUChar",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Int16>>("MonitorAutoStdShort",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::UInt16>>("MonitorAutoStdUShort",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Int32>>("MonitorAutoStdInt",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::UInt32>>("MonitorAutoStdUInt",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Int64>>("MonitorAutoStdLong",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::UInt64>>("MonitorAutoStdULong",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Float32>>("MonitorAutoStdFloat",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::Float64>>("MonitorAutoStdDouble",params);
factory.registerNodeType<AutoSerSubscriber<std_msgs::msg::String>>("MonitorAutoStdString",params);
// Possible variant of PRIMITIVE SUBSCRIBER WITH JSON Serialization
factory.registerNodeType<JsonSerSubscriber<std_msgs::msg::Int32>>("MonitorJsonStdInt",params);
//PRIMITIVE PUBLISHERS
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Empty>>("PublishAutoStdEmpty",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Bool>>("PublishAutoStdBool",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Int8>>("PublishAutoStdChar",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::UInt8>>("PublishAutoStdUChar",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Int16>>("PublishAutoStdShort",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::UInt16>>("PublishAutoStdUShort",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Int32>>("PublishAutoStdInt",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::UInt32>>("PublishAutoStdUInt",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Int64>>("PublishAutoStdLong",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::UInt64>>("PublishAutoStdULong",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Float32>>("PublishAutoStdFloat",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Float64>>("PublishAutoStdDouble",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::String>>("PublishAutoStdString",params);
//PRIMITIVE SERVICES
factory.registerNodeType<AutoDesJsonSerServiceClient<std_srvs::srv::Empty>>("ServiceAutoCallJsonEmpty",params);
factory.registerNodeType<AutoDesJsonSerServiceClient<std_srvs::srv::SetBool>>("ServiceAutoCallJsonBool",params);
factory.registerNodeType<AutoDesJsonSerServiceClient<std_srvs::srv::Trigger>>("ServiceAutoCallJsonTrigger",params);
//TEST ACTIONS
factory.registerNodeType<AutoDesJsonSerActionClient<btcpp_ros2_interfaces::action::Sleep>>("ActionAutoCallJsonSleep",params);
factory.registerNodeType<AutoDesJsonSerActionClient<btcpp_ros2_interfaces::action::ExecuteTree>>("ActionAutoCallJsonExecuteTree",params);
//TEST
factory.registerNodeType<AutoDesPublisher<btcpp_ros2_interfaces::msg::NodeStatus>>("PublishNodeStatus",params);
factory.registerNodeType<AutoDesPublisher<btcpp_ros2_interfaces::msg::CustomMsg>>("PublishCustomMsg",params);
factory.registerNodeType<AutoDesPublisher<std_msgs::msg::Int8MultiArray>>("PublishStdMultiArray",params);
factory.registerNodeType<SmartJsonSerSubscriber<btcpp_ros2_interfaces::msg::NodeStatus>>("MonitorSmartJsonNodeStatus",params);
factory.registerNodeType<SmartJsonSerSubscriber<btcpp_ros2_interfaces::msg::CustomMsg>>("MonitorSmartJsonCustomMsg",params);
};