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::URDFPrefabMaker Class Reference

Encapsulates constructive mapping of SDF elements to a complete prefab with entities and components. More...

#include <URDFPrefabMaker.h>

Public Types

using CreatePrefabTemplateResult = AZ::Outcome< AzToolsFramework::Prefab::TemplateId, AZStd::string >
 

Public Member Functions

 URDFPrefabMaker (const AZStd::string &modelFilePath, const sdf::Root *root, AZStd::string prefabPath, const AZStd::shared_ptr< Utils::UrdfAssetMap > sdfAssetsMapping, bool useArticulations=false, AZStd::optional< AZ::Transform > spawnPosition=AZStd::nullopt)
 
CreatePrefabTemplateResult CreatePrefabFromUrdfOrSdf ()
 
CreatePrefabTemplateResult CreatePrefabTemplateFromUrdfOrSdf ()
 
const AZStd::string & GetPrefabPath () const
 
AZStd::string GetStatus ()
 

Detailed Description

Encapsulates constructive mapping of SDF elements to a complete prefab with entities and components.

Member Typedef Documentation

◆ CreatePrefabTemplateResult

using ROS2::URDFPrefabMaker::CreatePrefabTemplateResult = AZ::Outcome<AzToolsFramework::Prefab::TemplateId, AZStd::string>

On prefab creation this will contain a prefab template id when successful, and an error string on failure.

Constructor & Destructor Documentation

◆ URDFPrefabMaker()

ROS2::URDFPrefabMaker::URDFPrefabMaker ( const AZStd::string &  modelFilePath,
const sdf::Root *  root,
AZStd::string  prefabPath,
const AZStd::shared_ptr< Utils::UrdfAssetMap >  sdfAssetsMapping,
bool  useArticulations = false,
AZStd::optional< AZ::Transform >  spawnPosition = AZStd::nullopt 
)

Construct PrefabMaker from arguments.

Parameters
modelFilePathpath to the source URDF/SDF model or world.
rootparsed SDF root object.
prefabPathpath to the prefab which will be created as a result of import.
urdfAssetsMappingprepared mapping of SDF meshes to Assets.
useArticulationsallows sdfImporter to create PhysXArticulations instead of multiple rigid bodies and joints.

Member Function Documentation

◆ CreatePrefabFromUrdfOrSdf()

CreatePrefabTemplateResult ROS2::URDFPrefabMaker::CreatePrefabFromUrdfOrSdf ( )

Create and return a prefab template corresponding to the SDF model as set through the constructor. This will also instantiate the prefab template into the level.

Returns
result which is either the prefab template id containing the imported model or an error message.

◆ CreatePrefabTemplateFromUrdfOrSdf()

CreatePrefabTemplateResult ROS2::URDFPrefabMaker::CreatePrefabTemplateFromUrdfOrSdf ( )

Create and return a prefab template id corresponding to the URDF/SDF model/world set in the constructor.

Returns
result which is either the prefab template id or an error message.

◆ GetPrefabPath()

const AZStd::string & ROS2::URDFPrefabMaker::GetPrefabPath ( ) const

Get path to the prefab resulting from the import.

Returns
path to the prefab.

◆ GetStatus()

AZStd::string ROS2::URDFPrefabMaker::GetStatus ( )

Get descriptive status of import. A string with the status, which can be understood by the user.


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