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

Base ROS 2 Sensor Component class. Other sensors class should inherit from this class. More...

#include <RRROS2BaseSensorComponent.h>

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

Public Member Functions

 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...
 
virtual void SetROS2Msg (UROS2GenericMsg *InMessage)
 Set sensor data to ROS 2 msg. This method should be overwritten by child class. More...
 

Public Attributes

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
 

Protected Attributes

FTimerHandle TimerHandle
 

Detailed Description

Base ROS 2 Sensor Component class. Other sensors class should inherit from this class.

Provide features to initialize with UROS2NodeComponent

and initialize URRROS2BaseSensorPublisher.

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

Constructor & Destructor Documentation

◆ URRROS2BaseSensorComponent()

URRROS2BaseSensorComponent::URRROS2BaseSensorComponent ( )

Construct a new URRROS2BaseSensorComponent object.

Member Function Documentation

◆ CreatePublisher()

virtual void URRROS2BaseSensorComponent::CreatePublisher ( const FString &  InPublisherName = TEXT(""))
virtual

Create a Publisher with SensorPublisherClass.

Parameters
InPublisherNameIf this is empty, publisher name become this component name + SensorPublisher.

UFUNCTION(BlueprintCallable)

◆ InitalizeWithROS2()

virtual void URRROS2BaseSensorComponent::InitalizeWithROS2 ( UROS2NodeComponent *  InROS2Node,
const FString &  InPublisherName = TEXT(""),
const FString &  InTopicName = TEXT(""),
const UROS2QoS  InQoS = UROS2QoS::SensorData 
)
virtual

Create and initialize publisher and start sensor update by calling.

CreatePublisher, PreInitializePublisher, InitializePublisher and Run.

Parameters
InROS2NodeROS2Node which this publisher belongs to
InPublisherNamePublisher component name
InTopicNameTopic name
InQoSTopic QoS
See also
UROS2NodeComponent
ROS 2 QoS

UFUNCTION(BlueprintCallable)

Reimplemented in URRPoseSensorManager, and URRROS2OverlapSensorComponent.

◆ InitializePublisher()

virtual void URRROS2BaseSensorComponent::InitializePublisher ( UROS2NodeComponent *  InROS2Node,
const UROS2QoS  InQoS = UROS2QoS::SensorData 
)
virtual

Initialize Sensorpublisher by using UROS2Publisher's methods.

Parameters
InROS2NodeROS2Node which this publisher belongs to
InQoS
See also
ROS 2 QoS

UFUNCTION(BlueprintCallable)

◆ PreInitializePublisher()

virtual void URRROS2BaseSensorComponent::PreInitializePublisher ( UROS2NodeComponent *  InROS2Node,
const FString &  InTopicName = TEXT("") 
)
virtual

Set publish frequency, topic name and FrameId.

if bAppendNodeNamespace == true, FrameId become ROS2Node's namespace + #FramId

Parameters
InROS2NodeROS2Node which this publisher belongs to
InTopicNameIf this is empty, topic name become TopicName.

UFUNCTION(BlueprintCallable)

Reimplemented in URRROS2CameraComponent, and URRBaseOdomComponent.

◆ Run()

virtual void URRROS2BaseSensorComponent::Run ( )
virtual

Start timer to update and publish sensor data by using SetTimer.

See also
SetTimer

UFUNCTION(BlueprintCallable)

Reimplemented in URR2DLidarComponent, and URR3DLidarComponent.

◆ SensorUpdate()

virtual void URRROS2BaseSensorComponent::SensorUpdate ( )
inlinevirtual

◆ SetROS2Msg()

virtual void URRROS2BaseSensorComponent::SetROS2Msg ( UROS2GenericMsg *  InMessage)
inlinevirtual

◆ Stop()

virtual void URRROS2BaseSensorComponent::Stop ( )
virtual

Stop timer to update and publish sensor data by using ClearTimer.

See also
ClearTimer

UFUNCTION(BlueprintCallable)

Member Data Documentation

◆ bAppendNodeNamespace

bool URRROS2BaseSensorComponent::bAppendNodeNamespace = true

◆ bIsValid

bool URRROS2BaseSensorComponent::bIsValid = true

◆ FrameId

FString URRROS2BaseSensorComponent::FrameId = TEXT("sensor_frame")

◆ MsgClass

TSubclassOf<UROS2GenericMsg> URRROS2BaseSensorComponent::MsgClass = UROS2GenericMsg::StaticClass()

◆ PublicationFrequencyHz

int32 URRROS2BaseSensorComponent::PublicationFrequencyHz = 30

◆ SensorPublisher

URRROS2BaseSensorPublisher* URRROS2BaseSensorComponent::SensorPublisher = nullptr

◆ SensorPublisherClass

TSubclassOf<UROS2Publisher> URRROS2BaseSensorComponent::SensorPublisherClass = URRROS2BaseSensorPublisher::StaticClass()

◆ TimerHandle

FTimerHandle URRROS2BaseSensorComponent::TimerHandle
protected

◆ TopicName

FString URRROS2BaseSensorComponent::TopicName = TEXT("sensor_data")

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