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

ROS 2 GameMode which have Clock publisher and ROS 2 services to interact with ROS 2. More...

#include <RRROS2GameMode.h>

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

Public Member Functions

 ARRROS2GameMode ()
 
virtual void SetFixedTimeStep (const float InStepSize)
 Set timestep by FApp::SetFixedDeltaTime. More...
 
virtual float GetFixedTimeStep () const
 Get timestep. More...
 
virtual void SetTargetRTF (const float InTargetRTF)
 Set the Target RTF. This works if CustomTimeStep class is URRLimitRTFFixedSizeCustomTimeStep. More...
 
virtual float GetTargetRTF () const
 Get the Target RTF. This works if CustomTimeStep class is URRLimitRTFFixedSizeCustomTimeStep. More...
 
virtual void PrintSimConfig () const
 Print GameMode's user configs in INI. More...
 
FString GetSpawnableNativeEntityClassPath (const FString &InEntityModelName) const
 Get corresponding class path of a native entity model from NativeSpawnableClassPaths. More...
 

Public Attributes

UROS2NodeComponent * MainROS2Node = nullptr
 Sim's Main ROS 2 node. This is not used by client-server and ARRNetworkPlayerController has ROS2Node instead. More...
 
FString MainROS2NodeName = TEXT("UEROS2Node")
 Sim's Main ROS 2 node name. This is not used by client-server and ARRNetworkPlayerController has ROS2Node instead. More...
 
URRROS2ClockPublisherClockPublisher = nullptr
 Publish /clock. This is not used by client-server without editor and ARRNetworkPlayerController has ClockPublisher instead. More...
 
ASimulationStateMainSimState = nullptr
 Provide ROS 2 implementation of sim-wide operations like get/set actor state, spawn/delete actor, attach/detach actor. More...
 
URRROS2SimulationStateClientMainROS2SimStateClient = nullptr
 Provide ROS 2 interface of sim-wide operations implemented by MainSimState. More...
 
TSubclassOf< URRROS2SimulationStateClientROS2SimStateClientClass = URRROS2SimulationStateClient::StaticClass()
 Custom type to instantiate MainROS2SimStateClient, configurable in child classes. More...
 
FRROnROS2Initialized OnROS2Initialized
 Delegate signalling ROS 2 having been initialized with MainROS2Node, MainROS2SimStateClient, ClockPublisher ready. More...
 

Protected Member Functions

virtual void InitGame (const FString &InMapName, const FString &InOptions, FString &OutErrorMessage) override
 Initialize Game. More...
 
virtual void InitSim ()
 Create MainSimState and call InitROS2. More...
 
virtual void StartPlay () override
 Set timestep with startplay and call InitSim. More...
 

Protected Attributes

TArray< FString > BPSpawnableClassNames
 Blueprint class names (also used as their entity model names) to be registered as spawnable entity types. More...
 
TMap< FString, FString > NativeSpawnableClassPaths
 Asset paths of classes to be registered as spawnable entity types. More...
 

Private Member Functions

void InitROS2 ()
 Create and initialize MainROS2Node, ClockPublisher and MainSimState. More...
 

Detailed Description

ROS 2 GameMode which have Clock publisher and ROS 2 services to interact with ROS 2.

See also
AGameMode
GameMode and GameState

UCLASS(Config = RapyutaSimSettings)

Constructor & Destructor Documentation

◆ ARRROS2GameMode()

ARRROS2GameMode::ARRROS2GameMode ( )

Member Function Documentation

◆ GetFixedTimeStep()

virtual float ARRROS2GameMode::GetFixedTimeStep ( ) const
virtual

Get timestep.

Returns
fixed timestep.

UFUNCTION(BlueprintCallable)

◆ GetSpawnableNativeEntityClassPath()

FString ARRROS2GameMode::GetSpawnableNativeEntityClassPath ( const FString &  InEntityModelName) const
inline

Get corresponding class path of a native entity model from NativeSpawnableClassPaths.

◆ GetTargetRTF()

virtual float ARRROS2GameMode::GetTargetRTF ( ) const
virtual

Get the Target RTF. This works if CustomTimeStep class is URRLimitRTFFixedSizeCustomTimeStep.

Returns
float

UFUNCTION(BlueprintCallable)

◆ InitGame()

virtual void ARRROS2GameMode::InitGame ( const FString &  InMapName,
const FString &  InOptions,
FString &  OutErrorMessage 
)
overrideprotectedvirtual

Initialize Game.

Parameters
InMapName
InOptions
OutErrorMessage
See also
InitGame

◆ InitROS2()

void ARRROS2GameMode::InitROS2 ( )
private

Create and initialize MainROS2Node, ClockPublisher and MainSimState.

◆ InitSim()

virtual void ARRROS2GameMode::InitSim ( )
protectedvirtual

Create MainSimState and call InitROS2.

◆ PrintSimConfig()

virtual void ARRROS2GameMode::PrintSimConfig ( ) const
virtual

Print GameMode's user configs in INI.

Reimplemented in ARRGameMode.

◆ SetFixedTimeStep()

virtual void ARRROS2GameMode::SetFixedTimeStep ( const float  InStepSize)
virtual

Set timestep by FApp::SetFixedDeltaTime.

Parameters
InFrequencygame time update frequency, timestep become 1/frequency.
Attention
FApp::SetFixedDeltaTime take arg as double but InFreqency is float to be able to access from BP.

UFUNCTION(BlueprintCallable)

◆ SetTargetRTF()

virtual void ARRROS2GameMode::SetTargetRTF ( const float  InTargetRTF)
virtual

Set the Target RTF. This works if CustomTimeStep class is URRLimitRTFFixedSizeCustomTimeStep.

Parameters
InTargetRTF

UFUNCTION(BlueprintCallable)

◆ StartPlay()

virtual void ARRROS2GameMode::StartPlay ( )
overrideprotectedvirtual

Set timestep with startplay and call InitSim.

Reimplemented in ARRGameMode.

Member Data Documentation

◆ BPSpawnableClassNames

TArray<FString> ARRROS2GameMode::BPSpawnableClassNames
protected

Blueprint class names (also used as their entity model names) to be registered as spawnable entity types.

Eg: {"BP_TurtlebotBurger", "BP_TurtlebotBurgerVehicle"}

UPROPERTY(config)

◆ ClockPublisher

URRROS2ClockPublisher* ARRROS2GameMode::ClockPublisher = nullptr

Publish /clock. This is not used by client-server without editor and ARRNetworkPlayerController has ClockPublisher instead.

UPROPERTY(BlueprintReadOnly)

◆ MainROS2Node

UROS2NodeComponent* ARRROS2GameMode::MainROS2Node = nullptr

Sim's Main ROS 2 node. This is not used by client-server and ARRNetworkPlayerController has ROS2Node instead.

UPROPERTY(BlueprintReadOnly)

◆ MainROS2NodeName

FString ARRROS2GameMode::MainROS2NodeName = TEXT("UEROS2Node")

Sim's Main ROS 2 node name. This is not used by client-server and ARRNetworkPlayerController has ROS2Node instead.

UPROPERTY(BlueprintReadWrite)

◆ MainROS2SimStateClient

URRROS2SimulationStateClient* ARRROS2GameMode::MainROS2SimStateClient = nullptr

Provide ROS 2 interface of sim-wide operations implemented by MainSimState.

Note
ASimulationState and URRROS2SimulationStateClient are separated to be used in client-server.

UPROPERTY(BlueprintReadOnly)

◆ MainSimState

ASimulationState* ARRROS2GameMode::MainSimState = nullptr

Provide ROS 2 implementation of sim-wide operations like get/set actor state, spawn/delete actor, attach/detach actor.

UPROPERTY(BlueprintReadOnly)

◆ NativeSpawnableClassPaths

TMap<FString , FString > ARRROS2GameMode::NativeSpawnableClassPaths
protected

Asset paths of classes to be registered as spawnable entity types.

Eg: {{"TurtlebotBurger", "/Script/RapyutaSimulationPlugins.TurtlebotBurger"]}

UPROPERTY(config)

◆ OnROS2Initialized

FRROnROS2Initialized ARRROS2GameMode::OnROS2Initialized

Delegate signalling ROS 2 having been initialized with MainROS2Node, MainROS2SimStateClient, ClockPublisher ready.

◆ ROS2SimStateClientClass

TSubclassOf<URRROS2SimulationStateClient> ARRROS2GameMode::ROS2SimStateClientClass = URRROS2SimulationStateClient::StaticClass()

Custom type to instantiate MainROS2SimStateClient, configurable in child classes.

UPROPERTY(BlueprintReadOnly)


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