Public Member Functions | Protected Member Functions | Protected Attributes
Model Class Reference

A model. More...

#include <Model.hh>

Inheritance diagram for Model:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Model (BasePtr parent)
 Constructor.
virtual ~Model ()
 Destructor.
void Load (sdf::ElementPtr &_sdf)
 Load the model.
virtual void Init ()
 Initialize the model.
void Update ()
 Update the model.
virtual void Fini ()
 Finalize the model.
virtual void UpdateParameters (sdf::ElementPtr &_sdf)
 update the parameters using new sdf values
virtual const sdf::ElementPtr & GetSDF ()
 Get the SDF values for the model.
virtual void RemoveChild (EntityPtr child)
 Remove a child.
void Reset ()
 Reset the model.
void SetLinearVel (const math::Vector3 &vel)
 Set the linear velocity of the model.
void SetAngularVel (const math::Vector3 &vel)
 Set the angular velocity of the model.
void SetLinearAccel (const math::Vector3 &vel)
 Set the linear acceleration of the model.
void SetAngularAccel (const math::Vector3 &vel)
 Set the angular acceleration of the model.
virtual math::Vector3 GetRelativeLinearVel () const
 Get the linear velocity of the entity.
virtual math::Vector3 GetWorldLinearVel () const
 Get the linear velocity of the entity in the world frame.
virtual math::Vector3 GetRelativeAngularVel () const
 Get the angular velocity of the entity.
virtual math::Vector3 GetWorldAngularVel () const
 Get the angular velocity of the entity in the world frame.
virtual math::Vector3 GetRelativeLinearAccel () const
 Get the linear acceleration of the entity.
virtual math::Vector3 GetWorldLinearAccel () const
 Get the linear acceleration of the entity in the world frame.
virtual math::Vector3 GetRelativeAngularAccel () const
 Get the angular acceleration of the entity.
virtual math::Vector3 GetWorldAngularAccel () const
 Get the angular acceleration of the entity in the world frame.
virtual math::Box GetBoundingBox () const
 Get the size of the bounding box.
unsigned int GetJointCount () const
 Get the number of joints.
JointPtr GetJoint (unsigned int index) const
 Get a joing by index.
JointPtr GetJoint (const std::string &name)
 Get a joint.
LinkPtr GetLinkById (unsigned int _id) const
 Get a link by id.
LinkPtr GetLink (const std::string &name="canonical") const
 Get a link by name.
void SetGravityMode (const bool &v)
 Set the gravity mode of the model.
void SetCollideMode (const std::string &m)
 Set the collide mode of the model.
void SetLaserRetro (const float &retro)
 Set the laser retro reflectiveness of the model.
void FillModelMsg (msgs::Model &_msg)
 Fill a model message.
void ProcessMsg (const msgs::Model &_msg)
 Update parameters from a model message.
void SetJointPositions (const std::map< std::string, double > &_jointPositions)
 Set the positions of a set of joints.
void SetJointAnimation (const std::map< std::string, common::NumericAnimationPtr > anim, boost::function< void()> _onComplete)
void AttachStaticModel (ModelPtr &_model, math::Pose _offset)
 Attach a static model to this model.
void DetachStaticModel (const std::string &_model)

Protected Member Functions

virtual void OnPoseChange ()
 This function is called when the entity's (or one of its parents) pose of the parent has changed.

Protected Attributes

std::vector< ModelPtr > attachedModels
std::vector< math::PoseattachedModelsOffset

Detailed Description

A model.


Constructor & Destructor Documentation

Model ( BasePtr  parent)

Constructor.

Parameters:
parentParent object

Member Function Documentation

void FillModelMsg ( msgs::Model &  _msg)

Fill a model message.

Parameters:
_msgMessage to fill
virtual math::Box GetBoundingBox ( ) const [virtual]

Get the size of the bounding box.

Returns:
The bounding box

Reimplemented from Entity.

JointPtr GetJoint ( unsigned int  index) const

Get a joing by index.

Parameters:
indexIndex of the joint
Returns:
A pointer to the joint
JointPtr GetJoint ( const std::string &  name)

Get a joint.

Parameters:
nameThe name of the joint, specified in the world file
Returns:
Pointer to the joint
unsigned int GetJointCount ( ) const

Get the number of joints.

Returns:
Get the number of joints
LinkPtr GetLink ( const std::string &  name = "canonical") const

Get a link by name.

Returns:
Pointer to the link
LinkPtr GetLinkById ( unsigned int  _id) const

Get a link by id.

Returns:
Pointer to the link
virtual math::Vector3 GetRelativeAngularAccel ( ) const [virtual]

Get the angular acceleration of the entity.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

virtual math::Vector3 GetRelativeAngularVel ( ) const [virtual]

Get the angular velocity of the entity.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

virtual math::Vector3 GetRelativeLinearAccel ( ) const [virtual]

Get the linear acceleration of the entity.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

virtual math::Vector3 GetRelativeLinearVel ( ) const [virtual]

Get the linear velocity of the entity.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

virtual math::Vector3 GetWorldAngularAccel ( ) const [virtual]

Get the angular acceleration of the entity in the world frame.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

virtual math::Vector3 GetWorldAngularVel ( ) const [virtual]

Get the angular velocity of the entity in the world frame.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

virtual math::Vector3 GetWorldLinearAccel ( ) const [virtual]

Get the linear acceleration of the entity in the world frame.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

virtual math::Vector3 GetWorldLinearVel ( ) const [virtual]

Get the linear velocity of the entity in the world frame.

Returns:
math::Vector3, set to 0,0,0 if the model has no body

Reimplemented from Entity.

void Load ( sdf::ElementPtr &  _sdf) [virtual]

Load the model.

Parameters:
_sdfSDF parameters

Reimplemented from Entity.

virtual void RemoveChild ( EntityPtr  child) [virtual]

Remove a child.

Parameters:
childRemove a child entity
void SetAngularAccel ( const math::Vector3 vel)

Set the angular acceleration of the model.

Parameters:
velThe new angular acceleration
void SetAngularVel ( const math::Vector3 vel)

Set the angular velocity of the model.

Parameters:
velThe new angular velocity
void SetCollideMode ( const std::string &  m)

Set the collide mode of the model.

Parameters:
mThe collision mode
void SetLaserRetro ( const float &  retro)

Set the laser retro reflectiveness of the model.

Parameters:
retroRetro reflectance value
void SetLinearAccel ( const math::Vector3 vel)

Set the linear acceleration of the model.

Parameters:
velThe new linear acceleration
void SetLinearVel ( const math::Vector3 vel)

Set the linear velocity of the model.

Parameters:
velThe new linear velocity

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