rclUE
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
UROS2Topic Class Reference

ROS2 topic class. Parent class of UROS2Publisher and UROS2Subscriber. More...

#include <ROS2Topic.h>

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

Public Member Functions

virtual bool InitializeWithROS2 (UROS2NodeComponent *InROS2Node)
 Initialize Topic with ROS2Node. More...
 
virtual bool Init ()
 Initialize topic, InitializeMessage and InitializeTopicComponent. More...
 
virtual bool InitializeMessage ()
 Create TopicMessage instance and initialize it. More...
 
virtual void Destroy ()
 Destroy topic and TopicMessage. More...
 

Public Attributes

FString TopicName
 this information is redundant with Topic, but it's needed to initialize it More...
 
TSubclassOf< UROS2GenericMsgMsgClass
 this information is redundant with Topic, but it's needed to initialize it More...
 
UROS2NodeComponentOwnerNode = nullptr
 ROS2Node which own this topic. More...
 
TEnumAsByte< UROS2StateState = UROS2State::Created
 State. More...
 
UROS2QoS QoS = UROS2QoS::Default
 Quality of service. More...
 
TOptional< rmw_qos_profile_t > QoSProfile
 Optional custom QoS profile. More...
 
UROS2GenericMsgTopicMessage
 Message Instance. More...
 

Protected Member Functions

rmw_qos_profile_t GetEffectiveQoS () const
 Get the effective QoS profile to use for this topic. More...
 
virtual void InitializeTopicComponent ()
 Initialize ROS2 Topic. Should be implemented in UROS2Publisher and UROS2Subscriber. More...
 

Detailed Description

ROS2 topic class. Parent class of UROS2Publisher and UROS2Subscriber.

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

Member Function Documentation

◆ Destroy()

virtual void UROS2Topic::Destroy ( )
virtual

Destroy topic and TopicMessage.

UFUNCTION()

Reimplemented in UROS2Subscriber, and UROS2Publisher.

◆ GetEffectiveQoS()

rmw_qos_profile_t UROS2Topic::GetEffectiveQoS ( ) const
inlineprotected

Get the effective QoS profile to use for this topic.

Returns custom QoS if set, otherwise returns the QoS from QoS_LUT

Returns
rmw_qos_profile_t The QoS profile to use

◆ Init()

virtual bool UROS2Topic::Init ( )
virtual

◆ InitializeMessage()

virtual bool UROS2Topic::InitializeMessage ( )
virtual

Create TopicMessage instance and initialize it.

UFUNCTION(BlueprintCallable)

◆ InitializeTopicComponent()

virtual void UROS2Topic::InitializeTopicComponent ( )
protectedvirtual

Initialize ROS2 Topic. Should be implemented in UROS2Publisher and UROS2Subscriber.

UFUNCTION()

Reimplemented in UROS2Publisher, and UROS2Subscriber.

◆ InitializeWithROS2()

virtual bool UROS2Topic::InitializeWithROS2 ( UROS2NodeComponent InROS2Node)
virtual

Initialize Topic with ROS2Node.

Parameters
InROS2NodeROS2Node which this publisher/subscriber belongs to

Member Data Documentation

◆ MsgClass

TSubclassOf<UROS2GenericMsg> UROS2Topic::MsgClass

this information is redundant with Topic, but it's needed to initialize it

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ OwnerNode

UROS2NodeComponent* UROS2Topic::OwnerNode = nullptr

ROS2Node which own this topic.

UPROPERTY(VisibleAnywhere, BlueprintReadWrite)

◆ QoS

UROS2QoS UROS2Topic::QoS = UROS2QoS::Default

◆ QoSProfile

TOptional<rmw_qos_profile_t> UROS2Topic::QoSProfile

Optional custom QoS profile.

Use this when you need fine-grained QoS settings that are not covered by the UROS2QoS

enum presets (for example, custom reliability, durability, history depth, deadline,

or lifespan values).

If this optional has a value, it takes precedence over the QoS enum above and the stored

rmw_qos_profile_t is passed directly to the underlying RMW layer. If it is not set, the

QoS enum is used to derive the effective QoS settings.

Example usage in C++:

rmw_qos_profile_t CustomProfile = rmw_qos_profile_default;
CustomProfile.reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
CustomProfile.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
CustomProfile.depth = 10;
MyTopic->QoS = UROS2QoS::Default; // used only if QoSProfile is not set
MyTopic->QoSProfile = CustomProfile; // overrides the enum-based QoS

◆ State

TEnumAsByte<UROS2State> UROS2Topic::State = UROS2State::Created

◆ TopicMessage

UROS2GenericMsg* UROS2Topic::TopicMessage

◆ TopicName

FString UROS2Topic::TopicName

this information is redundant with Topic, but it's needed to initialize it

UPROPERTY(EditAnywhere, BlueprintReadWrite)


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