Public Member Functions | Protected Attributes
Link Class Reference

Link class. More...

#include <Link.hh>

Inheritance diagram for Link:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Link (EntityPtr parent)
 Constructor.
virtual ~Link ()
 Destructor.
virtual void Load (sdf::ElementPtr &_sdf)
 Load the body based on an SDF element.
virtual void Init ()
 Initialize the body.
void Fini ()
 Finalize the body.
void Reset ()
virtual void UpdateParameters (sdf::ElementPtr &_sdf)
 Update the parameters using new sdf values.
virtual void Update ()
 Update the body.
virtual void SetEnabled (bool enable) const =0
 Set whether this body is enabled.
virtual bool GetEnabled () const =0
 Get whether this body is enabled in the physics engine.
virtual bool SetSelected (bool s)
 Set whether this entity has been selected by the user through the gui.
virtual void SetGravityMode (bool mode)=0
 Set whether gravity affects this body.
virtual bool GetGravityMode ()=0
 Get the gravity mode.
virtual void SetSelfCollide (bool collide)=0
 Set whether this body will collide with others in the model.
void SetCollideMode (const std::string &m)
 Set the collide mode of the body.
bool GetSelfCollide ()
 Get Self-Collision Flag, if this is true, this body will collide with other bodies even if they share the same parent.
void SetLaserRetro (float retro)
 Set the laser retro reflectiveness.
virtual void SetLinearVel (const math::Vector3 &vel)=0
 Set the linear velocity of the body.
virtual void SetAngularVel (const math::Vector3 &vel)=0
 Set the angular velocity of the body.
void SetLinearAccel (const math::Vector3 &accel)
 Set the linear acceleration of the body.
void SetAngularAccel (const math::Vector3 &accel)
 Set the angular acceleration of the body.
virtual void SetForce (const math::Vector3 &_force)=0
 Set the force applied to the body.
virtual void SetTorque (const math::Vector3 &_force)=0
 Set the torque applied to the body.
virtual void AddForce (const math::Vector3 &_force)=0
 Add a force to the body.
virtual void AddRelativeForce (const math::Vector3 &_force)=0
 Add a force to the body, components are relative to the body's own frame of reference.
virtual void AddForceAtRelativePosition (const math::Vector3 &_force, const math::Vector3 &_relpos)=0
 Add a force to the body at position expressed to the body's own frame of reference.
virtual void AddTorque (const math::Vector3 &_torque)=0
 Add a torque to the body.
virtual void AddRelativeTorque (const math::Vector3 &_torque)=0
 Add a torque to the body, components are relative to the body's own frame of reference.
math::Vector3 GetRelativeLinearVel () const
 Get the linear velocity of the body.
math::Vector3 GetRelativeAngularVel () const
 Get the angular velocity of the body.
math::Vector3 GetRelativeLinearAccel () const
 Get the linear acceleration of the body.
math::Vector3 GetWorldLinearAccel () const
 Get the linear acceleration of the body in the world frame.
math::Vector3 GetRelativeAngularAccel () const
 Get the angular acceleration of the body.
math::Vector3 GetWorldAngularAccel () const
 Get the angular acceleration of the body in the world frame.
math::Vector3 GetRelativeForce () const
 Get the force applied to the body.
virtual math::Vector3 GetWorldForce () const =0
 Get the force applied to the body in the world frame.
math::Vector3 GetRelativeTorque () const
 Get the torque applied to the body.
virtual math::Vector3 GetWorldTorque () const =0
 Get the torque applied to the body in the world frame.
ModelPtr GetModel () const
 Get the model that this body belongs to.
InertialPtr GetInertial () const
 Get the mass of the body.
void SetInertial (const InertialPtr &_inertial)
 Set the mass of the body.
virtual void UpdateMass ()
CollisionPtr GetCollisionById (unsigned int _id) const
 Get a collision by id.
CollisionPtr GetCollision (const std::string &name)
 accessor for collisions
virtual math::Box GetBoundingBox () const
 Get the size of the body.
virtual void SetLinearDamping (double damping)=0
 Set the linear damping factor.
virtual void SetAngularDamping (double damping)=0
 Set the angular damping factor.
virtual void SetKinematic (const bool &)
 Set whether this body is in the kinematic state.
virtual bool GetKinematic () const
 Get whether this body is in the kinematic state.
unsigned int GetSensorCount () const
 Get sensor count.
std::string GetSensorName (unsigned int _i) const
 Get sensor name.
template<typename T >
event::ConnectionPtr ConnectEnabled (T subscriber)
 Connect a to the add entity signal.
void DisconnectEnabled (event::ConnectionPtr &c)
void FillLinkMsg (msgs::Link &_msg)
 Fill a link message.
void ProcessMsg (const msgs::Link &_msg)
 Update parameters from a message.
void AddChildJoint (JointPtr joint)
 Joints that have this Link as a parent Link.
void AddParentJoint (JointPtr joint)
 Joints that have this Link as a child Link.
void AttachStaticModel (ModelPtr &_model, const math::Pose &_offset)
 Attach a static model to this link.
void DetachStaticModel (const std::string &_modelName)
 Detach a static model from this link.
virtual void OnPoseChange ()
 This function is called when the entity's (or one of its parents) pose of the parent has changed.

Protected Attributes

bool isStatic
InertialPtr inertial
std::vector< std::string > cgVisuals
std::vector< std::string > visuals
math::Vector3 linearAccel
math::Vector3 angularAccel
math::Pose newPose
std::vector< math::PoseattachedModelsOffset

Detailed Description

Link class.


Member Function Documentation

virtual void AddForceAtRelativePosition ( const math::Vector3 _force,
const math::Vector3 _relpos 
) [pure virtual]

Add a force to the body at position expressed to the body's own frame of reference.

Implemented in ODELink.

virtual void AddRelativeForce ( const math::Vector3 _force) [pure virtual]

Add a force to the body, components are relative to the body's own frame of reference.

Implemented in ODELink.

virtual void AddRelativeTorque ( const math::Vector3 _torque) [pure virtual]

Add a torque to the body, components are relative to the body's own frame of reference.

Implemented in ODELink.

void FillLinkMsg ( msgs::Link &  _msg)

Fill a link message.

Parameters:
_msgMessage to fill
CollisionPtr GetCollisionById ( unsigned int  _id) const

Get a collision by id.

Returns:
Pointer to the collision
bool GetSelfCollide ( )

Get Self-Collision Flag, if this is true, this body will collide with other bodies even if they share the same parent.

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

Load the body based on an SDF element.

Parameters:
_sdfSDF parameters

Reimplemented from Entity.

Reimplemented in ODELink.

void ProcessMsg ( const msgs::Link &  _msg)

Update parameters from a message.

Parameters:
_msgMessage to read

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