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

Base Odom Component which provide actor pose changes. More...

#include <RRBaseOdomComponent.h>

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

Public Member Functions

 URRBaseOdomComponent ()
 
virtual void SensorUpdate () override
 Calculate relative pose with URRGeneralUtils and update #Data. More...
 
virtual void PreInitializePublisher (UROS2NodeComponent *InROS2Node, const FString &InTopicName) override
 Set publish frequency, topic name and FrameId. More...
 
void SetFrameIds (const FString &InFrameId, const FString &InChildFrameId)
 Set the Frame Id and child frame id of odometry. More...
 
FTransform GetOdomTF () const
 
virtual void InitOdom ()
 
virtual void UpdateOdom (float InDeltaTime)
 Update odom. More...
 
- Public Member Functions inherited from URRROS2BaseSensorComponent
 URRROS2BaseSensorComponent ()
 Construct a new URRROS2BaseSensorComponent object. More...
 
virtual void InitalizeWithROS2 (UROS2NodeComponent *InROS2Node, const FString &InPublisherName=TEXT(""), const FString &InTopicName=TEXT(""), const UROS2QoS InQoS=UROS2QoS::SensorData)
 Create and initialize publisher and start sensor update by calling. More...
 
virtual void CreatePublisher (const FString &InPublisherName=TEXT(""))
 Create a Publisher with SensorPublisherClass. More...
 
virtual void InitializePublisher (UROS2NodeComponent *InROS2Node, const UROS2QoS InQoS=UROS2QoS::SensorData)
 Initialize Sensorpublisher by using UROS2Publisher's methods. More...
 
virtual void Run ()
 Start timer to update and publish sensor data by using SetTimer. More...
 
virtual void Stop ()
 Stop timer to update and publish sensor data by using ClearTimer. More...
 
virtual void SetROS2Msg (UROS2GenericMsg *InMessage)
 Set sensor data to ROS 2 msg. This method should be overwritten by child class. More...
 

Public Attributes

TWeakObjectPtr< ARRBaseRobotRobotVehicle = nullptr
 
bool bManualUpdate = false
 If this is true, SensorUpdate do nothing. More...
 
FROSOdom OdomData
 
FString ChildFrameId = TEXT("base_footprint")
 Child frame id of odometry. More...
 
FTransform InitialTransform = FTransform::Identity
 
EOdomSource OdomSource = EOdomSource::WORLD
 
bool bPublishOdomTf = false
 Publish tf or not. More...
 
bool bIsOdomInitialized = false
 
FTransform RootOffset = FTransform::Identity
 Offset transform between the Owner Actor root component and the pose that will be published in /odom topic. More...
 
TObjectPtr< URRGaussianNoisePositionNoise
 
TObjectPtr< URRGaussianNoiseRotNoise
 
float NoiseMeanPosition = 0.f
 
float NoiseVariancePosition = 0.001f
 
float NoiseMeanRot = 0.f
 
float NoiseVarianceRot = 0.005f
 
bool bWithNoise = true
 Add noise or not. More...
 
- Public Attributes inherited from URRROS2BaseSensorComponent
TSubclassOf< UROS2Publisher > SensorPublisherClass = URRROS2BaseSensorPublisher::StaticClass()
 
URRROS2BaseSensorPublisherSensorPublisher = nullptr
 
TSubclassOf< UROS2GenericMsg > MsgClass = UROS2GenericMsg::StaticClass()
 
FString TopicName = TEXT("sensor_data")
 
FString FrameId = TEXT("sensor_frame")
 
int32 PublicationFrequencyHz = 30
 
bool bAppendNodeNamespace = true
 Append namespace to FrameId or not. More...
 
bool bIsValid = true
 

Protected Attributes

float LastUpdatedTime = 0.f
 
FTransform PreviousTransform = FTransform::Identity
 
FTransform PreviousNoisyTransform = FTransform::Identity
 
- Protected Attributes inherited from URRROS2BaseSensorComponent
FTimerHandle TimerHandle
 

Detailed Description

Base Odom Component which provide actor pose changes.

Default odom calculation is done by differentiate current pose and last pose.

You can create child odom source class from this class or update odom data directly

with bManualUpdate=true to avoid updating data by this class.

UCLASS(ClassGroup = (Custom), Blueprintable, meta = (BlueprintSpawnableComponent))

Constructor & Destructor Documentation

◆ URRBaseOdomComponent()

URRBaseOdomComponent::URRBaseOdomComponent ( )

Member Function Documentation

◆ GetOdomTF()

FTransform URRBaseOdomComponent::GetOdomTF ( ) const

◆ InitOdom()

virtual void URRBaseOdomComponent::InitOdom ( )
virtual

◆ PreInitializePublisher()

virtual void URRBaseOdomComponent::PreInitializePublisher ( UROS2NodeComponent *  InROS2Node,
const FString &  InTopicName 
)
overridevirtual

Set publish frequency, topic name and FrameId.

if bAppendNodeNamespace == true, FrameId become ROS2Node's namespace + #FramId

Parameters
InROS2NodeROS2Node which this publisher belongs to
InTopicNameIf this is empty, topic name become TopicName.

UFUNCTION(BlueprintCallable)

Reimplemented from URRROS2BaseSensorComponent.

◆ SensorUpdate()

virtual void URRBaseOdomComponent::SensorUpdate ( )
overridevirtual

Calculate relative pose with URRGeneralUtils and update #Data.

Reimplemented from URRROS2BaseSensorComponent.

◆ SetFrameIds()

void URRBaseOdomComponent::SetFrameIds ( const FString &  InFrameId,
const FString &  InChildFrameId 
)

Set the Frame Id and child frame id of odometry.

Parameters
InFrameId
InChildFrameId

◆ UpdateOdom()

virtual void URRBaseOdomComponent::UpdateOdom ( float  InDeltaTime)
virtual

Update odom.

Noise is integral of gaussian noise.

Parameters
InDeltaTime

Member Data Documentation

◆ bIsOdomInitialized

bool URRBaseOdomComponent::bIsOdomInitialized = false

◆ bManualUpdate

bool URRBaseOdomComponent::bManualUpdate = false

If this is true, SensorUpdate do nothing.

Since odometry calculation is depends on movement component, you can make this true to and manually update Odomdata by movement component

UPROPERTY(VisibleAnywhere, BlueprintReadWrite)

◆ bPublishOdomTf

bool URRBaseOdomComponent::bPublishOdomTf = false

Publish tf or not.

Todo:
move this to publisher

UPROPERTY(BlueprintReadWrite)

◆ bWithNoise

bool URRBaseOdomComponent::bWithNoise = true

◆ ChildFrameId

FString URRBaseOdomComponent::ChildFrameId = TEXT("base_footprint")

Child frame id of odometry.

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ InitialTransform

FTransform URRBaseOdomComponent::InitialTransform = FTransform::Identity

◆ LastUpdatedTime

float URRBaseOdomComponent::LastUpdatedTime = 0.f
protected

◆ NoiseMeanPosition

float URRBaseOdomComponent::NoiseMeanPosition = 0.f

◆ NoiseMeanRot

float URRBaseOdomComponent::NoiseMeanRot = 0.f

◆ NoiseVariancePosition

float URRBaseOdomComponent::NoiseVariancePosition = 0.001f

◆ NoiseVarianceRot

float URRBaseOdomComponent::NoiseVarianceRot = 0.005f

◆ OdomData

FROSOdom URRBaseOdomComponent::OdomData

◆ OdomSource

EOdomSource URRBaseOdomComponent::OdomSource = EOdomSource::WORLD

◆ PositionNoise

TObjectPtr<URRGaussianNoise> URRBaseOdomComponent::PositionNoise

◆ PreviousNoisyTransform

FTransform URRBaseOdomComponent::PreviousNoisyTransform = FTransform::Identity
protected

◆ PreviousTransform

FTransform URRBaseOdomComponent::PreviousTransform = FTransform::Identity
protected

◆ RobotVehicle

TWeakObjectPtr<ARRBaseRobot> URRBaseOdomComponent::RobotVehicle = nullptr

◆ RootOffset

FTransform URRBaseOdomComponent::RootOffset = FTransform::Identity

Offset transform between the Owner Actor root component and the pose that will be published in /odom topic.

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ RotNoise

TObjectPtr<URRGaussianNoise> URRBaseOdomComponent::RotNoise

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