RapyutaSimulationPlugins
RRROS2OverlapSensorComponent.h
Go to the documentation of this file.
1 
13 #pragma once
14 
15 
16 
17 // UE
18 
19 #include "CoreMinimal.h"
20 
21 #include "EngineUtils.h"
22 
23 
24 
25 // rclUE
26 
28 
29 
30 
31 #include <Msgs/ROS2OverlapEvent.h>
32 
33 #include <Msgs/ROS2Overlaps.h>
34 
35 
36 
37 // RapyutaSimulationPlugins
38 
39 #include "Core/RRGeneralUtils.h"
40 
41 
42 
43 #include "RRROS2OverlapSensorComponent.generated.h"
44 
45 
46 
60 class RAPYUTASIMULATIONPLUGINS_API URRROS2OverlapSensorComponent : public URRROS2BaseSensorComponent
61 
62 {
63 
64 
65 
66 public:
67 
77 
78 
79 
96  virtual void InitalizeWithROS2(UROS2NodeComponent* InROS2Node,
97 
98  const FString& InPublisherName = EMPTY_STR,
99 
100  const FString& InTopicName = EMPTY_STR,
101 
102  const UROS2QoS InQoS = UROS2QoS::SensorData) override;
103 
104 
105 
106  void BeginPlay() override;
107 
108 
109 
116  virtual void SensorUpdate() override;
117 
118 
119 
120 
125  TArray<UObject*> TargetObjects;
126 
127 
128 
130 
131  void AddTarget(UObject* InTargetObject);
132 
133 
134 
136 
137  void BindCallback(UObject* InTargetObject);
138 
139 
140 
142 
144 
145  void OnOverlap(AActor* OverlappedActor,
146 
147  AActor* OtherActor,
148 
149  UPrimitiveComponent* OtherComp,
150 
151  const bool InBegin,
152 
153  const FString& Name = TEXT(""));
154 
155 
156 
158 
160 
161  void OnComponentOverlap(UPrimitiveComponent* OverlappedComponent,
162 
163  AActor* OtherActor,
164 
165  UPrimitiveComponent* OtherComp,
166 
167  int32 OtherBodyIndex,
168 
169  const bool InBegin);
170 
171 
172 
173 
178  virtual void OnTargetComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent,
179 
180  AActor* OtherActor,
181 
182  UPrimitiveComponent* OtherComp,
183 
184  int32 OtherBodyIndex,
185 
186  bool bFromSweep,
187 
188  const FHitResult& SweepResult);
189 
190 
191 
192 
197  virtual void OnTargetComponentEndOverlap(UPrimitiveComponent* OverlappedComponent,
198 
199  AActor* OtherActor,
200 
201  UPrimitiveComponent* OtherComp,
202 
203  int32 OtherBodyIndex);
204 
205 
206 
207 
212  void OnTargetActorBeginOverlap(AActor* OverlappedActor, AActor* OtherActor);
213 
214 
215 
216 
221  void OnTargetActorEndOverlap(AActor* OverlappedActor, AActor* OtherActor);
222 
223 
224 
225  // ROS
226 
237  virtual void SetROS2Msg(UROS2GenericMsg* InMessage) override;
238 
239 
240 
254  UROS2Publisher* EventPublisher = nullptr;
255 
256 
257 
258 
263  FString EventTopicName = TEXT("");
264 
265 
266 
268 
269 
274  FROSOverlapEvent Data;
275 
276 
277 
279 
280 
285  FROSOverlaps Overlaps;
286 
287 
288 
290 
291 
296  bool bIgnoreSelf = true;
297 
298 
299 
301 
302 
307  TArray<UObject*> IgnoreList;
308 
309 
310 
311  bool IsIgnore(AActor* SelfActor, AActor* OtherActor, UPrimitiveComponent* OtherComp);
312 
313 };
314 
URRROS2OverlapSensorComponent::IgnoreList
TArray< UObject * > IgnoreList
List of object which collide with are ignored.
Definition: RRROS2OverlapSensorComponent.h:307
EMPTY_STR
#define EMPTY_STR
Definition: RRGeneralUtils.h:43
URRROS2OverlapSensorComponent::TargetObjects
TArray< UObject * > TargetObjects
Definition: RRROS2OverlapSensorComponent.h:125
URRROS2BaseSensorComponent::SetROS2Msg
virtual void SetROS2Msg(UROS2GenericMsg *InMessage)
Set sensor data to ROS 2 msg. This method should be overwritten by child class.
Definition: RRROS2BaseSensorComponent.h:367
URRROS2BaseSensorComponent::SensorUpdate
virtual void SensorUpdate()
Update Sensor data. This method should be overwritten by child class.
Definition: RRROS2BaseSensorComponent.h:348
URRROS2OverlapSensorComponent::Data
FROSOverlapEvent Data
Overlap Event data.
Definition: RRROS2OverlapSensorComponent.h:274
URRROS2BaseSensorComponent::InitalizeWithROS2
virtual void InitalizeWithROS2(UROS2NodeComponent *InROS2Node, const FString &InPublisherName=TEXT(""), const FString &InTopicName=TEXT(""), const UROS2QoS InQoS=UROS2QoS::SensorData)
Create and initialize publisher and start sensor update by calling.
RRROS2BaseSensorComponent.h
Base ROS 2 Sensor Component class. Other sensors class should inherit from this class.
RRGeneralUtils.h
General utils.
URRROS2BaseSensorComponent
Base ROS 2 Sensor Component class. Other sensors class should inherit from this class.
Definition: RRROS2BaseSensorComponent.h:175
URRROS2OverlapSensorComponent
Publish overlappping acotors and components and begin/end event.
Definition: RRROS2OverlapSensorComponent.h:60
URRROS2OverlapSensorComponent::Overlaps
FROSOverlaps Overlaps
List of Overlapping Actors and Components.
Definition: RRROS2OverlapSensorComponent.h:285