All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
gazebo::physics::SimbodyLink Class Reference

Simbody Link class. More...

#include <SimbodyLink.hh>

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

Public Member Functions

 SimbodyLink (EntityPtr _parent)
 Constructor. More...
 
virtual ~SimbodyLink ()
 Destructor. 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 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 body. More...
 
SimTK::MassProperties GetEffectiveMassProps (int _numFragments) const
 
virtual bool GetEnabled () const
 Get whether this body is enabled in the physics engine. More...
 
virtual bool GetGravityMode () const
 Get the gravity mode. More...
 
SimTK::MassProperties GetMassProperties () const
 Convert Gazebo Inertia to Simbody MassProperties Where Simbody MassProperties contains mass, center of mass location, and unit inertia about body origin. 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 &_vector3) 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 RestoreSimbodyState (SimTK::State &_state)
 
virtual void SaveSimbodyState (const SimTK::State &_state)
 
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 SetDirtyPose (const math::Pose &_pose)
 
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 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)
 If the inboard body of this link is ground, simply lock the inboard joint to freeze it to ground. More...
 
virtual void SetSelfCollide (bool _collide)
 Set whether this body will collide with others in the model. More...
 
virtual void SetTorque (const math::Vector3 &_force)
 Set the torque applied to the body. 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...
 
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 () const
 Return the name of this entity with the model scope world::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...
 

Public Attributes

SimTK::MobilizedBody masterMobod
 
bool mustBeBaseLink
 : Force this link to be a base body, where its inboard body is the world with 6DOF. More...
 
bool physicsInitialized
 
std::vector< SimTK::MobilizedBody > slaveMobods
 
std::vector
< SimTK::Constraint::Weld > 
slaveWelds
 

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,
  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, 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...
 

Detailed Description

Simbody Link class.

Constructor & Destructor Documentation

gazebo::physics::SimbodyLink::SimbodyLink ( EntityPtr  _parent)

Constructor.

virtual gazebo::physics::SimbodyLink::~SimbodyLink ( )
virtual

Destructor.

Member Function Documentation

virtual void gazebo::physics::SimbodyLink::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::SimbodyLink::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::SimbodyLink::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::SimbodyLink::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::SimbodyLink::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::SimbodyLink::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::SimbodyLink::Fini ( )
virtual

Finalize the body.

Reimplemented from gazebo::physics::Link.

SimTK::MassProperties gazebo::physics::SimbodyLink::GetEffectiveMassProps ( int  _numFragments) const
virtual bool gazebo::physics::SimbodyLink::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::SimbodyLink::GetGravityMode ( ) const
virtual

Get the gravity mode.

Returns
True if gravity is enabled.

Implements gazebo::physics::Link.

SimTK::MassProperties gazebo::physics::SimbodyLink::GetMassProperties ( ) const

Convert Gazebo Inertia to Simbody MassProperties Where Simbody MassProperties contains mass, center of mass location, and unit inertia about body origin.

virtual math::Vector3 gazebo::physics::SimbodyLink::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::SimbodyLink::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::SimbodyLink::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::SimbodyLink::GetWorldLinearVel ( const math::Vector3 _offset) 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::SimbodyLink::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::SimbodyLink::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::SimbodyLink::Init ( )
virtual

Initialize the body.

Reimplemented from gazebo::physics::Link.

virtual void gazebo::physics::SimbodyLink::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::SimbodyLink::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::SimbodyLink::RestoreSimbodyState ( SimTK::State &  _state)
virtual
virtual void gazebo::physics::SimbodyLink::SaveSimbodyState ( const SimTK::State &  _state)
virtual
virtual void gazebo::physics::SimbodyLink::SetAngularDamping ( double  _damping)
virtual

Set the angular damping factor.

Parameters
[in]_dampingAngular damping factor.

Implements gazebo::physics::Link.

virtual void gazebo::physics::SimbodyLink::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::SimbodyLink::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::SimbodyLink::SetDirtyPose ( const math::Pose _pose)
virtual void gazebo::physics::SimbodyLink::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::SimbodyLink::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::SimbodyLink::SetGravityMode ( bool  _mode)
virtual

Set whether gravity affects this body.

Parameters
[in]_modeTrue to enable gravity.

Implements gazebo::physics::Link.

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

Set the linear damping factor.

Parameters
[in]_dampingLinear damping factor.

Implements gazebo::physics::Link.

virtual void gazebo::physics::SimbodyLink::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::SimbodyLink::SetLinkStatic ( bool  _static)
virtual

If the inboard body of this link is ground, simply lock the inboard joint to freeze it to ground.

Otherwise, add a weld constraint to simulate freeze to ground effect.

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

Implements gazebo::physics::Link.

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

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

Parameters
[in]_collidTrue to enable collisions.

Implements gazebo::physics::Link.

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

Set the torque applied to the body.

Parameters
[in]_torqueTorque value.

Implements gazebo::physics::Link.

Member Data Documentation

SimTK::MobilizedBody gazebo::physics::SimbodyLink::masterMobod
bool gazebo::physics::SimbodyLink::mustBeBaseLink

: Force this link to be a base body, where its inboard body is the world with 6DOF.

bool gazebo::physics::SimbodyLink::physicsInitialized
std::vector<SimTK::MobilizedBody> gazebo::physics::SimbodyLink::slaveMobods
std::vector<SimTK::Constraint::Weld> gazebo::physics::SimbodyLink::slaveWelds

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