Public Member Functions | List of all members
gazebo::physics::DARTLink Class Reference

DART Link class. More...

#include <DARTLink.hh>

Inheritance diagram for gazebo::physics::DARTLink:
Inheritance graph
[legend]

Public Member Functions

 DARTLink (EntityPtr _parent)
 Constructor. More...
 
virtual ~DARTLink ()
 Destructor. More...
 
void AddDARTChildJoint (DARTJointPtr _dartChildJoint)
 Set child joint of this link. More...
 
virtual void AddForce (const math::Vector3 &_force)
 Add a force to the body. More...
 
virtual void AddForceAtRelativePosition (const math::Vector3 &_force, const math::Vector3 &_relpos)
 Add a force to the body at position expressed to the body's own frame of reference. More...
 
virtual void AddForceAtWorldPosition (const math::Vector3 &_force, const math::Vector3 &_pos)
 Add a force to the body using a global position. More...
 
virtual void AddLinkForce (const math::Vector3 &_force, const math::Vector3 &_offset=math::Vector3::Zero)
 Add a force expressed in the link frame. More...
 
virtual void AddRelativeForce (const math::Vector3 &_force)
 Add a force to the body, components are relative to the body's own frame of reference. More...
 
virtual void AddRelativeTorque (const math::Vector3 &_torque)
 Add a torque to the body, components are relative to the body's own frame of reference. More...
 
virtual void AddTorque (const math::Vector3 &_torque)
 Add a torque to the body. More...
 
virtual void Fini ()
 Finalize the entity. More...
 
dart::dynamics::BodyNode * GetDARTBodyNode () const
 Get pointer to DART BodyNode associated with this link. More...
 
DARTModelPtr GetDARTModel () const
 Get pointer to DART Model associated with this link. More...
 
DARTPhysicsPtr GetDARTPhysics (void) const
 Get pointer to DART Physics engine associated with this link. More...
 
dart::simulation::World * GetDARTWorld (void) const
 Get pointer to DART World associated with this link. More...
 
virtual bool GetEnabled () const
 Get whether this body is enabled in the physics engine. More...
 
virtual bool GetGravityMode () const
 Get the gravity mode. More...
 
virtual bool GetKinematic () const
 Implement this function. More...
 
virtual math::Vector3 GetWorldAngularVel () const
 Get the angular velocity of the entity in the world frame. More...
 
virtual math::Vector3 GetWorldCoGLinearVel () const
 Get the linear velocity at the body's center of gravity in the world frame. More...
 
virtual math::Vector3 GetWorldForce () const
 Get the force applied to the body in the world frame. More...
 
virtual math::Vector3 GetWorldLinearVel (const math::Vector3 &_offset=math::Vector3(0, 0, 0)) const
 Get the linear velocity of a point on the body in the world frame, using an offset expressed in a body-fixed frame. More...
 
virtual math::Vector3 GetWorldLinearVel (const math::Vector3 &_offset, const math::Quaternion &_q) const
 Get the linear velocity of a point on the body in the world frame, using an offset expressed in an arbitrary frame. More...
 
virtual math::Vector3 GetWorldTorque () const
 Get the torque applied to the body in the world frame. More...
 
virtual void Init ()
 Initialize the body. More...
 
virtual void Load (sdf::ElementPtr _ptr)
 Load the body based on an SDF element. More...
 
virtual void OnPoseChange ()
 This function is called when the entity's (or one of its parents) pose of the parent has changed. More...
 
virtual void SetAngularDamping (double _damping)
 Set the angular damping factor. More...
 
virtual void SetAngularVel (const math::Vector3 &_vel)
 Set the angular velocity of the body. More...
 
virtual void SetAutoDisable (bool _disable)
 Allow the link to auto disable. More...
 
void SetDARTParentJoint (DARTJointPtr _dartParentJoint)
 Set parent joint of this link. More...
 
virtual void SetEnabled (bool _enable) const
 Set whether this body is enabled. More...
 
virtual void SetForce (const math::Vector3 &_force)
 Set the force applied to the body. More...
 
virtual void SetGravityMode (bool _mode)
 Set whether gravity affects this body. More...
 
virtual void SetKinematic (const bool &_state)
 Implement this function. More...
 
virtual void SetLinearDamping (double _damping)
 Set the linear damping factor. More...
 
virtual void SetLinearVel (const math::Vector3 &_vel)
 Set the linear velocity of the body. More...
 
virtual void SetLinkStatic (bool _static)
 Freeze link to ground (inertial frame). More...
 
virtual void SetSelfCollide (bool _collide)
 Set whether this body will collide with others in the model. More...
 
virtual void SetTorque (const math::Vector3 &_torque)
 Set the torque applied to the body. More...
 
void updateDirtyPoseFromDARTTransformation ()
 Store DART Transformation to Entity::dirtyPose and add this link to World::dirtyPoses so that World::Update() trigger Entity::SetWorldPose() for this link. More...
 
- Public Member Functions inherited from gazebo::physics::Entity
 Entity (BasePtr _parent)
 Constructor. More...
 
virtual ~Entity ()
 Destructor. More...
 
CollisionPtr GetChildCollision (const std::string &_name)
 Get a child collision entity, if one exists. More...
 
LinkPtr GetChildLink (const std::string &_name)
 Get a child linke entity, if one exists. More...
 
math::Box GetCollisionBoundingBox () const
 Returns collision bounding box. More...
 
const math::PoseGetDirtyPose () const
 Returns Entity::dirtyPose. More...
 
math::Pose GetInitialRelativePose () const
 Get the initial relative pose. More...
 
void GetNearestEntityBelow (double &_distBelow, std::string &_entityName)
 Get the distance to the nearest entity below (along the Z-axis) this entity. More...
 
ModelPtr GetParentModel ()
 Get the parent model, if one exists. More...
 
math::Pose GetRelativePose () const
 Get the pose of the entity relative to its parent. More...
 
virtual const math::PoseGetWorldPose () const
 Get the absolute pose of the entity. More...
 
bool IsCanonicalLink () const
 A helper function that checks if this is a canonical body. More...
 
bool IsStatic () const
 Return whether this entity is static. More...
 
void PlaceOnEntity (const std::string &_entityName)
 Move this entity to be ontop of another entity by name. More...
 
void PlaceOnNearestEntityBelow ()
 Move this entity to be ontop of the nearest entity below. More...
 
void SetAnimation (const common::PoseAnimationPtr &_anim, boost::function< void()> _onComplete)
 Set an animation for this entity. More...
 
void SetAnimation (common::PoseAnimationPtr _anim)
 Set an animation for this entity. More...
 
void SetCanonicalLink (bool _value)
 Set to true if this entity is a canonical link for a model. More...
 
void SetInitialRelativePose (const math::Pose &_pose)
 Set the initial pose. More...
 
virtual void SetName (const std::string &_name)
 Set the name of the entity. More...
 
void SetRelativePose (const math::Pose &_pose, bool _notify=true, bool _publish=true)
 Set the pose of the entity relative to its parent. More...
 
void SetStatic (const bool &_static)
 Set whether this entity is static: immovable. More...
 
void SetWorldPose (const math::Pose &_pose, bool _notify=true, bool _publish=true)
 Set the world pose of the entity. More...
 
void SetWorldTwist (const math::Vector3 &_linear, const math::Vector3 &_angular, bool _updateChildren=true)
 Set angular and linear rates of an physics::Entity. More...
 
virtual void StopAnimation ()
 Stop the current animation, if any. More...
 
- Public Member Functions inherited from gazebo::physics::Base
 Base (BasePtr _parent)
 Constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
void AddChild (BasePtr _child)
 Add a child to this entity. More...
 
void AddType (EntityType _type)
 Add a type specifier. More...
 
BasePtr GetByName (const std::string &_name)
 Get by name. More...
 
BasePtr GetChild (unsigned int _i) const
 Get a child by index. More...
 
BasePtr GetChild (const std::string &_name)
 Get a child by name. More...
 
unsigned int GetChildCount () const
 Get the number of children. More...
 
uint32_t GetId () const
 Return the ID of this entity. More...
 
std::string GetName () const
 Return the name of the entity. More...
 
BasePtr GetParent () const
 Get the parent. More...
 
int GetParentId () const
 Return the ID of the parent. More...
 
bool GetSaveable () const
 Get whether the object should be "saved", when the user selects to save the world to xml. More...
 
std::string GetScopedName (bool _prependWorldName=false) const
 Return the name of this entity with the model scope model1::...::modelN::entityName. More...
 
virtual const sdf::ElementPtr GetSDF ()
 Get the SDF values for the object. More...
 
unsigned int GetType () const
 Get the full type definition. More...
 
const WorldPtrGetWorld () const
 Get the World this object is in. More...
 
bool HasType (const EntityType &_t) const
 Returns true if this object's type definition has the given type. More...
 
bool IsSelected () const
 True if the entity is selected by the user. More...
 
bool operator== (const Base &_ent) const
 Returns true if the entities are the same. More...
 
void Print (const std::string &_prefix)
 Print this object to screen via gzmsg. More...
 
virtual void RemoveChild (unsigned int _id)
 Remove a child from this entity. More...
 
void RemoveChild (const std::string &_name)
 Remove a child by name. More...
 
void RemoveChildren ()
 Remove all children. More...
 
virtual void Reset (Base::EntityType _resetType)
 Calls recursive Reset on one of the Base::EntityType's. More...
 
void SetParent (BasePtr _parent)
 Set the parent. More...
 
void SetSaveable (bool _v)
 Set whether the object should be "saved", when the user selects to save the world to xml. More...
 
void SetWorld (const WorldPtr &_newWorld)
 Set the world this object belongs to. More...
 
virtual void Update ()
 Update the object. More...
 

Additional Inherited Members

- Public Types inherited from gazebo::physics::Base
enum  EntityType {
  BASE = 0x00000000, ENTITY = 0x00000001, MODEL = 0x00000002, LINK = 0x00000004,
  COLLISION = 0x00000008, ACTOR = 0x00000016, LIGHT = 0x00000010, VISUAL = 0x00000020,
  JOINT = 0x00000040, BALL_JOINT = 0x00000080, HINGE2_JOINT = 0x00000100, HINGE_JOINT = 0x00000200,
  SLIDER_JOINT = 0x00000400, SCREW_JOINT = 0x00000800, UNIVERSAL_JOINT = 0x00001000, GEARBOX_JOINT = 0x00002000,
  FIXED_JOINT = 0x00004000, SHAPE = 0x00010000, BOX_SHAPE = 0x00020000, CYLINDER_SHAPE = 0x00040000,
  HEIGHTMAP_SHAPE = 0x00080000, MAP_SHAPE = 0x00100000, MULTIRAY_SHAPE = 0x00200000, RAY_SHAPE = 0x00400000,
  PLANE_SHAPE = 0x00800000, SPHERE_SHAPE = 0x01000000, MESH_SHAPE = 0x02000000, POLYLINE_SHAPE = 0x04000000,
  SENSOR_COLLISION = 0x10000000
}
 Unique identifiers for all entity types. More...
 
- Protected Member Functions inherited from gazebo::physics::Base
void ComputeScopedName ()
 Compute the scoped name of this object based on its parents. More...
 
- Protected Attributes inherited from gazebo::physics::Entity
common::PoseAnimationPtr animation
 Current pose animation. More...
 
event::ConnectionPtr animationConnection
 Connection used to update an animation. More...
 
math::Pose animationStartPose
 Start pose of an animation. More...
 
std::vector< event::ConnectionPtrconnections
 All our event connections. More...
 
math::Pose dirtyPose
 The pose set by a physics engine. More...
 
transport::NodePtr node
 Communication node. More...
 
EntityPtr parentEntity
 A helper that prevents numerous dynamic_casts. More...
 
common::Time prevAnimationTime
 Previous time an animation was updated. More...
 
transport::PublisherPtr requestPub
 Request publisher. More...
 
math::Vector3 scale
 Scale of the entity. More...
 
transport::PublisherPtr visPub
 Visual publisher. More...
 
msgs::Visual * visualMsg
 Visual message container. More...
 
math::Pose worldPose
 World pose of the entity. More...
 
- Protected Attributes inherited from gazebo::physics::Base
Base_V children
 Children of this entity. More...
 
BasePtr parent
 Parent of this entity. More...
 
sdf::ElementPtr sdf
 The SDF values for this object. More...
 
WorldPtr world
 Pointer to the world. More...
 

Detailed Description

DART Link class.

Constructor & Destructor Documentation

gazebo::physics::DARTLink::DARTLink ( EntityPtr  _parent)
explicit

Constructor.

virtual gazebo::physics::DARTLink::~DARTLink ( )
virtual

Destructor.

Member Function Documentation

void gazebo::physics::DARTLink::AddDARTChildJoint ( DARTJointPtr  _dartChildJoint)

Set child joint of this link.

Parameters
[in]_dartChildJointPointer to the child joint.
virtual void gazebo::physics::DARTLink::AddForce ( const math::Vector3 _force)
virtual

Add a force to the body.

Parameters
[in]_forceForce to add.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::AddForceAtRelativePosition ( const math::Vector3 _force,
const math::Vector3 _relPos 
)
virtual

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

Parameters
[in]_forceForce to add.
[in]_relPosPosition on the link to add the force.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::AddForceAtWorldPosition ( const math::Vector3 _force,
const math::Vector3 _pos 
)
virtual

Add a force to the body using a global position.

Parameters
[in]_forceForce to add.
[in]_posPosition in global coord frame to add the force.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::AddLinkForce ( const math::Vector3 _force,
const math::Vector3 _offset = math::Vector3::Zero 
)
virtual

Add a force expressed in the link frame.

Parameters
[in]_forceDirection vector expressed in the link frame. Each component corresponds to the force which will be added in that axis and the vector's magnitude corresponds to the total force.
[in]_offsetOffset position expressed in the link frame. It defaults to the link origin.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::AddRelativeForce ( const math::Vector3 _force)
virtual

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

Parameters
[in]_forceForce to add.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::AddRelativeTorque ( const math::Vector3 _torque)
virtual

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

Parameters
[in]_torqueTorque value to add.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::AddTorque ( const math::Vector3 _torque)
virtual

Add a torque to the body.

Parameters
[in]_torqueTorque value to add to the link.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::Fini ( )
virtual

Finalize the entity.

Reimplemented from gazebo::physics::Entity.

dart::dynamics::BodyNode* gazebo::physics::DARTLink::GetDARTBodyNode ( ) const

Get pointer to DART BodyNode associated with this link.

Returns
Pointer to DART BodyNode.
DARTModelPtr gazebo::physics::DARTLink::GetDARTModel ( ) const

Get pointer to DART Model associated with this link.

Returns
Pointer to the DART Model.
DARTPhysicsPtr gazebo::physics::DARTLink::GetDARTPhysics ( void  ) const

Get pointer to DART Physics engine associated with this link.

Returns
Pointer to the DART Physics engine.
dart::simulation::World* gazebo::physics::DARTLink::GetDARTWorld ( void  ) const

Get pointer to DART World associated with this link.

Returns
Pointer to the DART World.
virtual bool gazebo::physics::DARTLink::GetEnabled ( ) const
virtual

Get whether this body is enabled in the physics engine.

Returns
True if the link is enabled.

Implements gazebo::physics::Link.

virtual bool gazebo::physics::DARTLink::GetGravityMode ( ) const
virtual

Get the gravity mode.

Returns
True if gravity is enabled.

Implements gazebo::physics::Link.

virtual bool gazebo::physics::DARTLink::GetKinematic ( ) const
virtual

Implement this function.

Get whether this body is in the kinematic state.

Returns
True if the link is kinematic only.

Reimplemented from gazebo::physics::Link.

virtual math::Vector3 gazebo::physics::DARTLink::GetWorldAngularVel ( ) const
virtual

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

Returns
A math::Vector3 for the velocity.

Reimplemented from gazebo::physics::Entity.

virtual math::Vector3 gazebo::physics::DARTLink::GetWorldCoGLinearVel ( ) const
virtual

Get the linear velocity at the body's center of gravity in the world frame.

Returns
Linear velocity at the body's center of gravity in the world frame.

Implements gazebo::physics::Link.

virtual math::Vector3 gazebo::physics::DARTLink::GetWorldForce ( ) const
virtual

Get the force applied to the body in the world frame.

Returns
Force applied to the body in the world frame.

Implements gazebo::physics::Link.

virtual math::Vector3 gazebo::physics::DARTLink::GetWorldLinearVel ( const math::Vector3 _offset = math::Vector3(0, 0, 0)) const
virtual

Get the linear velocity of a point on the body in the world frame, using an offset expressed in a body-fixed frame.

If no offset is given, the velocity at the origin of the Link frame will be returned.

Parameters
[in]_offsetOffset of the point from the origin of the Link frame, expressed in the body-fixed frame.
Returns
Linear velocity of the point on the body

Implements gazebo::physics::Link.

virtual math::Vector3 gazebo::physics::DARTLink::GetWorldLinearVel ( const math::Vector3 _offset,
const math::Quaternion _q 
) const
virtual

Get the linear velocity of a point on the body in the world frame, using an offset expressed in an arbitrary frame.

Parameters
[in]_offsetOffset from the origin of the link frame expressed in a frame defined by _q.
[in]_qDescribes the rotation of a reference frame relative to the world reference frame.
Returns
Linear velocity of the point on the body in the world frame.

Implements gazebo::physics::Link.

virtual math::Vector3 gazebo::physics::DARTLink::GetWorldTorque ( ) const
virtual

Get the torque applied to the body in the world frame.

Returns
Torque applied to the body in the world frame.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::Init ( )
virtual

Initialize the body.

Reimplemented from gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::Load ( sdf::ElementPtr  _sdf)
virtual

Load the body based on an SDF element.

Parameters
[in]_sdfSDF parameters.

Reimplemented from gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::OnPoseChange ( )
virtual

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

Reimplemented from gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetAngularDamping ( double  _damping)
virtual

Set the angular damping factor.

Parameters
[in]_dampingAngular damping factor.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetAngularVel ( const math::Vector3 _vel)
virtual

Set the angular velocity of the body.

Parameters
[in]_velAngular velocity.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetAutoDisable ( bool  _disable)
virtual

Allow the link to auto disable.

Parameters
[in]_disableIf true, the link is allowed to auto disable.

Implements gazebo::physics::Link.

void gazebo::physics::DARTLink::SetDARTParentJoint ( DARTJointPtr  _dartParentJoint)

Set parent joint of this link.

Parameters
[in]_dartParentJointPointer to the parent joint.
virtual void gazebo::physics::DARTLink::SetEnabled ( bool  _enable) const
virtual

Set whether this body is enabled.

Parameters
[in]_enableTrue to enable the link in the physics engine.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetForce ( const math::Vector3 _force)
virtual

Set the force applied to the body.

Parameters
[in]_forceForce value.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetGravityMode ( bool  _mode)
virtual

Set whether gravity affects this body.

Parameters
[in]_modeTrue to enable gravity.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetKinematic ( const bool &  _kinematic)
virtual

Implement this function.

Set whether this body is in the kinematic state.

Parameters
[in]_kinematicTrue to make the link kinematic only.

Reimplemented from gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetLinearDamping ( double  _damping)
virtual

Set the linear damping factor.

Parameters
[in]_dampingLinear damping factor.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetLinearVel ( const math::Vector3 _vel)
virtual

Set the linear velocity of the body.

Parameters
[in]_velLinear velocity.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetLinkStatic ( bool  _static)
virtual

Freeze link to ground (inertial frame).

Parameters
[in]_staticif true, freeze link to ground. Otherwise unfreeze link.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetSelfCollide ( bool  _collide)
virtual

Set whether this body will collide with others in the model.

See Also
GetSelfCollide
Parameters
[in]_collideTrue to enable collisions.

Implements gazebo::physics::Link.

virtual void gazebo::physics::DARTLink::SetTorque ( const math::Vector3 _torque)
virtual

Set the torque applied to the body.

Parameters
[in]_torqueTorque value.

Implements gazebo::physics::Link.

void gazebo::physics::DARTLink::updateDirtyPoseFromDARTTransformation ( )

Store DART Transformation to Entity::dirtyPose and add this link to World::dirtyPoses so that World::Update() trigger Entity::SetWorldPose() for this link.


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