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::NamespaceConfiguration Struct Reference

#include <NamespaceConfiguration.h>

Public Types

enum class  NamespaceStrategy { Default , Empty , FromEntityName , Custom }
 

Public Member Functions

 AZ_TYPE_INFO (NamespaceConfiguration, "{5E5BC6EA-DD01-480E-A4D1-6857CF70FDC8}")
 
void PopulateNamespace (bool isRoot, const AZStd::string &entityName)
 
AZStd::string GetNamespace (const AZStd::string &parentNamespace) const
 
void SetNamespace (const AZStd::string &ns, NamespaceStrategy strategy)
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Detailed Description

Configuration for handling of namespaces. Namespaces are useful for various ROS2 components. This structure encapsulates the namespace itself, composing namespaces and context-dependent default values.

Note
This structure is handled through ROS2FrameComponent.

Member Enumeration Documentation

◆ NamespaceStrategy

A choice of methods to handle namespaces.

Note
Top level ROS2FrameComponent will likely be associated with an interesting object (robot). For multi-robot simulations, namespaces are often derived from the robot name itself. For this reason, the default behavior for top level ROS2FrameComponent is to generate the namespace from entity name.
Enumerator
Default 

FromEntityName for top-level frames, Empty otherwise.

Empty 

An empty, blank namespace.

FromEntityName 

Generate from Entity name, but substitute disallowed characters through RosifyName.

Custom 

Non-empty and based on user-provided value.

Member Function Documentation

◆ PopulateNamespace()

void ROS2::NamespaceConfiguration::PopulateNamespace ( bool  isRoot,
const AZStd::string &  entityName 
)

Set namespace based on context.

Parameters
isRootWhether or not the namespace belongs to top-level entity in the entity hierarchy.
entityNameRaw (not ros-ified) name of the entity to which the namespace belongs.

◆ SetNamespace()

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

Update namespace and strategy.

Parameters
nsDesired namespace.
strategyNamespace strategy.

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