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

Provide ROS 2 interfaces to interact with UE4. This provide only ROS 2 interfaces and implementation is in ASimulationState. More...

#include <RRROS2SimulationStateClient.h>

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

Public Member Functions

virtual void Init (UROS2NodeComponent *InROS2Node)
 Start ROSservices. More...
 
virtual bool IsSupportedForNetworking () const override
 
virtual void GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const override
 Returns the properties used for network replication, this needs to be overridden by all actor classes with native. More...
 
void GetEntityStateSrv (UROS2GenericSrv *InService)
 Callback function of GetEntityState ROS 2 service. More...
 
void SetEntityStateSrv (UROS2GenericSrv *InService)
 Callback function of SetEntityState ROS 2 service. More...
 
void ServerSetEntityState (const FROSSetEntityStateReq &InRequest)
 RPC call to Server's SetEntityState. More...
 
void AttachSrv (UROS2GenericSrv *InService)
 Callback function of Attach ROS 2 service. More...
 
void ServerAttach (const FROSAttachReq &InRequest)
 RPC call to Server's Attach. More...
 
virtual void SpawnEntitySrv (UROS2GenericSrv *InService)
 Callback function of SpawnEntity ROS 2 service. More...
 
virtual void SpawnEntitiesSrv (UROS2GenericSrv *InService)
 Callback function of SpawnEntities ROS 2 service. More...
 
void ServerSpawnEntity (const FROSSpawnEntityReq &InRequest)
 RPC call to Server's SpawnEntity. More...
 
void DeleteEntitySrv (UROS2GenericSrv *InService)
 Callback function of DeleteEntity ROS 2 service. More...
 
void ServerDeleteEntity (const FROSDeleteEntityReq &InRequest)
 RPC call to Server's DeleteEntity. More...
 
void ServerAddEntity (AActor *InEntity)
 RPC call to Server's AddEntity. More...
 
void SetNetworkPlayerId (const int32 InNetworkPlayerId)
 Set Player Id. More...
 
int32 GetNetworkPlayerId () const
 Get Player Id. More...
 

Public Attributes

UROS2NodeComponent * ROS2Node = nullptr
 ROS 2 node of each client's own in the network. More...
 
ASimulationStateServerSimState = nullptr
 Handle to server's main sim state which has ROS 2 interface implementation. More...
 

Protected Member Functions

virtual void OnComponentCreated () override
 
template<typename T >
bool CheckEntity (TMap< FString, T > &InEntities, const FString &InEntityName, const bool bAllowEmpty=false)
 
bool CheckEntity (const FString &InEntityName, const bool bAllowEmpty=false)
 
bool CheckSpawnableEntity (const FString &InEntityName, const bool bAllowEmpty=false)
 
virtual FROSSpawnEntityRes SpawnEntityImpl (FROSSpawnEntityReq &InRequest)
 

Protected Attributes

int32 NetworkPlayerId
 NetworkPlayerId which is used to differenciate client in server. More...
 

Detailed Description

Provide ROS 2 interfaces to interact with UE4. This provide only ROS 2 interfaces and implementation is in ASimulationState.

Supported interactions: GetEntityState, SetEntityState, Attach, SpawnEntity, DeleteEntity

UCLASS()

Member Function Documentation

◆ AttachSrv()

void URRROS2SimulationStateClient::AttachSrv ( UROS2GenericSrv *  InService)

Callback function of Attach ROS 2 service.

Attach actors if those are not attached and detach actors if those are attached.

Parameters
Service
See also
ue_mgs/Attach.srv

UFUNCTION(BlueprintCallable)

◆ CheckEntity() [1/2]

bool URRROS2SimulationStateClient::CheckEntity ( const FString &  InEntityName,
const bool  bAllowEmpty = false 
)
protected

◆ CheckEntity() [2/2]

template<typename T >
bool URRROS2SimulationStateClient::CheckEntity ( TMap< FString, T > &  InEntities,
const FString &  InEntityName,
const bool  bAllowEmpty = false 
)
protected

◆ CheckSpawnableEntity()

bool URRROS2SimulationStateClient::CheckSpawnableEntity ( const FString &  InEntityName,
const bool  bAllowEmpty = false 
)
protected

◆ DeleteEntitySrv()

void URRROS2SimulationStateClient::DeleteEntitySrv ( UROS2GenericSrv *  InService)

Callback function of DeleteEntity ROS 2 service.

Parameters
Service
See also
ue_mgs/DeleteEntity.srv

UFUNCTION(BlueprintCallable)

◆ GetEntityStateSrv()

void URRROS2SimulationStateClient::GetEntityStateSrv ( UROS2GenericSrv *  InService)

Callback function of GetEntityState ROS 2 service.

Return the pose from reference frame.

Parameters
Service
See also
ue_mgs/GetEntityState.srv
Todo:
Twist is zero. Should return proper value for physics actors.

UFUNCTION(BlueprintCallable)

◆ GetLifetimeReplicatedProps()

virtual void URRROS2SimulationStateClient::GetLifetimeReplicatedProps ( TArray< FLifetimeProperty > &  OutLifetimeProps) const
overridevirtual

Returns the properties used for network replication, this needs to be overridden by all actor classes with native.

replicated properties

Parameters
OutLifetimePropsOutput lifetime properties

◆ GetNetworkPlayerId()

int32 URRROS2SimulationStateClient::GetNetworkPlayerId ( ) const
inline

Get Player Id.

Parameters
InEntity

UFUNCTION(BlueprintCallable)

◆ Init()

virtual void URRROS2SimulationStateClient::Init ( UROS2NodeComponent *  InROS2Node)
virtual

Start ROSservices.

Parameters
InROS2Node
See also
ROS2Node

UFUNCTION(BlueprintCallable)

◆ IsSupportedForNetworking()

virtual bool URRROS2SimulationStateClient::IsSupportedForNetworking ( ) const
inlineoverridevirtual

◆ OnComponentCreated()

virtual void URRROS2SimulationStateClient::OnComponentCreated ( )
overrideprotectedvirtual

◆ ServerAddEntity()

void URRROS2SimulationStateClient::ServerAddEntity ( AActor *  InEntity)

RPC call to Server's AddEntity.

Parameters
InEntity

UFUNCTION(BlueprintCallable, Server, Reliable)

◆ ServerAttach()

void URRROS2SimulationStateClient::ServerAttach ( const FROSAttachReq &  InRequest)

RPC call to Server's Attach.

Parameters
InRequest

UFUNCTION(BlueprintCallable, Server, Reliable)

◆ ServerDeleteEntity()

void URRROS2SimulationStateClient::ServerDeleteEntity ( const FROSDeleteEntityReq &  InRequest)

RPC call to Server's DeleteEntity.

Parameters
InRequest

UFUNCTION(BlueprintCallable, Server, Reliable)

◆ ServerSetEntityState()

void URRROS2SimulationStateClient::ServerSetEntityState ( const FROSSetEntityStateReq &  InRequest)

RPC call to Server's SetEntityState.

Parameters
InRequest

UFUNCTION(BlueprintCallable, Server, Reliable)

◆ ServerSpawnEntity()

void URRROS2SimulationStateClient::ServerSpawnEntity ( const FROSSpawnEntityReq &  InRequest)

RPC call to Server's SpawnEntity.

Parameters
InRequest

UFUNCTION(BlueprintCallable, Server, Reliable)

◆ SetEntityStateSrv()

void URRROS2SimulationStateClient::SetEntityStateSrv ( UROS2GenericSrv *  InService)

Callback function of SetEntityState ROS 2 service.

Parameters
Service
See also
ue_mgs/SetEntityState.srv
Todo:
Twist is zero. Should able to set value for physics actors.

UFUNCTION(BlueprintCallable)

◆ SetNetworkPlayerId()

void URRROS2SimulationStateClient::SetNetworkPlayerId ( const int32  InNetworkPlayerId)
inline

Set Player Id.

Parameters
InNetworkPlayerId

UFUNCTION(BlueprintCallable)

◆ SpawnEntitiesSrv()

virtual void URRROS2SimulationStateClient::SpawnEntitiesSrv ( UROS2GenericSrv *  InService)
virtual

Callback function of SpawnEntities ROS 2 service.

Parameters
Service
See also
ue_mgs/SpawnEntities.srv

UFUNCTION(BlueprintCallable)

◆ SpawnEntityImpl()

virtual FROSSpawnEntityRes URRROS2SimulationStateClient::SpawnEntityImpl ( FROSSpawnEntityReq &  InRequest)
protectedvirtual

◆ SpawnEntitySrv()

virtual void URRROS2SimulationStateClient::SpawnEntitySrv ( UROS2GenericSrv *  InService)
virtual

Callback function of SpawnEntity ROS 2 service.

Parameters
Service
See also
ue_mgs/SpawnEntity.srv

UFUNCTION(BlueprintCallable)

Member Data Documentation

◆ NetworkPlayerId

int32 URRROS2SimulationStateClient::NetworkPlayerId
protected

NetworkPlayerId which is used to differenciate client in server.

UPROPERTY(BlueprintReadOnly, Replicated)

◆ ROS2Node

UROS2NodeComponent* URRROS2SimulationStateClient::ROS2Node = nullptr

ROS 2 node of each client's own in the network.

UPROPERTY(BlueprintReadOnly, Replicated)

◆ ServerSimState

ASimulationState* URRROS2SimulationStateClient::ServerSimState = nullptr

Handle to server's main sim state which has ROS 2 interface implementation.

UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ExposeOnSpawn = "true"), Replicated)


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