rclUE
Classes | Macros | Functions
ROS2NodeComponent.h File Reference

Class implementing ROS2 node. More...

#include "Components/ActorComponent.h"
#include "Containers/Map.h"
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Actions/ROS2GenericAction.h"
#include "Msgs/ROS2GenericMsg.h"
#include "ROS2Support.h"
#include "Srvs/ROS2GenericSrv.h"
#include "ROS2NodeComponent.generated.h"
Include dependency graph for ROS2NodeComponent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UROS2NodeComponent
 Class implementing ROS2 node. More...
 

Macros

#define ROS2_CREATE_LOOP_PUBLISHER( InROS2Node, InUserObject, InTopicName, InPublisherClass, InMsgClass, InPubFrequency, InCallback, OutPublisher)
 Create #FTopicCallback and call UROS2NodeComponent::CreateLoopPublisher. More...
 
#define ROS2_CREATE_LOOP_PUBLISHER_WITH_QOS( InROS2Node, InUserObject, InTopicName, InPublisherClass, InMsgClass, InPubFrequency, InCallback, InQoS, OutPublisher)
 Create #FTopicCallback and call UROS2NodeComponent::CreateLoopPublisher. More...
 
#define ROS2_CREATE_SUBSCRIBER(InROS2Node, InUserObject, InTopicName, InMsgClass, InCallback)
 Create #FsSubscriptionCallback and call UROS2NodeComponent::CreateSubscriber. More...
 
#define ROS2_CREATE_SUBSCRIBERW_WITH_QOS(InROS2Node, InUserObject, InTopicName, InMsgClass, InCallback, InQoS)
 Create #FsSubscriptionCallback and call #UROS2NodeComponent::CreateSubscriberWithQoS. More...
 
#define ROS2_CREATE_SERVICE_CLIENT(InROS2Node, InUserObject, InServiceName, InSrvClass, InRequestCallback, OutClient)
 Create #FServiceCallback and call UROS2NodeComponent::CreateServiceClient. More...
 
#define ROS2_CREATE_SERVICE_CLIENT_WITH_QOS( InROS2Node, InUserObject, InServiceName, InSrvClass, InRequestCallback, InQoS, OutClient)
 Create #FServiceCallback and call UROS2NodeComponent::CreateServiceClient. More...
 
#define ROS2_CREATE_SERVICE_SERVER(InROS2Node, InUserObject, InServiceName, InSrvClass, InResponseCallback)
 Create #FServiceCallback and call UROS2NodeComponent::CreateServiceServer. More...
 
#define ROS2_CREATE_SERVICE_SERVER_WITH_QOS(InROS2Node, InUserObject, InServiceName, InSrvClass, InQoS, InResponseCallback)
 Create #FServiceCallback and call UROS2NodeComponent::CreateServiceServer. More...
 
#define ROS2_CREATE_ACTION_CLIENT(InROS2Node, InUserObject, InActionName, InActionClass, InGoalResponseDelegate, InResultResponseDelegate, InFeedbackDelegate, InCancelResponseDelegate, OutClient)
 Create #FActionCallback and call UROS2NodeComponent::CreateActionClient. More...
 
#define ROS2_CREATE_ACTION_CLIENT_WITH_QOS(InROS2Node, InUserObject, InActionName, InActionClass, InGoalResponseDelegate, InResultResponseDelegate, InFeedbackDelegate, InCancelResponseDelegate, InGoalQoS, InResultQoS, InFeedbackQoS, InCancelQoS, OutClient)
 Create #FActionCallback and call UROS2NodeComponent::CreateActionClient. More...
 
#define ROS2_CREATE_ACTION_SERVER( InROS2Node, InUserObject, InActionName, InActionClass, InGoalDelegate, InResultDelegate, InCancelDelegate, OutServer)
 Create #FActionCallback and call UROS2NodeComponent::CreateActionServer. More...
 
#define ROS2_CREATE_ACTION_SERVER_WITH_QOS(InROS2Node, InUserObject, InActionName, InActionClass, InGoalDelegate, InResultDelegate, InCancelDelegate, InGoalQoS, InResultQoS, InFeedbackQoS, InCancelQoS, OutServer)
 Create #FActionCallback and call UROS2NodeComponent::CreateActionServer. More...
 
#define IS_ROS2NODE_INITED(InNode, InName, OutRes)
 Check UROS2NodeComponent is initialized or not. More...
 

Functions

 DECLARE_DYNAMIC_DELEGATE_OneParam (FSubscriptionCallback, const UROS2GenericMsg *, InMessage)
 BP requires a custom-made callback thus it must be Dynamic.
 

Detailed Description

Class implementing ROS2 node.

This class also handles tasks performed by the executor in rclc.

Additionally, helper structs FSubscription and FService are defined here as they are considered components of the node and not

additional distinct entities Publishers, subscribers, services, service clients, action servers and action clients should

register to the node with the appropriate methods (Add*).

Macro Definition Documentation

◆ IS_ROS2NODE_INITED

#define IS_ROS2NODE_INITED (   InNode,
  InName,
  OutRes 
)

Check UROS2NodeComponent is initialized or not.

Parameters
InNodeUROS2NodeComponent
InNameNode name. Used only for logging.
OutResbool result. true if initialized, false otherwise.

◆ ROS2_CREATE_ACTION_CLIENT

#define ROS2_CREATE_ACTION_CLIENT (   InROS2Node,
  InUserObject,
  InActionName,
  InActionClass,
  InGoalResponseDelegate,
  InResultResponseDelegate,
  InFeedbackDelegate,
  InCancelResponseDelegate,
  OutClient 
)

Create #FActionCallback and call UROS2NodeComponent::CreateActionClient.

FActionCallback is of dynamic delegate type to be serializable for BP use

FActionCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InActionNamepass to UROS2NodeComponent::CreateActionClient
InActionClasspass to UROS2NodeComponent::CreateActionClient
InGoalResponseDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionClient
InResultResponseDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionClient
InFeedbackDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionClient
InCancelResponseDelegateconvert to #FSimpleCallback and pass to UROS2NodeComponent::CreateActionClient
OutClientreturn value of UROS2NodeComponent::CreateActionClient

◆ ROS2_CREATE_ACTION_CLIENT_WITH_QOS

#define ROS2_CREATE_ACTION_CLIENT_WITH_QOS (   InROS2Node,
  InUserObject,
  InActionName,
  InActionClass,
  InGoalResponseDelegate,
  InResultResponseDelegate,
  InFeedbackDelegate,
  InCancelResponseDelegate,
  InGoalQoS,
  InResultQoS,
  InFeedbackQoS,
  InCancelQoS,
  OutClient 
)

Create #FActionCallback and call UROS2NodeComponent::CreateActionClient.

FActionCallback is of dynamic delegate type to be serializable for BP use

FActionCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InActionNamepass to UROS2NodeComponent::CreateActionClient
InActionClasspass to UROS2NodeComponent::CreateActionClient
InGoalResponseDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionClient
InResultResponseDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionClient
InFeedbackDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionClient
InCancelResponseDelegateconvert to #FSimpleCallback and pass to UROS2NodeComponent::CreateActionClient
InGoalQoSpass to UROS2NodeComponent::CreateActionClient
InResultQoSpass to UROS2NodeComponent::CreateActionClient
InFeedbackQoSpass to UROS2NodeComponent::CreateActionClient
InCancelQoSpass to UROS2NodeComponent::CreateActionClient
OutClientreturn value of UROS2NodeComponent::CreateActionClient

◆ ROS2_CREATE_ACTION_SERVER

#define ROS2_CREATE_ACTION_SERVER (   InROS2Node,
  InUserObject,
  InActionName,
  InActionClass,
  InGoalDelegate,
  InResultDelegate,
  InCancelDelegate,
  OutServer 
)

Create #FActionCallback and call UROS2NodeComponent::CreateActionServer.

FActionCallback is of dynamic delegate type to be serializable for BP use

FActionCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InActionNamepass to UROS2NodeComponent::CreateActionServer
InActionClasspass to UROS2NodeComponent::CreateActionServer
InGoalDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionServer
InResultDelegateconvert to #FSimpleCallback and pass to UROS2NodeComponent::CreateActionServer
InCancelDelegateconvert to #FSimpleCallback and pass to UROS2NodeComponent::CreateActionServer
OutServerreturn value of UROS2NodeComponent::CreateActionServer

◆ ROS2_CREATE_ACTION_SERVER_WITH_QOS

#define ROS2_CREATE_ACTION_SERVER_WITH_QOS (   InROS2Node,
  InUserObject,
  InActionName,
  InActionClass,
  InGoalDelegate,
  InResultDelegate,
  InCancelDelegate,
  InGoalQoS,
  InResultQoS,
  InFeedbackQoS,
  InCancelQoS,
  OutServer 
)

Create #FActionCallback and call UROS2NodeComponent::CreateActionServer.

FActionCallback is of dynamic delegate type to be serializable for BP use

FActionCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InActionNamepass to UROS2NodeComponent::CreateActionServer
InActionClasspass to UROS2NodeComponent::CreateActionServer
InGoalDelegateconvert to #FActionCallback and pass to UROS2NodeComponent::CreateActionServer
InResultDelegateconvert to #FSimpleCallback and pass to UROS2NodeComponent::CreateActionServer
InCancelDelegateconvert to #FSimpleCallback and pass to UROS2NodeComponent::CreateActionServer
InGoalQoSpass to UROS2NodeComponent::CreateActionServer
InResultQoSpass to UROS2NodeComponent::CreateActionServer
InFeedbackQoSpass to UROS2NodeComponent::CreateActionServer
InCancelQoSpass to UROS2NodeComponent::CreateActionServer
OutServerreturn value of UROS2NodeComponent::CreateActionServer

◆ ROS2_CREATE_LOOP_PUBLISHER

#define ROS2_CREATE_LOOP_PUBLISHER (   InROS2Node,
  InUserObject,
  InTopicName,
  InPublisherClass,
  InMsgClass,
  InPubFrequency,
  InCallback,
  OutPublisher 
)

Create #FTopicCallback and call UROS2NodeComponent::CreateLoopPublisher.

FTopicCallback is of dynamic delegate type to be serializable for BP use

FTopicCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InTopicNamepass to UROS2NodeComponent::CreateLoopPublisher
InPublisherClasspass to UROS2NodeComponent::CreateLoopPublisher
InMsgClasspass to UROS2NodeComponent::CreateLoopPublisher
InPubFrequencypass to UROS2NodeComponent::CreateLoopPublisher
InCallbackconvert to #FTopicCallback and pass to UROS2NodeComponent::CreateLoopPublisher
OutPublisherreturn value of UROS2NodeComponent::CreateLoopPublisher

◆ ROS2_CREATE_LOOP_PUBLISHER_WITH_QOS

#define ROS2_CREATE_LOOP_PUBLISHER_WITH_QOS (   InROS2Node,
  InUserObject,
  InTopicName,
  InPublisherClass,
  InMsgClass,
  InPubFrequency,
  InCallback,
  InQoS,
  OutPublisher 
)

Create #FTopicCallback and call UROS2NodeComponent::CreateLoopPublisher.

FTopicCallback is of dynamic delegate type to be serializable for BP use

FTopicCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InTopicNamepass to UROS2NodeComponent::CreateLoopPublisher
InPublisherClasspass to UROS2NodeComponent::CreateLoopPublisher
InMsgClasspass to UROS2NodeComponent::CreateLoopPublisher
InPubFrequencypass to UROS2NodeComponent::CreateLoopPublisher
InCallbackconvert to #FTopicCallback and pass to UROS2NodeComponent::CreateLoopPublisher
InQoSpass to UROS2NodeComponent::CreateLoopPublisher
OutPublisherreturn value of UROS2NodeComponent::CreateLoopPublisher

◆ ROS2_CREATE_SERVICE_CLIENT

#define ROS2_CREATE_SERVICE_CLIENT (   InROS2Node,
  InUserObject,
  InServiceName,
  InSrvClass,
  InRequestCallback,
  OutClient 
)

Create #FServiceCallback and call UROS2NodeComponent::CreateServiceClient.

FServiceCallback is of dynamic delegate type to be serializable for BP use

FServiceCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InServiceNamepass to UROS2NodeComponent::CreateServiceClient
InSrvClasspass to UROS2NodeComponent::CreateServiceClient
InRequestCallbackconvert to #FServiceCallback and pass to UROS2NodeComponent::CreateServiceClient
OutClientreturn value of UROS2NodeComponent::CreateServiceClient

◆ ROS2_CREATE_SERVICE_CLIENT_WITH_QOS

#define ROS2_CREATE_SERVICE_CLIENT_WITH_QOS (   InROS2Node,
  InUserObject,
  InServiceName,
  InSrvClass,
  InRequestCallback,
  InQoS,
  OutClient 
)

Create #FServiceCallback and call UROS2NodeComponent::CreateServiceClient.

FServiceCallback is of dynamic delegate type to be serializable for BP use

FServiceCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InServiceNamepass to UROS2NodeComponent::CreateServiceClient
InSrvClasspass to UROS2NodeComponent::CreateServiceClient
InRequestCallbackconvert to #FServiceCallback and pass to UROS2NodeComponent::CreateServiceClient
InQoSpass to UROS2NodeComponent::CreateServiceClient
OutClientreturn value of UROS2NodeComponent::CreateServiceClient

◆ ROS2_CREATE_SERVICE_SERVER

#define ROS2_CREATE_SERVICE_SERVER (   InROS2Node,
  InUserObject,
  InServiceName,
  InSrvClass,
  InResponseCallback 
)

Create #FServiceCallback and call UROS2NodeComponent::CreateServiceServer.

FServiceCallback is of dynamic delegate type to be serializable for BP use

FServiceCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InServiceNamepass to UROS2NodeComponent::CreateServiceServer
InSrvClasspass to UROS2NodeComponent::CreateServiceServer
InResponseCallbackconvert to #FServiceCallback and pass to UROS2NodeComponent::CreateServiceServer

◆ ROS2_CREATE_SERVICE_SERVER_WITH_QOS

#define ROS2_CREATE_SERVICE_SERVER_WITH_QOS (   InROS2Node,
  InUserObject,
  InServiceName,
  InSrvClass,
  InQoS,
  InResponseCallback 
)

Create #FServiceCallback and call UROS2NodeComponent::CreateServiceServer.

FServiceCallback is of dynamic delegate type to be serializable for BP use

FServiceCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InServiceNamepass to UROS2NodeComponent::CreateServiceServer
InSrvClasspass to UROS2NodeComponent::CreateServiceServer
InResponseCallbackconvert to #FServiceCallback and pass to UROS2NodeComponent::CreateServiceServer
InQoSpass to UROS2NodeComponent::CreateServiceServer

◆ ROS2_CREATE_SUBSCRIBER

#define ROS2_CREATE_SUBSCRIBER (   InROS2Node,
  InUserObject,
  InTopicName,
  InMsgClass,
  InCallback 
)

Create #FsSubscriptionCallback and call UROS2NodeComponent::CreateSubscriber.

FSubscriptionCallback is of dynamic delegate type to be serializable for BP use

FSubscriptionCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InTopicNamepass to UROS2NodeComponent::CreateSubscriber
InMsgClasspass to UROS2NodeComponent::CreateSubscriber
InCallbackconvert to #FSubscriptionCallback and pass to UROS2NodeComponent::CreateSubscriber

◆ ROS2_CREATE_SUBSCRIBERW_WITH_QOS

#define ROS2_CREATE_SUBSCRIBERW_WITH_QOS (   InROS2Node,
  InUserObject,
  InTopicName,
  InMsgClass,
  InCallback,
  InQoS 
)

Create #FsSubscriptionCallback and call #UROS2NodeComponent::CreateSubscriberWithQoS.

FSubscriptionCallback is of dynamic delegate type to be serializable for BP use

FSubscriptionCallback::BindDynamic is a macro, instead of a function.

Thus InCallback can only be a direct UFUNCTION() method & cannot be used as typed param!

Parameters
InROS2NodeUROS2NodeComponent
InUserObjectObjects of InCallback
InTopicNamepass to #UROS2NodeComponent::CreateSubscriberWithQoS
InMsgClasspass to #UROS2NodeComponent::CreateSubscriberWithQoS
InCallbackconvert to #FSubscriptionCallback and pass to UROS2NodeComponent::CreateSubscriber
InQoSpass to UROS2NodeComponent::CreateSubscriber