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

Example of child class of ARRBaseRobot. More...

#include <TurtlebotBurger.h>

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

Public Member Functions

 ATurtlebotBurger (const FObjectInitializer &ObjectInitializer)
 Construct a new ATurtlebotBurger object. Calls SetupBody. More...
 
- Public Member Functions inherited from ATurtlebotBurgerBase
 ATurtlebotBurgerBase (const FObjectInitializer &ObjectInitializer)
 Construct a new ATurtlebotBurgerBase object. Calls SetupBody. More...
 
- Public Member Functions inherited from ARRBaseRobot
 ARRBaseRobot ()
 Construct a new ARRBaseRobot object. More...
 
 ARRBaseRobot (const FObjectInitializer &ObjectInitializer)
 Construct a new ARRBaseRobot object. More...
 
virtual void BeginPlay () override
 BeginPlay. More...
 
virtual void Tick (float DeltaSeconds) override
 Wake rigid body in addition to Super::Tick() More...
 
void SetupDefault ()
 Initialize default components being configurable in child BP classes. More...
 
virtual void SetRootOffset (const FTransform &InRootOffset)
 Set the root offset for RobotVehicleMoveComponent. More...
 
FORCEINLINE bool IsDynamicRuntimeRobot () const
 DynamicRuntime robot: Implemented purely in cpp, built & loaded up at runtime from raw CAD + metadata (URDF/SDF) More...
 
FORCEINLINE bool IsStaticBPRobot () const
 Static BP robot: implemented in BP, possibly inheriting from #ARBaseRobot or its children classes,. More...
 
FString GetDynamicResourceName (const ERRResourceDataType InDataType) const
 Get name of an already-stored dynamic robot resource (mesh, skeleton, physics asset, etc.) More...
 
FString GetDynamicResourceAssetPath (const ERRResourceDataType InDataType) const
 Get UE asset path of an already-stored dynamic robot resource (mesh, skeleton, physics asset, etc.) More...
 
virtual void OnRep_ROS2Interface ()
 Function called with ROS2Interface replication. Start ROS2Interface if bStartStopROS2Interface=true. More...
 
virtual void OnRep_bStartStopROS2Interface ()
 Function called with bStartStopROS2Interface replication. Start/stop ROS2Interface if it is ready. More...
 
bool IsAuthorizedInThisClient ()
 Check necessary variables has initialized and PlayerId which spawned robot is match to this client PlayerId. More...
 
void CreateROS2Interface ()
 Instantiate ROS 2 Interface without initializing yet. More...
 
void InitROS2Interface ()
 Initialize ROS 2 Interface. Directly call URRRobotROS2Interface::Initialize or execute in client via OnRep_bStartStopROS2Interface. More...
 
bool InitROS2InterfaceImpl ()
 
void DeInitROS2Interface ()
 Stop ROS 2 Interface. Directly call URRRobotROS2Interface::DeInitialize or execute in client via OnRep_bStartStopROS2Interface. More...
 
void SetRobotName (const FString &InRobotName)
 Set robot unique name. More...
 
virtual void SetRobotModelName (const FString InName)
 
virtual FString GetRobotModelName ()
 
FORCEINLINE bool IsBuiltInRobotModel () const
 Is static built robot model by the Editor. More...
 
uint64 GetRobotID () const
 Get robot ID. More...
 
void SetRobotID (uint64 InRobotID)
 Set robot ID. More...
 
virtual bool AddLink (const FString &InLinkName, UStaticMeshComponent *InMesh)
 Add UStaticMeshComponent to Links. More...
 
void SetBaseMeshComp (UMeshComponent *InBaseMeshComp, bool bInMakeAsRoot=true, bool bInDestroyDefaultRoot=true)
 Set BaseMeshComp, optionally making it the new Root, replacing DefaultRoot. More...
 
virtual bool AddJoint (const FString &InParentLinkName, const FString &InChildLinkName, const FString &InJointName, URRJointComponent *InJoint)
 Add URRJointComponent to Joints and set Joint's parent and child link from name in Links. More...
 
virtual void StartJointsInitialization ()
 
virtual void CheckJointsInitialization ()
 
virtual void SetChildComponentsCollisionEnabled (const bool IsEnable)
 Set the ChildComponents Collision Enabled. More...
 
virtual bool InitSensors (UROS2NodeComponent *InROS2Node)
 Initialize sensors components which are child class of URRROS2BaseSensorComponent. More...
 
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...
 
virtual bool ReplicateSubobjects (UActorChannel *Channel, FOutBunch *Bunch, FReplicationFlags *RepFlags) override
 Allows a component to replicate other subobject on the actor. More...
 
virtual void SetJointState (const TMap< FString, TArray< float >> &InJointState, const ERRJointControlType InJointControlType)
 Set Joints state to Joints. More...
 
virtual void StopMovement ()
 Stop robot movement, resetting all vel inputs. More...
 
virtual void SetMoveComponent (UMovementComponent *InMoveComponent)
 
virtual void SetLinearVel (const FVector &InLinearVel)
 Set velocity to RobotVehicleMoveComponent. More...
 
virtual void SetAngularVel (const FVector &InAngularVel)
 Set angular velocity to RobotVehicleMoveComponent. More...
 
virtual void SyncServerLinearMovement (float InClientTimeStamp, const FTransform &InClientRobotTransform, const FVector &InLinearVel)
 Set position and linear velocity to the robot in the server. More...
 
virtual void SyncServerAngularMovement (float InClientTimeStamp, const FRotator &InClientRobotRotation, const FVector &InAngularVel)
 Set rotation and angular velocity to the robot in the server. More...
 
virtual void SetLocalLinearVel (const FVector &InLinearVel)
 Set linear velocity to RobotVehicleMoveComponent in the client. More...
 
virtual void SetLocalAngularVel (const FVector &InAngularVel)
 Set angular velocity to RobotVehicleMoveComponent in the client. More...
 
void BPConfigureMovementComponent ()
 This method is called inside PostInitializeComponents. More...
 
bool CheckUIUserWidget () const
 Check whether #UIUserWidget is valid. More...
 
virtual bool InitPropertiesFromJSON ()
 Parse Json parameters in ROSSpawnParameters. More...
 
void BPInitPropertiesFromJSON ()
 This method is called inside PreInitializeComponents. More...
 
virtual void ConfigureMovementComponent ()
 Calls both InitPropertiesFromJSON and BPInitPropertiesFromJSON. More...
 
virtual void InitUIWidget ()
 Create & init UIWidgetComp. More...
 
virtual bool InitPropertiesFromJSONAll ()
 
- Public Member Functions inherited from ARRBaseActor
 ARRBaseActor ()
 Construct a new ARRBaseActor object. More...
 
 ARRBaseActor (const FObjectInitializer &ObjectInitializer)
 Construct a new ARRBaseActor object. More...
 
void SetupDefaultBase ()
 Initialize default components being configurable in child BP classes. More...
 
void SetEntityModelName (const FString &InEntityModelName)
 
bool IsDataSynthEntity () const
 
template<typename TActorSpawnInfo >
bool InitializeWithSpawnInfo (const TActorSpawnInfo &InActorInfo)
 ACTOR INTIALIZING GENERAL INFO (Unique name, mesh list, material list, etc.) More...
 
virtual bool Initialize ()
 Set #GameMode #GameState #GameSingleton #PlayerController. More...
 
virtual bool HasInitialized (bool bIsLogged=false) const
 
virtual void Reset ()
 Rest. Calls #ActorInfo::ClearMeshInfo. More...
 
void SetTickEnabled (bool bInIsTickEnabled)
 Use URRUObjectUtils::SetupActorTick. More...
 

Protected Member Functions

bool SetupBody () override
 Create UStaticMeshComponent, create UPhysicsConstraintComponent. More...
 
bool SetupConstraintsAndPhysics () override
 Setup material, relative location, anugular/linear limits, drive params. More...
 
void SetupWheelDrives () override
 Setup UDifferentialDriveComponent. More...
 
- Protected Member Functions inherited from ATurtlebotBurgerBase
virtual void PostInitializeComponents () override
 calls SetupWheelDrives More...
 
- Protected Member Functions inherited from ARRBaseRobot
virtual void PreInitializeComponents () override
 Instantiate default child components. More...
 
virtual bool InitMoveComponent ()
 Create and Initialize MovementComponent if VehicleMoveComponentClass != nullptr. More...
 
void BPPreInitializeComponents ()
 This method is called inside PreInitializeComponents. More...
 
void BPPostInitializeComponents ()
 This method is called inside PreInitializeComponents. More...
 
- Protected Member Functions inherited from ARRBaseActor
virtual void PrintSimConfig () const
 Print class members' values configured in RapyutaSimSettings.ini. More...
 
virtual void DoGlobalConfig ()
 Globally config custom setups (eg. Exec() cmds) applied for all instances of this class. More...
 

Protected Attributes

UPhysicsConstraintComponent * Base_WheelLeft = nullptr
 
UPhysicsConstraintComponent * Base_WheelRight = nullptr
 
- Protected Attributes inherited from ATurtlebotBurgerBase
UStaticMeshComponent * Base = nullptr
 
UStaticMeshComponent * LidarSensor = nullptr
 
URR2DLidarComponentLidarComponent = nullptr
 
UStaticMeshComponent * WheelLeft = nullptr
 
UStaticMeshComponent * WheelRight = nullptr
 
UStaticMeshComponent * CasterBack = nullptr
 
UPhysicsConstraintComponent * Base_LidarSensor = nullptr
 
UPhysicsConstraintComponent * Base_CasterBack = nullptr
 
float MaxForce = 1000.f
 
UMaterial * VehicleMaterial = nullptr
 
UMaterial * BallMaterial = nullptr
 
uint8 bBodyComponentsCreated: 1
 
float WheelRadius = 3.3f
 pass to UDifferentialDriveComponent. More...
 
float WheelSeparationHalf = 7.9f
 pass to UDifferentialDriveComponent. More...
 

Additional Inherited Members

- Public Attributes inherited from ARRBaseRobot
TObjectPtr< USceneComponent > DefaultRoot = nullptr
 
FOnRobotCreationDone OnRobotCreationDone
 Robot creation done delegate. More...
 
TSubclassOf< URRRobotROS2InterfaceROS2InterfaceClass = nullptr
 Default class to use when ROS 2 Interface is setup for robot. More...
 
TObjectPtr< URRRobotROS2InterfaceROS2Interface = nullptr
 
bool bStartStopROS2Interface = false
 Flag to start/stop ROS2Interfaces. Since RPC can't be used, use replication to trigger initialization. More...
 
TObjectPtr< UROS2SpawnableROSSpawnParameters = nullptr
 ROSSpawn parameters which is passed to ROS2Interface. More...
 
TObjectPtr< ARRBaseRobotServerRobot = nullptr
 Pointer to the robot's server-owned version. More...
 
FTimerHandle ROS2InitTimer
 
FString RobotUniqueName
 
FString RobotModelName
 Robot Model Name (loaded from URDF/SDF) More...
 
uint64 RobotID = 0
 Robot ID No. More...
 
TMap< FString, UStaticMeshComponent * > Links
 
TObjectPtr< UMeshComponent > BaseMeshComp = nullptr
 Base mesh comp, normally also as the root comp. More...
 
TMap< FString, URRJointComponent * > Joints
 
bool bInitializeJoints = true
 
ERRNetworkAuthorityType NetworkAuthorityType = ERRNetworkAuthorityType::CLIENT
 Network Authority Type. More...
 
FVector TargetLinearVel = FVector::ZeroVector
 [cm/s] Local target linear vel More...
 
FVector TargetAngularVel = FVector::ZeroVector
 [deg/s] Local target angular vel [X:Roll - Y:Pitch - Z: Yaw] More...
 
TObjectPtr< UMovementComponent > MovementComponent = nullptr
 Main robot movement component (kinematics/diff-drive or wheels-drive comp) More...
 
TObjectPtr< URobotVehicleMovementComponentRobotVehicleMoveComponent
 Movecomponent casted to URobotVehicleMovementComponent for utility. More...
 
TSubclassOf< UMovementComponent > VehicleMoveComponentClass
 Class of the main robot movement component, configurable in child class. More...
 
FTransform RootOffset = FTransform::Identity
 Offset transform between the Actor root component and the pose that will be published in /odom topic. More...
 
bool bInitRobotVehicleMoveComponent = true
 Call ConfigureMovecomponent and RobotVehicleMoveComponent::Initialize() in InitMoveComponent in PostInitializeComponents or not. More...
 
bool bMobileRobot = true
 Mobile robot or not. If this is false, movecomponent=nullptr and ROS 2 odom and cmd_vel interface are disabled. More...
 
bool bJointControl = true
 Control Joint by ROS2 o rnot. More...
 
uint8 bUIWidgetEnabled: 1
 Enable widget or not. More...
 
TObjectPtr< URRUIWidgetComponentUIWidgetComp = nullptr
 UI widget component. More...
 
FTransform UIWidgetOffset = FTransform(FVector(0.f, 0.f, 100.f))
 Relative pose of the UI widget from the owner robot. More...
 
TSubclassOf< UUserWidget > UIUserWidgetClass
 Widget class. More...
 
bool bInitializingJoints = false
 
TMap< UPrimitiveComponent *, FName > OriginalCollisionProfiles
 Children UPrimitives components orignal collision profiles. More...
 
- Public Attributes inherited from ARRBaseActor
TSharedPtr< FRRActorSpawnInfoActorInfo = nullptr
 
ARRGameStateRRGameState = nullptr
 Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More...
 
URRGameSingletonRRGameSingleton = nullptr
 Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More...
 
ARRGameModeRRGameMode = nullptr
 Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More...
 
ARRPlayerControllerRRPlayerController = nullptr
 Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More...
 
int8 SceneInstanceId = URRActorCommon::DEFAULT_SCENE_INSTANCE_ID
 
URRActorCommonActorCommon = nullptr
 
FString EntityUniqueName
 Actually Object's Name is also unique as noted by UE, but we just do not want to rely on it. More...
 
FString EntityModelName
 
FTimerHandle GenericTimerHandle
 
- Static Public Attributes inherited from ARRBaseActor
static TMap< UClass *, TUniquePtr< std::once_flag > > OnceFlagList
 [std::once_flag] also applies even in case of consecutive PIE runs, More...
 
static std::once_flag OnceFlag
 Used for class having single-branch child classes (linear inheritance tree) More...
 
static int8 SSceneInstanceId
 

Detailed Description

Example of child class of ARRBaseRobot.

Uses UDifferentialDriveComponent

This class is designed to be inheritted from Blueprint class to be assigned UStaticMeshComponent.

UCLASS()

Constructor & Destructor Documentation

◆ ATurtlebotBurger()

ATurtlebotBurger::ATurtlebotBurger ( const FObjectInitializer &  ObjectInitializer)

Construct a new ATurtlebotBurger object. Calls SetupBody.

Parameters
ObjectInitializer

Member Function Documentation

◆ SetupBody()

bool ATurtlebotBurger::SetupBody ( )
overrideprotectedvirtual

Create UStaticMeshComponent, create UPhysicsConstraintComponent.

Reimplemented from ATurtlebotBurgerBase.

◆ SetupConstraintsAndPhysics()

bool ATurtlebotBurger::SetupConstraintsAndPhysics ( )
overrideprotectedvirtual

Setup material, relative location, anugular/linear limits, drive params.

Reimplemented from ATurtlebotBurgerBase.

◆ SetupWheelDrives()

void ATurtlebotBurger::SetupWheelDrives ( )
overrideprotectedvirtual

Member Data Documentation

◆ Base_WheelLeft

UPhysicsConstraintComponent* ATurtlebotBurger::Base_WheelLeft = nullptr
protected

◆ Base_WheelRight

UPhysicsConstraintComponent* ATurtlebotBurger::Base_WheelRight = nullptr
protected

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