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

Class implementing ROS2 service clients. More...

#include <ROS2ServiceClient.h>

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

Public Member Functions

virtual void Destroy ()
 Destroy service with rcl_client_fini. More...
 
virtual void ProcessReady () override
 Determine the relevant service client functions to call. More...
 
void SendRequest ()
 Send service request. More...
 
template<typename TService , typename TServiceRequest >
void SendRequest (TService *InService, const TServiceRequest &InServiceRequest)
 Send service request. More...
 
bool IsServiceReady ()
 Return true if service is available. More...
 
void SetDelegates (const FServiceCallback &InResponseCallback)
 Set ResponseDelegate. More...
 
- Public Member Functions inherited from UROS2Service
virtual bool InitializeWithROS2 (UROS2NodeComponent *InROS2Node)
 Initialize Service with ROS2Node. More...
 
virtual bool Init ()
 Initialize ROS2 service client with rcl_client_init, set QoS, InitializeService and InitializeServiceComponent . More...
 
virtual bool InitializeService ()
 Create Service instance and initialize it. More...
 

Static Public Member Functions

static UROS2ServiceClientCreateServiceClient (UObject *InOwner, const FString &InServiceName, const TSubclassOf< UROS2GenericSrv > &InSrvClass, const FServiceCallback &InResponseDelegate, const UROS2QoS InQoS=UROS2QoS::Services)
 Create a Service Client object. More...
 

Public Attributes

FServiceCallback ResponseDelegate
 used to receive the answer More...
 
rcl_client_t client
 ROS2 Service client.
 
bool Ready = false
 Service is ready or not.
 
- Public Attributes inherited from UROS2Service
FString ServiceName
 this information is redundant with Topic, but it's used to initialize it More...
 
TSubclassOf< UROS2GenericSrvSrvClass
 type of Srv class More...
 
UROS2NodeComponentOwnerNode
 ROS2Node which own this service client. More...
 
TEnumAsByte< UROS2StateState = UROS2State::Created
 Service client state. More...
 
UROS2GenericSrvService
 Service Instance. More...
 
UROS2QoS QoS = UROS2QoS::Services
 Quality of service. More...
 

Protected Member Functions

virtual void InitializeServiceComponent () override
 Initialize ROS2 service client with rcl_client_init. More...
 

Additional Inherited Members

- Protected Attributes inherited from UROS2Service
bool Ready
 Service is ready or not.
 

Detailed Description

Class implementing ROS2 service clients.

Service type is defined by SrvClass

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

Member Function Documentation

◆ CreateServiceClient()

static UROS2ServiceClient* UROS2ServiceClient::CreateServiceClient ( UObject *  InOwner,
const FString &  InServiceName,
const TSubclassOf< UROS2GenericSrv > &  InSrvClass,
const FServiceCallback &  InResponseDelegate,
const UROS2QoS  InQoS = UROS2QoS::Services 
)
static

Create a Service Client object.

Parameters
InOwner
InServiceName
InSrvClass
InResponseDelegate
Returns
UROS2ServiceClient*

◆ Destroy()

virtual void UROS2ServiceClient::Destroy ( )
virtual

Destroy service with rcl_client_fini.

Reimplemented from UROS2Service.

◆ InitializeServiceComponent()

virtual void UROS2ServiceClient::InitializeServiceComponent ( )
overrideprotectedvirtual

Initialize ROS2 service client with rcl_client_init.

Set QOS for all goal, result, cancel, feedback and status

Reimplemented from UROS2Service.

◆ IsServiceReady()

bool UROS2ServiceClient::IsServiceReady ( )

◆ ProcessReady()

virtual void UROS2ServiceClient::ProcessReady ( )
overridevirtual

Determine the relevant service client functions to call.

Reimplemented from UROS2Service.

◆ SendRequest() [1/2]

void UROS2ServiceClient::SendRequest ( )

Send service request.

UFUNCTION(BlueprintCallable)

◆ SendRequest() [2/2]

template<typename TService , typename TServiceRequest >
void UROS2ServiceClient::SendRequest ( TService *  InService,
const TServiceRequest &  InServiceRequest 
)
inline

Send service request.

Template Parameters
TService
TServiceRequest
Parameters
InService
InServiceRequest

◆ SetDelegates()

void UROS2ServiceClient::SetDelegates ( const FServiceCallback &  InResponseCallback)

Set ResponseDelegate.

Parameters
InResponseCallback

UFUNCTION(BlueprintCallable)

Member Data Documentation

◆ ResponseDelegate

FServiceCallback UROS2ServiceClient::ResponseDelegate

used to receive the answer

UPROPERTY(EditAnywhere, BlueprintReadWrite)


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