Open 3D Engine ROS2 Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
ROS2::ROS2FrameComponent Class Reference

#include <ROS2FrameComponent.h>

Inherits AZ::Component, and AZ::TickBus::Handler.

Public Member Functions

 AZ_COMPONENT (ROS2FrameComponent, "{EE743472-3E25-41EA-961B-14096AC1D66F}")
 
 ROS2FrameComponent (const AZStd::string &frameId)
 Initialize to a specific frame id.
 
void Activate () override
 
void Deactivate () override
 
AZStd::string GetFrameID () const
 
void SetFrameID (const AZStd::string &frameId)
 Set a above-mentioned frame id.
 
AZ::Name GetJointName () const
 
void SetJointName (const AZStd::string &jointNameString)
 
AZStd::string GetNamespace () const
 
AZ::Transform GetFrameTransform () const
 
AZStd::string GetGlobalFrameName () const
 
void UpdateNamespaceConfiguration (const AZStd::string &ns, NamespaceConfiguration::NamespaceStrategy strategy)
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 
static void GetRequiredServices (AZ::ComponentDescriptor::DependencyArrayType &required)
 

Detailed Description

This component marks an interesting reference frame for ROS2 ecosystem. It serves as sensor data frame of reference and is responsible, through ROS2Transform, for publishing ros2 static and dynamic transforms (/tf_static, /tf). It also facilitates namespace handling. An entity can only have a single ROS2Frame on each level. Many ROS2 Components require this component.

Note
A robot should have this component on every level of entity hierarchy (for each joint, fixed or dynamic)

Member Function Documentation

◆ GetFrameID()

AZStd::string ROS2::ROS2FrameComponent::GetFrameID ( ) const

Get a frame id, which is needed for any ROS2 message with a Header

Returns
Frame id which includes the namespace, ready to send in a ROS2 message

◆ GetFrameTransform()

AZ::Transform ROS2::ROS2FrameComponent::GetFrameTransform ( ) const

Get a transform between this frame and the next frame up in hierarchy.

Returns
If the parent frame is found, return a Transform between this frame and the parent. Otherwise, return a global Transform.
Note
Parent frame is not the same as parent Transform: there could be many Transforms in between without ROS2Frame components.

◆ GetGlobalFrameName()

AZStd::string ROS2::ROS2FrameComponent::GetGlobalFrameName ( ) const

Global frame name in ros2 ecosystem.

Returns
The name of the global frame with namespace attached. It is typically "odom", "map", "world".

◆ GetJointName()

AZ::Name ROS2::ROS2FrameComponent::GetJointName ( ) const

Get the joint name including the namespace

Note
Supplementary metadata for Joint components, necessary in some cases for joints addressed by name in ROS 2
Returns
The namespaced joint name, ready to send in a ROS2 message

◆ GetNamespace()

AZStd::string ROS2::ROS2FrameComponent::GetNamespace ( ) const

Get a namespace, which should be used for any publisher or subscriber in the same entity.

Returns
A complete namespace (including parent namespaces)

◆ SetJointName()

void ROS2::ROS2FrameComponent::SetJointName ( const AZStd::string &  jointNameString)

Set the joint name

Note
May be populated during URDF import or set by the user in the Editor view
Parameters
jointNameStringdoes not include the namespace. The namespace prefix is added automatically.

◆ UpdateNamespaceConfiguration()

void ROS2::ROS2FrameComponent::UpdateNamespaceConfiguration ( const AZStd::string &  ns,
NamespaceConfiguration::NamespaceStrategy  strategy 
)

Updates the namespace and namespace strategy of the underlying namespace configuration

Parameters
nsNamespace to set.
strategyNamespace strategy to use.

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