rclUE
ROS2Action.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 
18 
19 // UE
20 
22 
23 #include <Components/ActorComponent.h>
24 
25 #include <CoreMinimal.h>
26 
27 
28 
29 //rclUE
30 
31 #include "ROS2NodeComponent.h"
32 
33 #include "Srvs/ROS2CancelGoal.h"
34 
35 #include "rclcUtilities.h"
36 
37 
38 
39 #include "ROS2Action.generated.h"
40 
41 
42 
43 DECLARE_LOG_CATEGORY_EXTERN(LogROS2Action, Log, All);
44 
45 
46 
47 #define IS_ACTION_INITED(InNode, InName, OutRes) \
48 
49  IS_ROS2NODE_INITED(InNode, InName, OutRes); \
50 
51  \
52 
53  if (State != UROS2State::Initialized) \
54 
55  { \
56 
57  UE_LOG_WITH_INFO( \
58 
59  LogROS2Action, Warning, TEXT("[%s] Action Client/Server is not initialized yet. Please initialize Action."), *InName); \
60 
61  OutRes = false; \
62 
63  }
64 
65 
66 
82 class RCLUE_API UROS2Action : public UObject
83 
84 {
85 
86 
87 
88 public:
89 
104  virtual bool InitializeWithROS2(UROS2NodeComponent* InROS2Node);
105 
106 
107 
125  virtual bool Init();
126 
127 
128 
146  virtual bool InitializeAction();
147 
148 
149 
163  virtual void Destroy();
164 
165 
166 
179  virtual void ProcessReady(rcl_wait_set_t* wait_set);
180 
181 
182 
183 
188  FString ActionName;
189 
190 
191 
193 
194 
199  TSubclassOf<UROS2GenericAction> ActionClass;
200 
201 
202 
204 
205 
211 
212 
213 
215 
216 
222 
223 
224 
226 
227 
232  TEnumAsByte<UROS2State> State = UROS2State::Created;
233 
234 
235 
237 
239 
240 
246 
247 
248 
250 
252 
253 
259 
260 
261 
263 
265 
266 
272 
273 
274 
276 
278 
279 
284  UROS2QoS FeedbackQoS = UROS2QoS::Default;
285 
286 
287 
288 protected:
289 
305  virtual void InitializeActionComponent();
306 
307 };
308 
UROS2QoS::Services
@ Services
UMETA(DisplayName = "Parameters"),.
UROS2Action
Base class implementing ROS2 actions from which ActionServer and ActionClient should inherit.
Definition: ROS2Action.h:82
UROS2Action::OwnerNode
UROS2NodeComponent * OwnerNode
ROS2Node which own this action.
Definition: ROS2Action.h:221
UROS2Action::Action
UROS2GenericAction * Action
ROS2 Action Instance.
Definition: ROS2Action.h:210
IS_ROS2NODE_INITED
#define IS_ROS2NODE_INITED(InNode, InName, OutRes)
Check UROS2NodeComponent is initialized or not.
Definition: ROS2NodeComponent.h:731
UROS2QoS
UROS2QoS
used to set QoS policies
Definition: rclcUtilities.h:177
ROS2GenericAction.h
This should be refactored with other generic ROS2 types (Msgs, Sensors, Actions).
rclcUtilities.h
Header containing utilities and includes that are needed/useful in almost any class in rclUE.
UROS2NodeComponent
Class implementing ROS2 node.
Definition: ROS2NodeComponent.h:782
UROS2GenericAction
This should be refactored with other generic ROS2 types (Msgs, Sensors, Actions).
Definition: ROS2GenericAction.h:46
UROS2Action::ActionClass
TSubclassOf< UROS2GenericAction > ActionClass
type of action
Definition: ROS2Action.h:199
Initialized
@ Initialized
UMETA(DisplayName = "Created"),.
Definition: rclcUtilities.h:158
ROS2NodeComponent.h
Class implementing ROS2 node.