RapyutaSimulationPlugins
Public Member Functions | Public Attributes | List of all members
URRROS2HitSensorComponent Class Reference

Publish Hit status with OnActorHit and OnComponentHit. More...

#include <RRROS2HitSensorComponent.h>

Inheritance diagram for URRROS2HitSensorComponent:
Inheritance graph
[legend]
Collaboration diagram for URRROS2HitSensorComponent:
Collaboration graph
[legend]

Public Member Functions

 URRROS2HitSensorComponent ()
 Construct a new URRROS2HitSensorComponent object. More...
 
void BeginPlay () override
 
virtual void BindCallback (UObject *InTargetObject)
 Bind OnActorHit and OnComponentHit delegate with TargetObjects. More...
 
virtual void OnHit (AActor *SelfActor, AActor *OtherActor, FVector NormalImpulse, const FHitResult &Hit, const FString &Name=TEXT(""))
 Common hit process called from OnTargetComponentHit and OnTargetActorHit. More...
 
virtual void OnTargetComponentHit (UPrimitiveComponent *HitComp, AActor *OtherActor, UPrimitiveComponent *OtherComp, FVector NormalImpulse, const FHitResult &Hit)
 
virtual void OnTargetActorHit (AActor *SelfActor, AActor *OtherActor, FVector NormalImpulse, const FHitResult &Hit)
 
virtual void SetROS2Msg (UROS2GenericMsg *InMessage) override
 Set result of #GetROS2Data to InMessage. More...
 
bool IsIgnore (AActor *SelfActor, AActor *OtherActor, UPrimitiveComponent *OtherComp)
 
- Public Member Functions inherited from URRROS2BaseSensorComponent
 URRROS2BaseSensorComponent ()
 Construct a new URRROS2BaseSensorComponent object. More...
 
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. More...
 
virtual void CreatePublisher (const FString &InPublisherName=TEXT(""))
 Create a Publisher with SensorPublisherClass. More...
 
virtual void PreInitializePublisher (UROS2NodeComponent *InROS2Node, const FString &InTopicName=TEXT(""))
 Set publish frequency, topic name and FrameId. More...
 
virtual void InitializePublisher (UROS2NodeComponent *InROS2Node, const UROS2QoS InQoS=UROS2QoS::SensorData)
 Initialize Sensorpublisher by using UROS2Publisher's methods. More...
 
virtual void Run ()
 Start timer to update and publish sensor data by using SetTimer. More...
 
virtual void Stop ()
 Stop timer to update and publish sensor data by using ClearTimer. More...
 
virtual void SensorUpdate ()
 Update Sensor data. This method should be overwritten by child class. More...
 

Public Attributes

TArray< UObject * > TargetObjects
 List of UObject which is whether child class of PrimitiveComponent or Actor. More...
 
FROSHitEvent Data
 
bool bIgnoreSelf = true
 Ignore collision with Owner Actor or self component. More...
 
TArray< UObject * > IgnoreList
 List of object which collide with are ignored. More...
 
- Public Attributes inherited from URRROS2BaseSensorComponent
TSubclassOf< UROS2Publisher > SensorPublisherClass = URRROS2BaseSensorPublisher::StaticClass()
 
URRROS2BaseSensorPublisherSensorPublisher = nullptr
 
TSubclassOf< UROS2GenericMsg > MsgClass = UROS2GenericMsg::StaticClass()
 
FString TopicName = TEXT("sensor_data")
 
FString FrameId = TEXT("sensor_frame")
 
int32 PublicationFrequencyHz = 30
 
bool bAppendNodeNamespace = true
 Append namespace to FrameId or not. More...
 
bool bIsValid = true
 

Additional Inherited Members

- Protected Attributes inherited from URRROS2BaseSensorComponent
FTimerHandle TimerHandle
 

Detailed Description

Publish Hit status with OnActorHit and OnComponentHit.

Publish event when hit event happened from TargetObjects

UCLASS(ClassGroup = (Custom), Blueprintable, meta = (BlueprintSpawnableComponent))

Constructor & Destructor Documentation

◆ URRROS2HitSensorComponent()

URRROS2HitSensorComponent::URRROS2HitSensorComponent ( )
inline

Construct a new URRROS2HitSensorComponent object.

Member Function Documentation

◆ BeginPlay()

void URRROS2HitSensorComponent::BeginPlay ( )
override

◆ BindCallback()

virtual void URRROS2HitSensorComponent::BindCallback ( UObject *  InTargetObject)
virtual

Bind OnActorHit and OnComponentHit delegate with TargetObjects.

UFUNCTION(BlueprintCallable)

◆ IsIgnore()

bool URRROS2HitSensorComponent::IsIgnore ( AActor *  SelfActor,
AActor *  OtherActor,
UPrimitiveComponent *  OtherComp 
)

◆ OnHit()

virtual void URRROS2HitSensorComponent::OnHit ( AActor *  SelfActor,
AActor *  OtherActor,
FVector  NormalImpulse,
const FHitResult &  Hit,
const FString &  Name = TEXT("") 
)
virtual

Common hit process called from OnTargetComponentHit and OnTargetActorHit.

Fill data and publish topic.

UFUNCTION()

◆ OnTargetActorHit()

virtual void URRROS2HitSensorComponent::OnTargetActorHit ( AActor *  SelfActor,
AActor *  OtherActor,
FVector  NormalImpulse,
const FHitResult &  Hit 
)
virtual

◆ OnTargetComponentHit()

virtual void URRROS2HitSensorComponent::OnTargetComponentHit ( UPrimitiveComponent *  HitComp,
AActor *  OtherActor,
UPrimitiveComponent *  OtherComp,
FVector  NormalImpulse,
const FHitResult &  Hit 
)
virtual

◆ SetROS2Msg()

virtual void URRROS2HitSensorComponent::SetROS2Msg ( UROS2GenericMsg *  InMessage)
overridevirtual

Set result of #GetROS2Data to InMessage.

Parameters
InMessage

Reimplemented from URRROS2BaseSensorComponent.

Member Data Documentation

◆ bIgnoreSelf

bool URRROS2HitSensorComponent::bIgnoreSelf = true

Ignore collision with Owner Actor or self component.

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ Data

FROSHitEvent URRROS2HitSensorComponent::Data

◆ IgnoreList

TArray<UObject*> URRROS2HitSensorComponent::IgnoreList

List of object which collide with are ignored.

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ TargetObjects

TArray<UObject*> URRROS2HitSensorComponent::TargetObjects

List of UObject which is whether child class of PrimitiveComponent or Actor.

Topic is published when Hit event happen from the object in this list.

UPROPERTY(EditAnywhere, BlueprintReadWrite)


The documentation for this class was generated from the following file: