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

Common utils for Prefab Maker classes. More...

Functions

void AddRequiredComponentsToEntity (AZ::EntityId entityId)
 
AZ::IO::Path GetAzModelAssetPathFromModelPath (const AZ::IO::Path &modelPath)
 
void SetEntityTransformLocal (const urdf::Pose &origin, AZ::EntityId entityId)
 
AzToolsFramework::Prefab::PrefabEntityResult CreateEntity (AZ::EntityId parentEntityId, const AZStd::string &name)
 
AZStd::string MakeEntityName (const AZStd::string &rootName, const AZStd::string &type, size_t index=0)
 
AZStd::optional
< Utils::AvailableAsset
GetAssetFromPath (const Utils::UrdfAssetMap &urdfAssetsMapping, const AZStd::string &urdfMeshPath)
 
AZStd::optional
< Utils::AvailableAsset
GetAssetFromPath (const Utils::UrdfAssetMap &urdfAssetsMapping, const std::string &urdfMeshPath)
 

Detailed Description

Common utils for Prefab Maker classes.

Function Documentation

void ROS2::PrefabMakerUtils::AddRequiredComponentsToEntity ( AZ::EntityId  entityId)

Add required components to the entity. Calling this will ensure all the required (default) components are added.

Parameters
entityIdentity to modify.
AzToolsFramework::Prefab::PrefabEntityResult ROS2::PrefabMakerUtils::CreateEntity ( AZ::EntityId  parentEntityId,
const AZStd::string &  name 
)

Create a prefab entity in hierarchy.

Parameters
parentEntityIdid of parent entity for this new entity. Passing an invalid id would get the entity in the current context (for example, an entity which is currently open in the Editor).
namename for the new entity.
Returns
a result which is either a created prefab entity or an error.
AZStd::optional<Utils::AvailableAsset> ROS2::PrefabMakerUtils::GetAssetFromPath ( const Utils::UrdfAssetMap &  urdfAssetsMapping,
const AZStd::string &  urdfMeshPath 
)

Get an Asset for a specified mesh given its path and mapping.

Parameters
urdfAssetsMappingmapping of URDF assets.
urdfMeshPatha path to the mesh for which the Asset is requested.
Returns
Asset for the mesh, if found in the mapping.
AZStd::optional<Utils::AvailableAsset> ROS2::PrefabMakerUtils::GetAssetFromPath ( const Utils::UrdfAssetMap &  urdfAssetsMapping,
const std::string &  urdfMeshPath 
)

Get Asset from path. Version for std::string.

See Also
GetAssetFromPath.
AZ::IO::Path ROS2::PrefabMakerUtils::GetAzModelAssetPathFromModelPath ( const AZ::IO::Path &  modelPath)

For a given model, return path to its Assets.

Parameters
modelPathpath to the model.
Returns
path to assets directory for this model.
AZStd::string ROS2::PrefabMakerUtils::MakeEntityName ( const AZStd::string &  rootName,
const AZStd::string &  type,
size_t  index = 0 
)

Create an entity name from arguments.

Parameters
rootNameroot of entity's name.
typetype of entity, depending on corresponding URDF tag. For example, "visual".
indexindex of entity, useful when multiple visuals or colliders are present for a single link.
Returns
entity name, for example "robotBumper_visual_1".
void ROS2::PrefabMakerUtils::SetEntityTransformLocal ( const urdf::Pose &  origin,
AZ::EntityId  entityId 
)

Set the transform for an entity.

Parameters
originpose for the entity to set.
entityIdentity which will be modified.