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

Base Robot ROS 2 interface class. More...

#include <RRBaseROS2Interface.h>

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

Public Member Functions

virtual bool IsSupportedForNetworking () const override
 
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 void Initialize (AActor *Owner)
 Initialize robot's ROS 2 interface by calling InitRobotROS2Node, InitPublishers, InitSubscriptions and ARRBaseRobot::InitSensors. More...
 
virtual void InitInterfaces ()
 Init publishers, subscribers, service clients, service servers, action clients, and action servers. More...
 
void BPInitialize ()
 AdditionalInitialization implemented in BP. More...
 
virtual void DeInitialize ()
 DeInitialize robot's ROS 2 interface by stopping publisher. More...
 
virtual void InitRobotROS2Node (AActor *Owner)
 Spawn ROS2Node and initialize it. More...
 
virtual void InitROS2NodeParam (AActor *Owner)
 Spawn ROS2 Node, and initialize it if ROS2 Node = nullptr. More...
 
virtual void SetupROSParams ()
 Setup ROS Params, overridable by child classes to config custom ROS 2 Interface's params. More...
 
void BPSetupROSParams ()
 Setup ROS params called after SetupROSParams. override by BP child class to config custom ROS 2 Interface's params. More...
 
void SetupROSParamsAll ()
 Call SetupROSParams and BPSetupROSParams. More...
 
virtual bool InitPublishers ()
 Initialize non sensor basic publishers such as odometry. More...
 
virtual void StopPublishers ()
 Stop all publishers. More...
 
virtual bool InitSubscriptions ()
 Initialize subscriptions for cmd_vel & joint_states topics. More...
 
virtual bool InitServiceClients ()
 Initialize service clients. More...
 
virtual bool InitServiceServers ()
 Initialize service servers. More...
 
virtual bool InitActionClients ()
 Initialize action clients. More...
 
virtual bool InitActionServers ()
 Initialize action servers. More...
 

Public Attributes

TObjectPtr< UROS2NodeComponent > RobotROS2Node = nullptr
 ROS 2 node of this interface created by InitRobotROS2Node. More...
 
TObjectPtr< UROS2SpawnableROSSpawnParameters = nullptr
 ROS2SpawnParameters which is created when robot is spawn from /SpawnEntity srv provided by ASimulationState. More...
 
FString DefautlROSNamespace = TEXT("")
 Defautl ROS namespace. More...
 
TMap< FString, UROS2Publisher * > Publishers
 You can add your publishers here to ask ROS2Interface to manage. More...
 
TMap< FString, UROS2Subscriber * > Subscribers
 You can add your subscribers here to ask ROS2Interface to manage. More...
 
TMap< FString, UROS2ServiceClient * > ServiceClients
 You can add your publishers here to ask ROS2Interface to manage. More...
 
TMap< FString, UROS2ServiceServer * > ServiceServers
 You can add your publishers here to ask ROS2Interface to manage. More...
 
TMap< FString, UROS2ActionClient * > ActionClients
 You can add your publishers here to ask ROS2Interface to manage. More...
 
TMap< FString, UROS2ActionServer * > ActionServers
 You can add your publishers here to ask ROS2Interface to manage. More...
 

Detailed Description

Base Robot ROS 2 interface class.

This class owns ROS2Node and controls ROS 2 interfaces

Please create child class of this class to custom ROS2Interface which have your own ROS2Interfaces.

UCLASS(Blueprintable, EditInlineNew)

This class represents the base ROS 2 interface for a robot in the RapyutaSimulationPlugins module.

   It provides functionality for initializing and managing ROS 2 nodes, publishers, subscribers, service clients,

   service servers, action clients, and action servers.

Member Function Documentation

◆ BPInitialize()

void URRBaseROS2Interface::BPInitialize ( )

AdditionalInitialization implemented in BP.

Child BP class can use this method to add initialization behaviour

UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)

◆ BPSetupROSParams()

void URRBaseROS2Interface::BPSetupROSParams ( )

Setup ROS params called after SetupROSParams. override by BP child class to config custom ROS 2 Interface's params.

UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)

◆ DeInitialize()

virtual void URRBaseROS2Interface::DeInitialize ( )
virtual

DeInitialize robot's ROS 2 interface by stopping publisher.

Parameters
InRobot

Reimplemented in URRRobotROS2Interface.

◆ GetLifetimeReplicatedProps()

void URRBaseROS2Interface::GetLifetimeReplicatedProps ( TArray< FLifetimeProperty > &  OutLifetimeProps) const
override

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

replicated properties

Parameters
OutLifetimePropsOutput lifetime properties

◆ InitActionClients()

virtual bool URRBaseROS2Interface::InitActionClients ( )
virtual

Initialize action clients.

Overidden in child robot ROS 2 interface classes for specialized action clients.

UFUNCTION()

◆ InitActionServers()

virtual bool URRBaseROS2Interface::InitActionServers ( )
virtual

Initialize action servers.

Overidden in child robot ROS 2 interface classes for specialized action servers.

UFUNCTION()

◆ Initialize()

virtual void URRBaseROS2Interface::Initialize ( AActor *  Owner)
virtual

Initialize robot's ROS 2 interface by calling InitRobotROS2Node, InitPublishers, InitSubscriptions and ARRBaseRobot::InitSensors.

This method is mainly used by #ARRBaseoRbotROSController via ARRBaseRobot::InitROS2Interface.

Parameters
InRobot

UFUNCTION(BlueprintCallable)

Reimplemented in URRRobotROS2Interface.

◆ InitInterfaces()

virtual void URRBaseROS2Interface::InitInterfaces ( )
virtual

Init publishers, subscribers, service clients, service servers, action clients, and action servers.

Reimplemented in URRRobotROS2Interface.

◆ InitPublishers()

virtual bool URRBaseROS2Interface::InitPublishers ( )
virtual

Initialize non sensor basic publishers such as odometry.

Overidden in child robot ROS 2 interface classes for specialized publishers.

UFUNCTION()

Reimplemented in URRRobotROS2Interface.

◆ InitRobotROS2Node()

virtual void URRBaseROS2Interface::InitRobotROS2Node ( AActor *  Owner)
virtual

Spawn ROS2Node and initialize it.

Parameters
InPawn

◆ InitROS2NodeParam()

virtual void URRBaseROS2Interface::InitROS2NodeParam ( AActor *  Owner)
virtual

Spawn ROS2 Node, and initialize it if ROS2 Node = nullptr.

Parameters
Owner

Reimplemented in URRRobotROS2Interface.

◆ InitServiceClients()

virtual bool URRBaseROS2Interface::InitServiceClients ( )
virtual

Initialize service clients.

Overidden in child robot ROS 2 interface classes for specialized services clients.

UFUNCTION()

◆ InitServiceServers()

virtual bool URRBaseROS2Interface::InitServiceServers ( )
virtual

Initialize service servers.

Overidden in child robot ROS 2 interface classes for specialized services servers.

UFUNCTION()

◆ InitSubscriptions()

virtual bool URRBaseROS2Interface::InitSubscriptions ( )
virtual

Initialize subscriptions for cmd_vel & joint_states topics.

Overidden in child robot ROS 2 interface classes for specialized topic subscriptions.

UFUNCTION()

Reimplemented in URRRobotROS2Interface.

◆ IsSupportedForNetworking()

virtual bool URRBaseROS2Interface::IsSupportedForNetworking ( ) const
inlineoverridevirtual

◆ SetupROSParams()

virtual void URRBaseROS2Interface::SetupROSParams ( )
inlinevirtual

Setup ROS Params, overridable by child classes to config custom ROS 2 Interface's params.

UFUNCTION()

Reimplemented in URRTurtlebotROS2Interface.

◆ SetupROSParamsAll()

void URRBaseROS2Interface::SetupROSParamsAll ( )
inline

◆ StopPublishers()

virtual void URRBaseROS2Interface::StopPublishers ( )
virtual

Stop all publishers.

UFUNCTION()

Member Data Documentation

◆ ActionClients

TMap<FString, UROS2ActionClient*> URRBaseROS2Interface::ActionClients

You can add your publishers here to ask ROS2Interface to manage.

Other option is to create child class to overwrite each method.

UPROPERTY(Transient, BlueprintReadWrite)

◆ ActionServers

TMap<FString, UROS2ActionServer*> URRBaseROS2Interface::ActionServers

You can add your publishers here to ask ROS2Interface to manage.

Other option is to create child class to overwrite each method.

UPROPERTY(Transient, BlueprintReadWrite)

◆ DefautlROSNamespace

FString URRBaseROS2Interface::DefautlROSNamespace = TEXT("")

Defautl ROS namespace.

This is not used if robot spawn from ROS or Pawn is ARRBaseRobot

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ Publishers

TMap<FString, UROS2Publisher*> URRBaseROS2Interface::Publishers

You can add your publishers here to ask ROS2Interface to manage.

Other option is to create child class to overwrite each method.

UPROPERTY(Transient, BlueprintReadWrite)

◆ RobotROS2Node

TObjectPtr<UROS2NodeComponent> URRBaseROS2Interface::RobotROS2Node = nullptr

ROS 2 node of this interface created by InitRobotROS2Node.

Todo:
rename to ROS2Node

UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated)

◆ ROSSpawnParameters

TObjectPtr<UROS2Spawnable> URRBaseROS2Interface::ROSSpawnParameters = nullptr

ROS2SpawnParameters which is created when robot is spawn from /SpawnEntity srv provided by ASimulationState.

UPROPERTY(VisibleAnywhere, Replicated)

◆ ServiceClients

TMap<FString, UROS2ServiceClient*> URRBaseROS2Interface::ServiceClients

You can add your publishers here to ask ROS2Interface to manage.

Other option is to create child class to overwrite each method.

UPROPERTY(Transient, BlueprintReadWrite)

◆ ServiceServers

TMap<FString, UROS2ServiceServer*> URRBaseROS2Interface::ServiceServers

You can add your publishers here to ask ROS2Interface to manage.

Other option is to create child class to overwrite each method.

UPROPERTY(Transient, BlueprintReadWrite)

◆ Subscribers

TMap<FString, UROS2Subscriber*> URRBaseROS2Interface::Subscribers

You can add your subscribers here to ask ROS2Interface to manage.

Other option is to create child class to overwrite each method.

UPROPERTY(Transient, BlueprintReadWrite)


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