RapyutaSimulationPlugins
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ARRGameMode Class Reference

GameMode with specific setting, asset loading and #SceneDirector. Parent class, ARRROS2GameMode,. More...

#include <RRGameMode.h>

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

Public Member Functions

 ARRGameMode ()
 
bool IsSimType (const ERRSimType InSimType) const
 
bool IsDataSynthSimType () const
 
void SetSimType (const ERRSimType InSimType)
 
FString GetSimTypeName () const
 
virtual void PreInitializeComponents () override
 
virtual void InitGameState () override
 
virtual void StartPlay () override
 Set benchmark, fixed time step via FApp if running without editor. More...
 
virtual void PrintSimConfig () const override
 Print GameMode's user configs in INI. More...
 
virtual void ConfigureSimInPlay ()
 Config Sim global configs in prep for play. More...
 
virtual void StartSim ()
 
void EndPlay (const EEndPlayReason::Type EndPlayReason) override
 
- Public Member Functions inherited from ARRROS2GameMode
 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...
 
FString GetSpawnableNativeEntityClassPath (const FString &InEntityModelName) const
 Get corresponding class path of a native entity model from NativeSpawnableClassPaths. More...
 

Static Public Member Functions

static void PrintUEPreprocessors ()
 Print UE global preprocessors' values. More...
 

Public Attributes

uint8 SimType = static_cast<uint8>(ERRSimType::ROBOT_SIM)
 
bool bBenchmark = true
 
- Public Attributes inherited from ARRROS2GameMode
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...
 

Static Public Attributes

static constexpr int32 SIM_START_TIMEOUT_MINS = 2
 
static constexpr int32 SIM_START_TIMEOUT_SECS = 60 * SIM_START_TIMEOUT_MINS
 

Private Member Functions

bool TryStartingSim ()
 This method was scheduled to be run by BeginPlay() More...
 

Private Attributes

FTimerHandle OwnTimerHandle
 
float BeginTimeStampSec = 0.f
 

Additional Inherited Members

- Protected Member Functions inherited from ARRROS2GameMode
virtual void InitGame (const FString &InMapName, const FString &InOptions, FString &OutErrorMessage) override
 Initialize Game. More...
 
virtual void InitSim ()
 Create MainSimState and call InitROS2. More...
 
- Protected Attributes inherited from ARRROS2GameMode
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...
 

Detailed Description

GameMode with specific setting, asset loading and #SceneDirector. Parent class, ARRROS2GameMode,.

You needs to use #RRGameSingleton for asset loading.

You needs to use #RRPlayerController and #RRGameState for SceneDirector.

See also
GameMode and GameState

UCLASS(Config = RapyutaSimSettings)

Constructor & Destructor Documentation

◆ ARRGameMode()

ARRGameMode::ARRGameMode ( )

Member Function Documentation

◆ ConfigureSimInPlay()

virtual void ARRGameMode::ConfigureSimInPlay ( )
virtual

Config Sim global configs in prep for play.

◆ EndPlay()

void ARRGameMode::EndPlay ( const EEndPlayReason::Type  EndPlayReason)
override

◆ GetSimTypeName()

FString ARRGameMode::GetSimTypeName ( ) const
inline

◆ InitGameState()

virtual void ARRGameMode::InitGameState ( )
overridevirtual

◆ IsDataSynthSimType()

bool ARRGameMode::IsDataSynthSimType ( ) const
inline

◆ IsSimType()

bool ARRGameMode::IsSimType ( const ERRSimType  InSimType) const
inline

◆ PreInitializeComponents()

virtual void ARRGameMode::PreInitializeComponents ( )
overridevirtual

◆ PrintSimConfig()

virtual void ARRGameMode::PrintSimConfig ( ) const
overridevirtual

Print GameMode's user configs in INI.

Reimplemented from ARRROS2GameMode.

◆ PrintUEPreprocessors()

static void ARRGameMode::PrintUEPreprocessors ( )
static

Print UE global preprocessors' values.

◆ SetSimType()

void ARRGameMode::SetSimType ( const ERRSimType  InSimType)
inline

◆ StartPlay()

virtual void ARRGameMode::StartPlay ( )
overridevirtual

Set benchmark, fixed time step via FApp if running without editor.

Call ConfigureSimInPlay and StartSim

See also
FApp

Reimplemented from ARRROS2GameMode.

◆ StartSim()

virtual void ARRGameMode::StartSim ( )
virtual
  1. LOAD [ImageWrapperModule]. This must be loaded this early for possible external image-based texture loading at Sim

initialization!

  1. LOAD SIM STATIC GLOBAL RESOURCES
  2. START SIM ONCE RESOURCES ARE LOADED

    The reason for this scheduled delegate is some essential operation, which facilitates sim startup activities like

    asynchronous resource loading, could only run after this [ARRGameState::BeginPlay()] ends!

◆ TryStartingSim()

bool ARRGameMode::TryStartingSim ( )
private

This method was scheduled to be run by BeginPlay()

  1. WAIT FOR RESOURCE LOADING, in prep for Sim mode initialization
  2. START PARENT'S PLAY, WHICH TRIGGER OTHERS PLAY FROM GAME STATE, PLAYER CONTROLLER, ETC.

UFUNCTION()

Member Data Documentation

◆ bBenchmark

bool ARRGameMode::bBenchmark = true

◆ BeginTimeStampSec

float ARRGameMode::BeginTimeStampSec = 0.f
private

◆ OwnTimerHandle

FTimerHandle ARRGameMode::OwnTimerHandle
private

◆ SIM_START_TIMEOUT_MINS

constexpr int32 ARRGameMode::SIM_START_TIMEOUT_MINS = 2
staticconstexpr

◆ SIM_START_TIMEOUT_SECS

constexpr int32 ARRGameMode::SIM_START_TIMEOUT_SECS = 60 * SIM_START_TIMEOUT_MINS
staticconstexpr

◆ SimType

uint8 ARRGameMode::SimType = static_cast<uint8>(ERRSimType::ROBOT_SIM)

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