RapyutaSimulationPlugins
|
Base Odom Component which provide actor pose changes. More...
#include <RRBaseOdomComponent.h>
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< ARRBaseRobot > | RobotVehicle = 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< URRGaussianNoise > | PositionNoise |
TObjectPtr< URRGaussianNoise > | RotNoise |
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() |
URRROS2BaseSensorPublisher * | SensorPublisher = 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 |
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))
URRBaseOdomComponent::URRBaseOdomComponent | ( | ) |
FTransform URRBaseOdomComponent::GetOdomTF | ( | ) | const |
|
virtual |
|
overridevirtual |
Set publish frequency, topic name and FrameId.
if bAppendNodeNamespace == true, FrameId become ROS2Node's namespace + #FramId
InROS2Node | ROS2Node which this publisher belongs to |
InTopicName | If this is empty, topic name become TopicName. |
Reimplemented from URRROS2BaseSensorComponent.
|
overridevirtual |
Calculate relative pose with URRGeneralUtils and update #Data.
Reimplemented from URRROS2BaseSensorComponent.
void URRBaseOdomComponent::SetFrameIds | ( | const FString & | InFrameId, |
const FString & | InChildFrameId | ||
) |
Set the Frame Id and child frame id of odometry.
InFrameId | |
InChildFrameId |
|
virtual |
Update odom.
Noise is integral of gaussian noise.
InDeltaTime |
bool URRBaseOdomComponent::bIsOdomInitialized = false |
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
bool URRBaseOdomComponent::bPublishOdomTf = false |
bool URRBaseOdomComponent::bWithNoise = true |
Add noise or not.
FString URRBaseOdomComponent::ChildFrameId = TEXT("base_footprint") |
Child frame id of odometry.
FTransform URRBaseOdomComponent::InitialTransform = FTransform::Identity |
|
protected |
float URRBaseOdomComponent::NoiseMeanPosition = 0.f |
float URRBaseOdomComponent::NoiseMeanRot = 0.f |
float URRBaseOdomComponent::NoiseVariancePosition = 0.001f |
float URRBaseOdomComponent::NoiseVarianceRot = 0.005f |
FROSOdom URRBaseOdomComponent::OdomData |
EOdomSource URRBaseOdomComponent::OdomSource = EOdomSource::WORLD |
TObjectPtr<URRGaussianNoise> URRBaseOdomComponent::PositionNoise |
|
protected |
|
protected |
TWeakObjectPtr<ARRBaseRobot> URRBaseOdomComponent::RobotVehicle = nullptr |
FTransform URRBaseOdomComponent::RootOffset = FTransform::Identity |
Offset transform between the Owner Actor root component and the pose that will be published in /odom topic.
TObjectPtr<URRGaussianNoise> URRBaseOdomComponent::RotNoise |