Ignition Gazebo

API Reference

3.0.0

This class provides wrappers around entities and components which are more convenient and straight-forward to use than dealing with the EntityComponentManager directly. All the functions provided here are meant to be used with a model entity. More...

#include <ignition/gazebo/Model.hh>

Public Member Functions

 Model (gazebo::Entity _entity=kNullEntity)
 Constructor. More...
 
 Model (const Model &_model)
 Copy constructor. More...
 
 Model (Model &&_model) noexcept
 Move constructor. More...
 
virtual ~Model ()
 Destructor. More...
 
gazebo::Entity Entity () const
 Get the entity which this Model is related to. More...
 
gazebo::Entity JointByName (const EntityComponentManager &_ecm, const std::string &_name)
 Get the ID of a joint entity which is an immediate child of this model. More...
 
gazebo::Entity LinkByName (const EntityComponentManager &_ecm, const std::string &_name)
 Get the ID of a link entity which is an immediate child of this model. More...
 
std::string Name (const EntityComponentManager &_ecm) const
 Get the model's unscoped name. More...
 
Modeloperator= (Model &&_model) noexcept
 Move assignment operator. More...
 
Modeloperator= (const Model &_model)
 Copy assignment operator. More...
 
bool Valid (const EntityComponentManager &_ecm) const
 Check whether this model correctly refers to an entity that has a components::Model. More...
 

Detailed Description

This class provides wrappers around entities and components which are more convenient and straight-forward to use than dealing with the EntityComponentManager directly. All the functions provided here are meant to be used with a model entity.

For example, given a model's entity, to find the value of its name component, one could use the entity-component manager (ecm) directly as follows:

std::string name = ecm.Component<components::Name>(entity)->Data();

Using this class however, the same information can be obtained with a simpler function call:

Model model(entity); std::string name = model.Name(ecm);

Todo:
(louise) Store the ecm instead of passing it at every API call.

Constructor & Destructor Documentation

◆ Model() [1/3]

Model ( gazebo::Entity  _entity = kNullEntity)
explicit

Constructor.

Parameters
[in]_entityModel entity

◆ Model() [2/3]

Model ( const Model _model)

Copy constructor.

Parameters
[in]_modelModel to copy.

◆ Model() [3/3]

Model ( Model &&  _model)
noexcept

Move constructor.

Parameters
[in]_modelModel to move.

◆ ~Model()

virtual ~Model ( )
virtual

Destructor.

Member Function Documentation

◆ Entity()

Get the entity which this Model is related to.

Returns
Model entity.

◆ JointByName()

gazebo::Entity JointByName ( const EntityComponentManager _ecm,
const std::string _name 
)

Get the ID of a joint entity which is an immediate child of this model.

Parameters
[in]_ecmEntity-component manager.
[in]_nameJoint name.
Returns
Joint entity.

◆ LinkByName()

gazebo::Entity LinkByName ( const EntityComponentManager _ecm,
const std::string _name 
)

Get the ID of a link entity which is an immediate child of this model.

Parameters
[in]_ecmEntity-component manager.
[in]_nameLink name.
Returns
Link entity.

◆ Name()

std::string Name ( const EntityComponentManager _ecm) const

Get the model's unscoped name.

Parameters
[in]_ecmEntity-component manager.
Returns
Model's name.

◆ operator=() [1/2]

Model& operator= ( Model &&  _model)
noexcept

Move assignment operator.

Parameters
[in]_modelModel component to move.
Returns
Reference to this.

◆ operator=() [2/2]

Model& operator= ( const Model _model)

Copy assignment operator.

Parameters
[in]_modelModel to copy.
Returns
Reference to this.

◆ Valid()

bool Valid ( const EntityComponentManager _ecm) const

Check whether this model correctly refers to an entity that has a components::Model.

Parameters
[in]_ecmEntity-component manager.
Returns
True if it's a valid model in the manager.

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