Joint Class Referenceabstract

Base class for all joints. More...

#include <physics/physics.hh>

Inherits Base.

Inherited by BulletJoint, DARTJoint, ODEJoint, and SimbodyJoint.

Public Types

enum  Attribute {
  FUDGE_FACTOR, SUSPENSION_ERP, SUSPENSION_CFM, STOP_ERP,
  STOP_CFM, ERP, CFM, FMAX,
  VEL, HI_STOP, LO_STOP
}
 Joint attribute types. More...
 
enum  EntityType {
  BASE = 0x00000000, ENTITY = 0x00000001, MODEL = 0x00000002, LINK = 0x00000004,
  COLLISION = 0x00000008, 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,
  ACTOR = 0x00008000, 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...
 

Public Member Functions

 Joint (BasePtr _parent)
 Constructor. More...
 
virtual ~Joint ()
 Destructor. More...
 
void AddChild (BasePtr _child)
 Add a child to this entity. More...
 
void AddType (EntityType _type)
 Add a type specifier. More...
 
virtual ignition::math::Vector3d Anchor (const unsigned int _index) const =0
 Get the anchor point. More...
 
ignition::math::Pose3d AnchorErrorPose () const
 Get pose offset between anchor pose on child and parent, expressed in the parent link frame. More...
 
virtual void ApplyStiffnessDamping ()
 Callback to apply spring stiffness and viscous damping effects to joint. More...
 
virtual bool AreConnected (LinkPtr _one, LinkPtr _two) const =0
 Determines of the two bodies are connected by a joint. More...
 
virtual void Attach (LinkPtr _parent, LinkPtr _child)
 Attach the two bodies with this joint. More...
 
ignition::math::Quaterniond AxisFrame (const unsigned int _index) const
 Get orientation of reference frame for specified axis, relative to world frame. More...
 
ignition::math::Quaterniond AxisFrameOffset (const unsigned int _index) const
 Get orientation of joint axis reference frame relative to joint frame. More...
 
virtual void CacheForceTorque ()
 Cache Joint Force Torque Values if necessary for physics engine. More...
 
double CheckAndTruncateForce (unsigned int _index, double _effort)
 check if the force against velocityLimit and effortLimit, truncate if necessary. More...
 
template<typename T >
event::ConnectionPtr ConnectJointUpdate (T _subscriber)
 Connect a boost::slot the the joint update signal. More...
 
virtual void Detach ()
 Detach this joint from all links. More...
 
void DisconnectJointUpdate (event::ConnectionPtr &_conn) GAZEBO_DEPRECATED(8.0)
 Disconnect a boost::slot the the joint update signal. More...
 
virtual unsigned int DOF () const =0
 Get the number of degrees of freedom for this joint. More...
 
virtual void FillMsg (msgs::Joint &_msg)
 Fill a joint message. More...
 
virtual void Fini ()
 Finialize the object. More...
 
virtual math::Vector3 GetAnchor (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get the anchor point. More...
 
math::Pose GetAnchorErrorPose () const GAZEBO_DEPRECATED(8.0)
 Get pose offset between anchor pose on child and parent, expressed in the parent link frame. More...
 
math::Angle GetAngle (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get the angle of rotation of an axis(index). More...
 
virtual unsigned int GetAngleCount () const GAZEBO_DEPRECATED(8.0)
 Get the angle count. More...
 
math::Quaternion GetAxisFrame (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get orientation of reference frame for specified axis, relative to world frame. More...
 
math::Quaternion GetAxisFrameOffset (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get orientation of joint axis reference frame relative to joint frame. 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...
 
LinkPtr GetChild () const
 Get the child link. More...
 
unsigned int GetChildCount () const
 Get the number of children. More...
 
double GetDamping (unsigned int _index)
 Returns the current joint damping coefficient. More...
 
virtual double GetEffortLimit (unsigned int _index)
 Get the effort limit on axis(index). More...
 
virtual double GetForce (unsigned int _index)
 
virtual JointWrench GetForceTorque (unsigned int _index)=0
 get internal force and torque values at a joint. More...
 
virtual math::Vector3 GetGlobalAxis (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get the axis of rotation in global cooridnate frame. More...
 
virtual math::Angle GetHighStop (unsigned int _index) GAZEBO_DEPRECATED(8.0)
 Get the high stop of an axis(index). More...
 
uint32_t GetId () const
 Return the ID of this entity. More...
 
double GetInertiaRatio (const unsigned int _index) const
 Computes moment of inertia (MOI) across a specified joint axis. More...
 
double GetInertiaRatio (const math::Vector3 &_axis) const GAZEBO_DEPRECATED(8.0)
 Computes moment of inertia (MOI) across an arbitrary axis specified in the world frame. More...
 
math::Pose GetInitialAnchorPose () const GAZEBO_DEPRECATED(8.0)
 Get initial Anchor Pose specified by model <joint><pose>...</pose></joint> More...
 
virtual LinkPtr GetJointLink (unsigned int _index) const =0
 Get the link to which the joint is attached according the _index. More...
 
virtual math::Vector3 GetLinkForce (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get the forces applied to the center of mass of a physics::Link due to the existence of this Joint. More...
 
virtual math::Vector3 GetLinkTorque (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get the torque applied to the center of mass of a physics::Link due to the existence of this Joint. More...
 
math::Vector3 GetLocalAxis (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get the axis of rotation. More...
 
math::Angle GetLowerLimit (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 : get the joint lower limit (replaces GetLowStop and GetHighStop) More...
 
virtual math::Angle GetLowStop (unsigned int _index) GAZEBO_DEPRECATED(8.0)
 Get the low stop of an axis(index). More...
 
msgs::Joint::Type GetMsgType () const
 Get the joint type as msgs::Joint::Type. More...
 
std::string GetName () const
 Return the name of the entity. More...
 
virtual double GetParam (const std::string &_key, unsigned int _index)
 Get a non-generic parameter for the joint. More...
 
LinkPtr GetParent () const
 Get the parent link. More...
 
int GetParentId () const
 Return the ID of the parent. More...
 
math::Pose GetParentWorldPose () const GAZEBO_DEPRECATED(8.0)
 Get anchor pose on parent link relative to world frame. 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...
 
double GetSpringReferencePosition (unsigned int _index) const
 Get joint spring reference position. More...
 
double GetStiffness (unsigned int _index)
 Returns the current joint spring stiffness coefficient. More...
 
double GetStopDissipation (unsigned int _index) const
 Get joint stop dissipation. More...
 
double GetStopStiffness (unsigned int _index) const
 Get joint stop stiffness. More...
 
unsigned int GetType () const
 Get the full type definition. More...
 
math::Angle GetUpperLimit (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 : get the joint upper limit (replacee GetLowStop and GetHighStop) More...
 
virtual double GetVelocity (unsigned int _index) const =0
 Get the rotation rate of an axis(index) More...
 
virtual double GetVelocityLimit (unsigned int _index)
 Get the velocity limit on axis(index). More...
 
const WorldPtrGetWorld () const
 Get the World this object is in. More...
 
double GetWorldEnergyPotentialSpring (unsigned int _index) const
 Returns this joint's spring potential energy, based on the reference position of the spring. More...
 
math::Pose GetWorldPose () const GAZEBO_DEPRECATED(8.0)
 Get pose of joint frame relative to world frame. More...
 
virtual ignition::math::Vector3d GlobalAxis (unsigned int _index) const =0
 Get the axis of rotation in global cooridnate frame. More...
 
bool HasType (const EntityType &_t) const
 Returns true if this object's type definition has the given type. More...
 
double InertiaRatio (const ignition::math::Vector3d &_axis) const
 Computes moment of inertia (MOI) across an arbitrary axis specified in the world frame. More...
 
virtual void Init ()
 Initialize a joint. More...
 
ignition::math::Pose3d InitialAnchorPose () const
 Get initial Anchor Pose specified by model <joint><pose>...</pose></joint> More...
 
bool IsSelected () const
 True if the entity is selected by the user. More...
 
virtual ignition::math::Vector3d LinkForce (const unsigned int _index) const =0
 Get the forces applied to the center of mass of a physics::Link due to the existence of this Joint. More...
 
virtual ignition::math::Vector3d LinkTorque (const unsigned int _index) const =0
 Get the torque applied to the center of mass of a physics::Link due to the existence of this Joint. More...
 
void Load (LinkPtr _parent, LinkPtr _child, const math::Pose &_pose) GAZEBO_DEPRECATED(8.0)
 Set pose, parent and child links of a physics::Joint. More...
 
void Load (LinkPtr _parent, LinkPtr _child, const ignition::math::Pose3d &_pose)
 Set pose, parent and child links of a physics::Joint. More...
 
virtual void Load (sdf::ElementPtr _sdf)
 Load physics::Joint from a SDF sdf::Element. More...
 
ignition::math::Vector3d LocalAxis (const unsigned int _index) const
 Get the axis of rotation. More...
 
virtual double LowerLimit (unsigned int _index=0) const
 Get the joint's lower limit. More...
 
bool operator== (const Base &_ent) const
 Returns true if the entities are the same. More...
 
ignition::math::Pose3d ParentWorldPose () const
 Get anchor pose on parent link relative to world frame. More...
 
virtual double Position (const unsigned int _index=0) const final
 Get the position of an axis according to its index. 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 RemoveChild (physics::BasePtr _child)
 Remove a child by pointer. More...
 
void RemoveChildren ()
 Remove all children. More...
 
virtual void Reset ()
 Reset the joint. More...
 
virtual void Reset (Base::EntityType _resetType)
 Calls recursive Reset on one of the Base::EntityType's. More...
 
virtual void SetAnchor (unsigned int _index, const math::Vector3 &_anchor) GAZEBO_DEPRECATED(8.0)
 Set the anchor point. More...
 
virtual void SetAnchor (const unsigned int _index, const ignition::math::Vector3d &_anchor)=0
 Set the anchor point. More...
 
virtual void SetAxis (unsigned int _index, const math::Vector3 &_axis) GAZEBO_DEPRECATED(8.0)
 Set the axis of rotation where axis is specified in local joint frame. More...
 
virtual void SetAxis (const unsigned int _index, const ignition::math::Vector3d &_axis)=0
 Set the axis of rotation where axis is specified in local joint frame. More...
 
virtual void SetDamping (unsigned int _index, double _damping)=0
 Set the joint damping. More...
 
virtual void SetEffortLimit (unsigned int _index, double _effort)
 Set the effort limit on a joint axis. More...
 
virtual void SetForce (unsigned int _index, double _effort)=0
 Set the force applied to this physics::Joint. More...
 
virtual bool SetHighStop (unsigned int _index, const math::Angle &_angle) GAZEBO_DEPRECATED(8.0)
 Set the high stop of an axis(index). More...
 
void SetLowerLimit (unsigned int _index, math::Angle _limit) GAZEBO_DEPRECATED(8.0)
 : set the joint lower limit (replaces SetLowStop and SetHighStop) More...
 
virtual void SetLowerLimit (const unsigned int _index, const double _limit)
 Set the joint's lower limit. More...
 
virtual bool SetLowStop (unsigned int _index, const math::Angle &_angle) GAZEBO_DEPRECATED(8.0)
 Set the low stop of an axis(index). More...
 
void SetModel (ModelPtr _model)
 Set the model this joint belongs too. More...
 
virtual void SetName (const std::string &_name)
 Set the name of the entity. More...
 
virtual bool SetParam (const std::string &_key, unsigned int _index, const boost::any &_value)=0
 Set a non-generic parameter for the joint. More...
 
void SetParent (BasePtr _parent)
 Set the parent. More...
 
virtual bool SetPosition (unsigned int _index, double _position)
 The child links of this joint are updated based on desired position. More...
 
virtual void SetProvideFeedback (bool _enable)
 Set whether the joint should generate feedback. More...
 
void SetSaveable (bool _v)
 Set whether the object should be "saved", when the user selects to save the world to xml. More...
 
virtual bool SetSelected (bool _show)
 Set whether this entity has been selected by the user through the gui. More...
 
void SetState (const JointState &_state)
 Set the joint state. More...
 
virtual void SetStiffness (unsigned int _index, const double _stiffness)=0
 Set the joint spring stiffness. More...
 
virtual void SetStiffnessDamping (unsigned int _index, double _stiffness, double _damping, double _reference=0)=0
 Set the joint spring stiffness. More...
 
void SetStopDissipation (unsigned int _index, double _dissipation)
 Set joint stop dissipation. More...
 
void SetStopStiffness (unsigned int _index, double _stiffness)
 Set joint stop stiffness. More...
 
void SetUpperLimit (unsigned int _index, math::Angle _limit) GAZEBO_DEPRECATED(8.0)
 : set the joint upper limit (replacee GetLowStop and GetHighStop) More...
 
virtual void SetUpperLimit (const unsigned int _index, const double _limit)
 Set the joint's upper limit. More...
 
virtual void SetVelocity (unsigned int _index, double _vel)=0
 Set the velocity of an axis(index). More...
 
virtual void SetVelocityLimit (unsigned int _index, double _velocity)
 Set the velocity limit on a joint axis. More...
 
void SetWorld (const WorldPtr &_newWorld)
 Set the world this object belongs to. More...
 
std::string TypeStr () const
 Get the string name for the entity type. More...
 
void Update ()
 Update the joint. More...
 
virtual void UpdateParameters (sdf::ElementPtr _sdf)
 Update the parameters using new sdf values. More...
 
virtual double UpperLimit (const unsigned int _index=0) const
 Get the joint's upper limit. More...
 
common::URI URI () const
 Return the common::URI of this entity. More...
 
ignition::math::Pose3d WorldPose () const
 Get pose of joint frame relative to world frame. More...
 

Protected Member Functions

ignition::math::Pose3d ChildLinkPose (const unsigned int _index, const double _position)
 internal function to help us compute child link pose if a joint position change is applied. More...
 
math::Pose ComputeChildLinkPose (unsigned int _index, double _position) GAZEBO_DEPRECATED(8.0)
 internal function to help us compute child link pose if a joint position change is applied. More...
 
void ComputeScopedName ()
 Compute the scoped name of this object based on its parents. More...
 
bool FindAllConnectedLinks (const LinkPtr &_originalParentLink, Link_V &_connectedLinks)
 internal helper to find all links connected to the child link branching out from the children of the child link and any parent of the child link other than the parent link through this joint. More...
 
virtual math::Angle GetAngleImpl (unsigned int _index) const GAZEBO_DEPRECATED(8.0)
 Get the angle of an axis helper function. More...
 
virtual double PositionImpl (const unsigned int _index=0) const =0
 Helper function to get the position of an axis. More...
 
virtual void RegisterIntrospectionItems ()
 Register items in the introspection service. More...
 
bool SetPositionMaximal (unsigned int _index, double _position)
 Helper function for maximal coordinate solver SetPosition. More...
 
bool SetVelocityMaximal (unsigned int _index, double _velocity)
 Helper function for maximal coordinate solver SetVelocity. More...
 
virtual void UnregisterIntrospectionItems ()
 Unregister items in the introspection service. More...
 

Protected Attributes

LinkPtr anchorLink
 Anchor link. More...
 
ignition::math::Vector3d anchorPos
 Anchor pose. More...
 
ignition::math::Pose3d anchorPose
 Anchor pose specified in SDF <joint><pose> tag. More...
 
gazebo::event::ConnectionPtr applyDamping
 apply damping for adding viscous damping forces on updates More...
 
bool axisParentModelFrame [2]
 Flags that are set to true if an axis value is expressed in the parent model frame. More...
 
LinkPtr childLink
 The first link this joint connects to. More...
 
Base_V children
 Children of this entity. More...
 
double dissipationCoefficient [2]
 joint viscous damping coefficient More...
 
double effortLimit [2]
 Store Joint effort limit as specified in SDF. More...
 
std::vector< common::URIintrospectionItems
 All the introspection items regsitered for this. More...
 
double lowerLimit [2]
 Store Joint position lower limit as specified in SDF. More...
 
ModelPtr model
 Pointer to the parent model. More...
 
BasePtr parent
 Parent of this entity. More...
 
ignition::math::Pose3d parentAnchorPose
 Anchor pose relative to parent link frame. More...
 
LinkPtr parentLink
 The second link this joint connects to. More...
 
bool provideFeedback
 Provide Feedback data for contact forces. More...
 
sdf::ElementPtr sdf
 The SDF values for this object. More...
 
double springReferencePosition [2]
 joint spring reference (zero load) position More...
 
double stiffnessCoefficient [2]
 joint stiffnessCoefficient More...
 
double upperLimit [2]
 Store Joint position upper limit as specified in SDF. More...
 
double velocityLimit [2]
 Store Joint velocity limit as specified in SDF. More...
 
WorldPtr world
 Pointer to the world. More...
 
JointWrench wrench
 Cache Joint force torque values in case physics engine clears them at the end of update step. More...
 

Detailed Description

Base class for all joints.

Member Enumeration Documentation

enum Attribute

Joint attribute types.

Enumerator
FUDGE_FACTOR 

Fudge factor.

SUSPENSION_ERP 

Suspension error reduction parameter.

SUSPENSION_CFM 

Suspension constraint force mixing.

STOP_ERP 

Stop limit error reduction parameter.

STOP_CFM 

Stop limit constraint force mixing.

ERP 

Error reduction parameter.

CFM 

Constraint force mixing.

FMAX 

Maximum force.

VEL 

Velocity.

HI_STOP 

Upper joint limit.

LO_STOP 

Lower joint limit.

enum EntityType
inherited

Unique identifiers for all entity types.

Enumerator
BASE 

Base type.

ENTITY 

Entity type.

MODEL 

Model type.

LINK 

Link type.

COLLISION 

Collision type.

LIGHT 

Light type.

VISUAL 

Visual type.

JOINT 

Joint type.

BALL_JOINT 

BallJoint type.

HINGE2_JOINT 

Hing2Joint type.

HINGE_JOINT 

HingeJoint type.

SLIDER_JOINT 

SliderJoint type.

SCREW_JOINT 

ScrewJoint type.

UNIVERSAL_JOINT 

UniversalJoint type.

GEARBOX_JOINT 

GearboxJoint type.

FIXED_JOINT 

FixedJoint type.

ACTOR 

Actor type.

SHAPE 

Shape type.

BOX_SHAPE 

BoxShape type.

CYLINDER_SHAPE 

CylinderShape type.

HEIGHTMAP_SHAPE 

HeightmapShape type.

MAP_SHAPE 

MapShape type.

MULTIRAY_SHAPE 

MultiRayShape type.

RAY_SHAPE 

RayShape type.

PLANE_SHAPE 

PlaneShape type.

SPHERE_SHAPE 

SphereShape type.

MESH_SHAPE 

MeshShape type.

POLYLINE_SHAPE 

PolylineShape type.

SENSOR_COLLISION 

Indicates a collision shape used for sensing.

Constructor & Destructor Documentation

Joint ( BasePtr  _parent)
explicit

Constructor.

Parameters
[in]Jointparent
virtual ~Joint ( )
virtual

Destructor.

Member Function Documentation

void AddChild ( BasePtr  _child)
inherited

Add a child to this entity.

Parameters
[in]_childChild entity.

Referenced by Base::Update().

void AddType ( EntityType  _type)
inherited

Add a type specifier.

Parameters
[in]_typeNew type to append to this objects type definition.

Referenced by Base::Update().

virtual ignition::math::Vector3d Anchor ( const unsigned int  _index) const
pure virtual
ignition::math::Pose3d AnchorErrorPose ( ) const

Get pose offset between anchor pose on child and parent, expressed in the parent link frame.

This can be used to compute the bilateral constraint error.

Returns
Pose offset between anchor pose on child and parent, in parent link frame.

Referenced by Joint::DisconnectJointUpdate().

virtual void ApplyStiffnessDamping ( )
virtual

Callback to apply spring stiffness and viscous damping effects to joint.

: rename to ApplySpringStiffnessDamping()

Reimplemented in ODEJoint, and BulletJoint.

virtual bool AreConnected ( LinkPtr  _one,
LinkPtr  _two 
) const
pure virtual

Determines of the two bodies are connected by a joint.

Parameters
[in]_oneFirst link.
[in]_twoSecond link.
Returns
True if the two links are connected by a joint.

Implemented in ODEJoint, BulletJoint, DARTJoint, and SimbodyJoint.

virtual void Attach ( LinkPtr  _parent,
LinkPtr  _child 
)
virtual

Attach the two bodies with this joint.

Parameters
[in]_parentParent link.
[in]_childChild link.

Reimplemented in ODEJoint, ODEFixedJoint, and DARTJoint.

ignition::math::Quaterniond AxisFrame ( const unsigned int  _index) const

Get orientation of reference frame for specified axis, relative to world frame.

The value of axisParentModelFrame is used to determine the appropriate frame.

Parameters
[in]_indexjoint axis index.
Returns
Orientation of axis frame relative to world frame.

Referenced by Joint::DisconnectJointUpdate().

ignition::math::Quaterniond AxisFrameOffset ( const unsigned int  _index) const

Get orientation of joint axis reference frame relative to joint frame.

This should always return identity unless flag use_parent_model_frame is true in sdf 1.5 or using sdf 1.4-, i.e. bug described in issue #494 is present. In addition, if use_parent_model_frame is true, and the parent link of the joint is world, the axis is defined in the world frame. The value of axisParentModelFrame is used to determine the appropriate frame internally.

Parameters
[in]_indexjoint axis index.
Returns
Orientation of axis frame relative to joint frame. If supplied _index is out of range, or use_parent_model_frame is not true, this function returns identity rotation quaternion.

Referenced by Joint::DisconnectJointUpdate().

virtual void CacheForceTorque ( )
virtual

Cache Joint Force Torque Values if necessary for physics engine.

Reimplemented in SimbodyJoint, BulletJoint, ODEJoint, and DARTJoint.

Referenced by Joint::DisconnectJointUpdate().

double CheckAndTruncateForce ( unsigned int  _index,
double  _effort 
)

check if the force against velocityLimit and effortLimit, truncate if necessary.

Parameters
[in]_indexIndex of the axis.
[in]_effortForce value.
Returns
truncated effort

Referenced by Joint::DisconnectJointUpdate().

ignition::math::Pose3d ChildLinkPose ( const unsigned int  _index,
const double  _position 
)
protected

internal function to help us compute child link pose if a joint position change is applied.

Parameters
[in]_indexaxis index
[in]_positionnew joint position
Returns
new child link pose at new joint position.

Referenced by Joint::DisconnectJointUpdate().

math::Pose ComputeChildLinkPose ( unsigned int  _index,
double  _position 
)
protected

internal function to help us compute child link pose if a joint position change is applied.

Parameters
[in]_indexaxis index
[in]_positionnew joint position
Returns
new child link pose at new joint position.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

void ComputeScopedName ( )
protectedinherited

Compute the scoped name of this object based on its parents.

See also
Base::GetScopedName

Referenced by Base::Update().

event::ConnectionPtr ConnectJointUpdate ( _subscriber)
inline

Connect a boost::slot the the joint update signal.

Parameters
[in]_subscriberCallback for the connection.
Returns
Connection pointer, which must be kept in scope.

References EventT< T >::Connect().

virtual void Detach ( )
virtual

Detach this joint from all links.

Reimplemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

void DisconnectJointUpdate ( event::ConnectionPtr _conn)
inline

Disconnect a boost::slot the the joint update signal.

Parameters
[in]_connConnection to disconnect.
Deprecated:
Use event::~Connection to disconnect

References Joint::Anchor(), Joint::AnchorErrorPose(), Joint::AxisFrame(), Joint::AxisFrameOffset(), Joint::CacheForceTorque(), Joint::CheckAndTruncateForce(), Joint::ChildLinkPose(), Joint::ComputeChildLinkPose(), EventT< T >::Disconnect(), Joint::DOF(), Joint::FillMsg(), Joint::FindAllConnectedLinks(), GAZEBO_DEPRECATED, Joint::GetAnchor(), Joint::GetAnchorErrorPose(), Joint::GetAngle(), Joint::GetAngleCount(), Joint::GetAngleImpl(), Joint::GetAxisFrame(), Joint::GetAxisFrameOffset(), Joint::GetChild(), Joint::GetEffortLimit(), Joint::GetForce(), Joint::GetForceTorque(), Joint::GetGlobalAxis(), Joint::GetHighStop(), Joint::GetInertiaRatio(), Joint::GetInitialAnchorPose(), Joint::GetLinkForce(), Joint::GetLinkTorque(), Joint::GetLocalAxis(), Joint::GetLowerLimit(), Joint::GetLowStop(), Joint::GetMsgType(), Joint::GetParam(), Joint::GetParent(), Joint::GetParentWorldPose(), Joint::GetStopDissipation(), Joint::GetStopStiffness(), Joint::GetUpperLimit(), Joint::GetVelocity(), Joint::GetVelocityLimit(), Joint::GetWorldEnergyPotentialSpring(), Joint::GetWorldPose(), Joint::GlobalAxis(), Joint::InertiaRatio(), Joint::InitialAnchorPose(), Joint::LinkForce(), Joint::LinkTorque(), Joint::LocalAxis(), Joint::LowerLimit(), Joint::ParentWorldPose(), Joint::Position(), Joint::PositionImpl(), Joint::RegisterIntrospectionItems(), Joint::SetAnchor(), Joint::SetEffortLimit(), Joint::SetForce(), Joint::SetHighStop(), Joint::SetLowerLimit(), Joint::SetLowStop(), Joint::SetParam(), Joint::SetPosition(), Joint::SetPositionMaximal(), Joint::SetProvideFeedback(), Joint::SetStopDissipation(), Joint::SetStopStiffness(), Joint::SetUpperLimit(), Joint::SetVelocity(), Joint::SetVelocityLimit(), Joint::SetVelocityMaximal(), Joint::UpperLimit(), and Joint::WorldPose().

virtual void FillMsg ( msgs::Joint &  _msg)
virtual
bool FindAllConnectedLinks ( const LinkPtr _originalParentLink,
Link_V _connectedLinks 
)
protected

internal helper to find all links connected to the child link branching out from the children of the child link and any parent of the child link other than the parent link through this joint.

Parameters
[in]_originalParentLinkparent link of this joint, this is used to check for loops connecting back to the parent link.

Referenced by Joint::DisconnectJointUpdate().

virtual void Fini ( )
virtual

Finialize the object.

Reimplemented from Base.

Reimplemented in ODEJoint, and BulletJoint.

virtual math::Vector3 GetAnchor ( unsigned int  _index) const
virtual

Get the anchor point.

Parameters
[in]_indexIndex of the axis.
Returns
Anchor value for the axis.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

math::Pose GetAnchorErrorPose ( ) const

Get pose offset between anchor pose on child and parent, expressed in the parent link frame.

This can be used to compute the bilateral constraint error.

Returns
Pose offset between anchor pose on child and parent, in parent link frame.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

math::Angle GetAngle ( unsigned int  _index) const

Get the angle of rotation of an axis(index).

Parameters
[in]_indexIndex of the axis.
Returns
Angle of the axis.
Deprecated:
See Position(), which returns a double.

Referenced by Joint::DisconnectJointUpdate().

virtual unsigned int GetAngleCount ( ) const
virtual

Get the angle count.

Returns
The number of DOF for the joint.
Deprecated:
See DOF()

Referenced by Joint::DisconnectJointUpdate().

virtual math::Angle GetAngleImpl ( unsigned int  _index) const
protectedvirtual

Get the angle of an axis helper function.

Parameters
[in]_indexIndex of the axis.
Returns
Angle of the axis.
Deprecated:
See PositionImpl, which takes double.

Referenced by Joint::DisconnectJointUpdate().

math::Quaternion GetAxisFrame ( unsigned int  _index) const

Get orientation of reference frame for specified axis, relative to world frame.

The value of axisParentModelFrame is used to determine the appropriate frame.

Parameters
[in]_indexjoint axis index.
Returns
Orientation of axis frame relative to world frame.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

math::Quaternion GetAxisFrameOffset ( unsigned int  _index) const

Get orientation of joint axis reference frame relative to joint frame.

This should always return identity unless flag use_parent_model_frame is true in sdf 1.5 or using sdf 1.4-, i.e. bug described in issue #494 is present. In addition, if use_parent_model_frame is true, and the parent link of the joint is world, the axis is defined in the world frame. The value of axisParentModelFrame is used to determine the appropriate frame internally.

Parameters
[in]_indexjoint axis index.
Returns
Orientation of axis frame relative to joint frame. If supplied _index is out of range, or use_parent_model_frame is not true, this function returns identity rotation quaternion.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

BasePtr GetByName ( const std::string &  _name)
inherited

Get by name.

Parameters
[in]_nameGet a child (or self) object by name
Returns
A pointer to the object, NULL if not found

Referenced by Base::Update().

BasePtr GetChild ( unsigned int  _i) const
inherited

Get a child by index.

Parameters
[in]_iIndex of the child to retreive.
Returns
A pointer to the object, NULL if the index is invalid.

Referenced by Base::Update().

BasePtr GetChild ( const std::string &  _name)
inherited

Get a child by name.

Parameters
[in]_nameName of the child.
Returns
A pointer to the object, NULL if not found
LinkPtr GetChild ( ) const

Get the child link.

Returns
Pointer to the child link.

Referenced by Joint::DisconnectJointUpdate().

unsigned int GetChildCount ( ) const
inherited

Get the number of children.

Returns
The number of children.

Referenced by Base::Update().

double GetDamping ( unsigned int  _index)

Returns the current joint damping coefficient.

Parameters
[in]_indexIndex of the axis to get, currently ignored, to be implemented.
Returns
Joint viscous damping coefficient for this joint.
virtual double GetEffortLimit ( unsigned int  _index)
virtual

Get the effort limit on axis(index).

Parameters
[in]_indexIndex of axis, where 0=first axis and 1=second axis
Returns
Effort limit specified in SDF

Referenced by Joint::DisconnectJointUpdate().

virtual double GetForce ( unsigned int  _index)
virtual
Todo:
: not yet implemented.

Get external forces applied at this Joint. Note that the unit of force should be consistent with the rest of the simulation scales.

Parameters
[in]_indexIndex of the axis.
Returns
The force applied to an axis.

Reimplemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

Referenced by Joint::DisconnectJointUpdate().

virtual JointWrench GetForceTorque ( unsigned int  _index)
pure virtual

get internal force and torque values at a joint.

The force and torque values are returned in a JointWrench data structure. Where JointWrench.body1Force contains the force applied by the parent Link on the Joint specified in the parent Link frame, and JointWrench.body2Force contains the force applied by the child Link on the Joint specified in the child Link frame. Note that this sign convention is opposite of the reaction forces of the Joint on the Links.

FIXME TODO: change name of this function to something like: GetNegatedForceTorqueInLinkFrame and make GetForceTorque call return non-negated reaction forces in perspective Link frames.

Note that for ODE you must set <provide_feedback>true<provide_feedback> in the joint sdf to use this.

Parameters
[in]_indexNot used right now
Returns
The force and torque at the joint, see above for details on conventions.

Implemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

Referenced by Joint::DisconnectJointUpdate().

virtual math::Vector3 GetGlobalAxis ( unsigned int  _index) const
virtual

Get the axis of rotation in global cooridnate frame.

Parameters
[in]_indexIndex of the axis to get.
Returns
Axis value for the provided index.
Deprecated:
See GlobalAxis()

Referenced by Joint::DisconnectJointUpdate().

virtual math::Angle GetHighStop ( unsigned int  _index)
virtual

Get the high stop of an axis(index).

This function is replaced by GetUpperLimit(unsigned int). If you are interested in getting the value of dParamHiStop*, use GetAttribute(hi_stop, _index)

Parameters
[in]_indexIndex of the axis.
Returns
Angle of the high stop value.
Deprecated:
See UpperLimit, which returns double.

Referenced by Joint::DisconnectJointUpdate().

uint32_t GetId ( ) const
inherited

Return the ID of this entity.

This id is unique.

Returns
Integer ID.

Referenced by Base::Update().

double GetInertiaRatio ( const unsigned int  _index) const

Computes moment of inertia (MOI) across a specified joint axis.

The ratio is given in the form of MOI_child / MOI_parent. If MOI_parent is zero, this funciton will return 0. The inertia ratio for each joint axis indicates the sensitivity of the joint to actuation torques.

Parameters
[in]_indexaxis number about which MOI ratio is computed.
Returns
ratio of child MOI to parent MOI.

Referenced by Joint::DisconnectJointUpdate().

double GetInertiaRatio ( const math::Vector3 _axis) const

Computes moment of inertia (MOI) across an arbitrary axis specified in the world frame.

The ratio is given in the form of MOI_child / MOI_parent. If MOI_parent is zero, this funciton will return 0. The moment of inertia ratio along constrained directions of a joint has an impact on the performance of Projected Gauss Seidel (PGS) iterative LCP methods.

Parameters
[in]_axisaxis in world frame for which MOI ratio is computed.
Returns
ratio of child MOI to parent MOI.
Deprecated:
See function that takes ignition math.
math::Pose GetInitialAnchorPose ( ) const

Get initial Anchor Pose specified by model <joint><pose>...</pose></joint>

Returns
Joint::anchorPose, initial joint anchor pose.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

virtual LinkPtr GetJointLink ( unsigned int  _index) const
pure virtual

Get the link to which the joint is attached according the _index.

Parameters
[in]_indexIndex of the link to retreive.
Returns
Pointer to the request link. NULL if the index was invalid.

Implemented in ODEJoint, BulletJoint, DARTJoint, and SimbodyJoint.

virtual math::Vector3 GetLinkForce ( unsigned int  _index) const
virtual

Get the forces applied to the center of mass of a physics::Link due to the existence of this Joint.

Note that the unit of force should be consistent with the rest of the simulation scales.

Parameters
[in]indexThe index of the link(0 or 1).
Returns
Force applied to the link.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

virtual math::Vector3 GetLinkTorque ( unsigned int  _index) const
virtual

Get the torque applied to the center of mass of a physics::Link due to the existence of this Joint.

Note that the unit of torque should be consistent with the rest of the simulation scales.

Parameters
[in]indexThe index of the link(0 or 1)
Returns
Torque applied to the link.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

math::Vector3 GetLocalAxis ( unsigned int  _index) const

Get the axis of rotation.

Parameters
[in]_indexIndex of the axis to get.
Returns
Axis value for the provided index.
Deprecated:
See LocalAxis()

Referenced by Joint::DisconnectJointUpdate().

math::Angle GetLowerLimit ( unsigned int  _index) const

: get the joint lower limit (replaces GetLowStop and GetHighStop)

Parameters
[in]_indexIndex of the axis.
Returns
Lower limit of the axis.
Deprecated:
See LowerLimit, which returns double.

Referenced by Joint::DisconnectJointUpdate().

virtual math::Angle GetLowStop ( unsigned int  _index)
virtual

Get the low stop of an axis(index).

This function is replaced by GetLowerLimit(unsigned int). If you are interested in getting the value of dParamHiStop*, use GetAttribute(hi_stop, _index)

Parameters
[in]_indexIndex of the axis.
Returns
Angle of the low stop value.
Deprecated:
See LowerLimit, which returns double.

Referenced by Joint::DisconnectJointUpdate().

msgs::Joint::Type GetMsgType ( ) const

Get the joint type as msgs::Joint::Type.

Returns
Joint type.

Referenced by Joint::DisconnectJointUpdate().

std::string GetName ( ) const
inherited

Return the name of the entity.

Returns
Name of the entity.

Referenced by Base::Update().

virtual double GetParam ( const std::string &  _key,
unsigned int  _index 
)
virtual

Get a non-generic parameter for the joint.

See also
SetParam(const std::string &, unsigned int, const boost::any)
Parameters
[in]_keyString key.
[in]_indexIndex of the axis.

Reimplemented in ODEJoint, DARTJoint, BulletScrewJoint, BulletJoint, SimbodyScrewJoint, ODEScrewJoint, BulletUniversalJoint, SimbodyJoint, BulletHingeJoint, BulletSliderJoint, ODEUniversalJoint, and DARTScrewJoint.

Referenced by Joint::DisconnectJointUpdate().

LinkPtr GetParent ( ) const

Get the parent link.

Returns
Pointer to the parent link.

Referenced by Joint::DisconnectJointUpdate().

int GetParentId ( ) const
inherited

Return the ID of the parent.

Returns
Integer ID.

Referenced by Base::Update().

math::Pose GetParentWorldPose ( ) const

Get anchor pose on parent link relative to world frame.

When there is zero joint error, this should match the value returned by Joint::GetWorldPose() for the constrained degrees of freedom.

Returns
Anchor pose on parent link in world frame.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

bool GetSaveable ( ) const
inherited

Get whether the object should be "saved", when the user selects to save the world to xml.

Returns
True if the object is saveable.

Referenced by Base::Update().

std::string GetScopedName ( bool  _prependWorldName = false) const
inherited

Return the name of this entity with the model scope model1::...::modelN::entityName.

Parameters
[in]_prependWorldNameTrue to prended the returned string with the world name. The result will be world::model1::...::modelN::entityName.
Returns
The scoped name.

Referenced by Base::Update().

virtual const sdf::ElementPtr GetSDF ( )
virtualinherited

Get the SDF values for the object.

Returns
The SDF values for the object.

Reimplemented in Actor, and Model.

Referenced by Base::Update().

double GetSpringReferencePosition ( unsigned int  _index) const

Get joint spring reference position.

Parameters
[in]_indexIndex of the axis to get.
Returns
Joint spring reference position (in radians for angular joints).
double GetStiffness ( unsigned int  _index)

Returns the current joint spring stiffness coefficient.

Parameters
[in]_indexIndex of the axis to get, currently ignored, to be implemented.
Returns
Joint spring stiffness coefficient for this joint. : rename to GetSpringStiffness()
double GetStopDissipation ( unsigned int  _index) const

Get joint stop dissipation.

Parameters
[in]_indexjoint axis index.
Returns
joint stop dissipation coefficient.

Referenced by Joint::DisconnectJointUpdate().

double GetStopStiffness ( unsigned int  _index) const

Get joint stop stiffness.

Parameters
[in]_indexjoint axis index.
Returns
joint stop stiffness coefficient.

Referenced by Joint::DisconnectJointUpdate().

unsigned int GetType ( ) const
inherited

Get the full type definition.

Returns
The full type definition.

Referenced by Base::Update().

math::Angle GetUpperLimit ( unsigned int  _index) const

: get the joint upper limit (replacee GetLowStop and GetHighStop)

Parameters
[in]_indexIndex of the axis.
Returns
Upper limit of the axis.
Deprecated:
See UpperLimit, which returns double.

Referenced by Joint::DisconnectJointUpdate().

virtual double GetVelocityLimit ( unsigned int  _index)
virtual

Get the velocity limit on axis(index).

Parameters
[in]_indexIndex of axis, where 0=first axis and 1=second axis
Returns
Velocity limit specified in SDF

Referenced by Joint::DisconnectJointUpdate().

const WorldPtr& GetWorld ( ) const
inherited

Get the World this object is in.

Returns
The World this object is part of.

Referenced by Base::Update().

double GetWorldEnergyPotentialSpring ( unsigned int  _index) const

Returns this joint's spring potential energy, based on the reference position of the spring.

If using metric system, the unit of energy will be Joules.

Returns
this joint's spring potential energy,

Referenced by Joint::DisconnectJointUpdate().

math::Pose GetWorldPose ( ) const

Get pose of joint frame relative to world frame.

Note that the joint frame is defined with a fixed offset from the child link frame.

Returns
Pose of joint frame relative to world frame.
Deprecated:
See function that returns ignition math.

Referenced by Joint::DisconnectJointUpdate().

virtual ignition::math::Vector3d GlobalAxis ( unsigned int  _index) const
pure virtual
bool HasType ( const EntityType _t) const
inherited

Returns true if this object's type definition has the given type.

Parameters
[in]_tType to check.
Returns
True if this object's type definition has the.

Referenced by Base::Update().

double InertiaRatio ( const ignition::math::Vector3d &  _axis) const

Computes moment of inertia (MOI) across an arbitrary axis specified in the world frame.

The ratio is given in the form of MOI_chidl / MOI_parent. If MOI_parent is zero, this funciton will return 0. The moment of inertia ratio along constrained directions of a joint has an impact on the performance of Projected Gauss Seidel (PGS) iterative LCP methods.

Parameters
[in]_axisaxis in world frame for which MOI ratio is computed.
Returns
ratio of child MOI to parent MOI.

Referenced by Joint::DisconnectJointUpdate().

ignition::math::Pose3d InitialAnchorPose ( ) const

Get initial Anchor Pose specified by model <joint><pose>...</pose></joint>

Returns
Joint::anchorPose, initial joint anchor pose.

Referenced by Joint::DisconnectJointUpdate().

bool IsSelected ( ) const
inherited

True if the entity is selected by the user.

Returns
True if the entity is selected.

Referenced by Base::Update().

virtual ignition::math::Vector3d LinkForce ( const unsigned int  _index) const
pure virtual

Get the forces applied to the center of mass of a physics::Link due to the existence of this Joint.

Note that the unit of force should be consistent with the rest of the simulation scales.

Parameters
[in]indexThe index of the link(0 or 1).
Returns
Force applied to the link.

Implemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

Referenced by Joint::DisconnectJointUpdate().

virtual ignition::math::Vector3d LinkTorque ( const unsigned int  _index) const
pure virtual

Get the torque applied to the center of mass of a physics::Link due to the existence of this Joint.

Note that the unit of torque should be consistent with the rest of the simulation scales.

Parameters
[in]indexThe index of the link(0 or 1)
Returns
Torque applied to the link.

Implemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

Referenced by Joint::DisconnectJointUpdate().

void Load ( LinkPtr  _parent,
LinkPtr  _child,
const math::Pose _pose 
)

Set pose, parent and child links of a physics::Joint.

Parameters
[in]_parentParent link.
[in]_childChild link.
[in]_posePose containing Joint Anchor offset from child link.
Deprecated:
See function that takes ignition math.
void Load ( LinkPtr  _parent,
LinkPtr  _child,
const ignition::math::Pose3d &  _pose 
)

Set pose, parent and child links of a physics::Joint.

Parameters
[in]_parentParent link.
[in]_childChild link.
[in]_posePose containing Joint Anchor offset from child link.
ignition::math::Vector3d LocalAxis ( const unsigned int  _index) const

Get the axis of rotation.

Parameters
[in]_indexIndex of the axis to get.
Returns
Axis value for the provided index.

Referenced by Joint::DisconnectJointUpdate().

virtual double LowerLimit ( unsigned int  _index = 0) const
virtual

Get the joint's lower limit.

For rotational axes, the value is in radians, for prismatic axes it is in meters.

Parameters
[in]_indexIndex of the axis, defaults to 0.
Returns
Lower limit of the axis.

Reimplemented in SimbodyJoint, DARTJoint, DARTScrewJoint, BulletBallJoint, BulletHinge2Joint, SimbodyBallJoint, BulletUniversalJoint, BulletHingeJoint, DARTBallJoint, ODEBallJoint, BulletSliderJoint, and SimbodyScrewJoint.

Referenced by Joint::DisconnectJointUpdate().

bool operator== ( const Base _ent) const
inherited

Returns true if the entities are the same.

Checks only the name.

Parameters
[in]_entBase object to compare with.
Returns
True if the entities are the same.

Referenced by Base::Update().

ignition::math::Pose3d ParentWorldPose ( ) const

Get anchor pose on parent link relative to world frame.

When there is zero joint error, this should match the value returned by Joint::WorldPose() for the constrained degrees of freedom.

Returns
Anchor pose on parent link in world frame.

Referenced by Joint::DisconnectJointUpdate().

virtual double Position ( const unsigned int  _index = 0) const
finalvirtual

Get the position of an axis according to its index.

For rotational axes, the value is in radians. For prismatic axes, it is in meters.

For static models, it returns the static joint position.

It returns ignition::math::NAN_D in case the position can't be obtained. For instance, if the index is invalid, if the joint is fixed, etc.

Subclasses can't override this method. See PositionImpl instead.

Parameters
[in]_indexIndex of the axis, defaults to 0.
Returns
Current position of the axis.
See also
PositionImpl

Referenced by Joint::DisconnectJointUpdate().

virtual double PositionImpl ( const unsigned int  _index = 0) const
protectedpure virtual
void Print ( const std::string &  _prefix)
inherited

Print this object to screen via gzmsg.

Parameters
[in]_prefixUsually a set of spaces.

Referenced by Base::Update().

virtual void RegisterIntrospectionItems ( )
protectedvirtual

Register items in the introspection service.

Reimplemented from Base.

Referenced by Joint::DisconnectJointUpdate().

virtual void RemoveChild ( unsigned int  _id)
virtualinherited

Remove a child from this entity.

Parameters
[in]_idID of the child to remove.

Referenced by Base::Update().

void RemoveChild ( const std::string &  _name)
inherited

Remove a child by name.

Parameters
[in]_nameName of the child.
void RemoveChild ( physics::BasePtr  _child)
inherited

Remove a child by pointer.

Parameters
[in]_childPointer to the child.
void RemoveChildren ( )
inherited

Remove all children.

Referenced by Base::Update().

virtual void Reset ( )
virtual

Reset the joint.

Reimplemented from Base.

Reimplemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

virtual void Reset ( Base::EntityType  _resetType)
virtualinherited

Calls recursive Reset on one of the Base::EntityType's.

Parameters
[in]_resetTypeThe type of reset operation
virtual void SetAnchor ( unsigned int  _index,
const math::Vector3 _anchor 
)
virtual

Set the anchor point.

Parameters
[in]_indexIndex of the axis.
[in]_anchorAnchor value.
Deprecated:
See function that takes ignition math.

Referenced by Joint::DisconnectJointUpdate().

virtual void SetAnchor ( const unsigned int  _index,
const ignition::math::Vector3d &  _anchor 
)
pure virtual

Set the anchor point.

Parameters
[in]_indexIndex of the axis.
[in]_anchorAnchor value.

Implemented in DARTJoint, BulletJoint, BulletScrewJoint, SimbodyJoint, ODEGearboxJoint, ODEHingeJoint, ODESliderJoint, ODEFixedJoint, ODEHinge2Joint, DARTScrewJoint, ODEBallJoint, ODEUniversalJoint, and ODEScrewJoint.

virtual void SetAxis ( unsigned int  _index,
const math::Vector3 _axis 
)
virtual

Set the axis of rotation where axis is specified in local joint frame.

Parameters
[in]_indexIndex of the axis to set.
[in]_axisVector in local joint frame of axis direction (must have length greater than zero).
Deprecated:
See function that takes ignition math.
virtual void SetAxis ( const unsigned int  _index,
const ignition::math::Vector3d &  _axis 
)
pure virtual
virtual void SetDamping ( unsigned int  _index,
double  _damping 
)
pure virtual

Set the joint damping.

Parameters
[in]_indexIndex of the axis to set, currently ignored, to be implemented.
[in]_dampingDamping value for the axis.

Implemented in ODEJoint, DARTJoint, BulletJoint, SimbodyJoint, and BulletSliderJoint.

virtual void SetEffortLimit ( unsigned int  _index,
double  _effort 
)
virtual

Set the effort limit on a joint axis.

Parameters
[in]_indexIndex of the axis to set.
[in]_effortEffort limit for the axis.

Referenced by Joint::DisconnectJointUpdate().

virtual void SetForce ( unsigned int  _index,
double  _effort 
)
pure virtual

Set the force applied to this physics::Joint.

Note that the unit of force should be consistent with the rest of the simulation scales. Force is additive (multiple calls to SetForce to the same joint in the same time step will accumulate forces on that Joint). Forces are truncated by effortLimit before applied.

Parameters
[in]_indexIndex of the axis.
[in]_effortForce value.

Implemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

Referenced by Joint::DisconnectJointUpdate().

virtual bool SetHighStop ( unsigned int  _index,
const math::Angle _angle 
)
virtual

Set the high stop of an axis(index).

Parameters
[in]_indexIndex of the axis.
[in]_angleHigh stop angle.
Deprecated:
See SetUpperLimit, which takes double.

Referenced by Joint::DisconnectJointUpdate().

void SetLowerLimit ( unsigned int  _index,
math::Angle  _limit 
)

: set the joint lower limit (replaces SetLowStop and SetHighStop)

Parameters
[in]_indexIndex of the axis.
[in]_limitLower limit of the axis.
Deprecated:
See SetLowerLimit which takes double.

Referenced by Joint::DisconnectJointUpdate().

virtual void SetLowerLimit ( const unsigned int  _index,
const double  _limit 
)
virtual

Set the joint's lower limit.

For rotational axes, the value is in radians. For prismatic axes, it is in meters.

It returns ignition::math::NAN_D in case the limit can't be obtained. For instance, if the index is invalid, if the joint is fixed, etc.

Parameters
[in]_indexIndex of the axis.
[in]_limitLower limit of the axis.

Reimplemented in ODEJoint, SimbodyJoint, DARTJoint, SimbodyBallJoint, BulletScrewJoint, DARTBallJoint, ODEBallJoint, ODEUniversalJoint, BulletHinge2Joint, BulletBallJoint, BulletUniversalJoint, BulletHingeJoint, BulletFixedJoint, BulletSliderJoint, and SimbodyScrewJoint.

virtual bool SetLowStop ( unsigned int  _index,
const math::Angle _angle 
)
virtual

Set the low stop of an axis(index).

Parameters
[in]_indexIndex of the axis.
[in]_angleLow stop angle.
Deprecated:
See SetLowerLimit, which takes double.

Referenced by Joint::DisconnectJointUpdate().

void SetModel ( ModelPtr  _model)

Set the model this joint belongs too.

Parameters
[in]_modelPointer to a model.
virtual void SetName ( const std::string &  _name)
virtualinherited

Set the name of the entity.

Parameters
[in]_nameNew name.

Reimplemented in Entity.

Referenced by Base::Update().

virtual bool SetParam ( const std::string &  _key,
unsigned int  _index,
const boost::any &  _value 
)
pure virtual

Set a non-generic parameter for the joint.

replaces SetAttribute(Attribute, int, double) List of parameters: "friction" Axis Coulomb joint friction coefficient. "hi_stop" Axis upper limit. "lo_stop" Axis lower limit.

Parameters
[in]_keyString key.
[in]_indexIndex of the axis.
[in]_valueValue of the attribute.

Implemented in ODEJoint, DARTJoint, BulletJoint, SimbodyScrewJoint, ODEScrewJoint, BulletUniversalJoint, SimbodyJoint, BulletHingeJoint, BulletSliderJoint, DARTScrewJoint, and ODEUniversalJoint.

Referenced by Joint::DisconnectJointUpdate().

void SetParent ( BasePtr  _parent)
inherited

Set the parent.

Parameters
[in]_parentParent object.

Referenced by Base::Update().

virtual bool SetPosition ( unsigned int  _index,
double  _position 
)
virtual

The child links of this joint are updated based on desired position.

And all the links connected to the child link of this joint except through the parent link of this joint moves with the child link.

Parameters
[in]_indexIndex of the joint axis (degree of freedom).
[in]_positionPosition to set the joint to. unspecified, pure kinematic teleportation.
Returns
returns true if operation succeeds, false if it fails.

Reimplemented in ODEJoint, and BulletJoint.

Referenced by Joint::DisconnectJointUpdate().

bool SetPositionMaximal ( unsigned int  _index,
double  _position 
)
protected

Helper function for maximal coordinate solver SetPosition.

The child links of this joint are updated based on position change. And all the links connected to the child link of this joint except through the parent link of this joint moves with the child link.

Parameters
[in]_indexIndex of the joint axis (degree of freedom).
[in]_positionPosition to set the joint to.
Returns
returns true if operation succeeds, false if it fails.

Referenced by Joint::DisconnectJointUpdate().

virtual void SetProvideFeedback ( bool  _enable)
virtual

Set whether the joint should generate feedback.

Parameters
[in]_enableTrue to enable joint feedback.

Reimplemented in ODEJoint, and BulletJoint.

Referenced by Joint::DisconnectJointUpdate().

void SetSaveable ( bool  _v)
inherited

Set whether the object should be "saved", when the user selects to save the world to xml.

Parameters
[in]_vSet to True if the object should be saved.

Referenced by Base::Update().

virtual bool SetSelected ( bool  _show)
virtualinherited

Set whether this entity has been selected by the user through the gui.

Parameters
[in]_showTrue to set this entity as selected.

Reimplemented in Link.

Referenced by Base::Update().

void SetState ( const JointState _state)

Set the joint state.

Parameters
[in]_stateJoint state
virtual void SetStiffness ( unsigned int  _index,
const double  _stiffness 
)
pure virtual

Set the joint spring stiffness.

Parameters
[in]_indexIndex of the axis to set, currently ignored, to be implemented.
[in]_stiffnessSpring stiffness value for the axis. : rename to SetSpringStiffness()

Implemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

virtual void SetStiffnessDamping ( unsigned int  _index,
double  _stiffness,
double  _damping,
double  _reference = 0 
)
pure virtual

Set the joint spring stiffness.

Parameters
[in]_indexIndex of the axis to set, currently ignored, to be implemented.
[in]_stiffnessStiffness value for the axis.
[in]_referenceSpring zero load reference position. : rename to SetSpringStiffnessDamping()

Implemented in ODEJoint, DARTJoint, BulletJoint, and SimbodyJoint.

void SetStopDissipation ( unsigned int  _index,
double  _dissipation 
)

Set joint stop dissipation.

Parameters
[in]_indexjoint axis index.
[in]_dissipationjoint stop dissipation coefficient.

Referenced by Joint::DisconnectJointUpdate().

void SetStopStiffness ( unsigned int  _index,
double  _stiffness 
)

Set joint stop stiffness.

Parameters
[in]_indexjoint axis index.
[in]_stiffnessjoint stop stiffness coefficient.

Referenced by Joint::DisconnectJointUpdate().

void SetUpperLimit ( unsigned int  _index,
math::Angle  _limit 
)

: set the joint upper limit (replacee GetLowStop and GetHighStop)

Parameters
[in]_indexIndex of the axis.
[in]_limitUpper limit of the axis.
Deprecated:
See SetUpperLimit which takes double.

Referenced by Joint::DisconnectJointUpdate().

virtual void SetUpperLimit ( const unsigned int  _index,
const double  _limit 
)
virtual

Set the joint's upper limit.

For rotational axes, the value is in radians, for prismatic axes it is in meters.

Parameters
[in]_indexIndex of the axis, defaults to 0.
[in]_limitLower limit of the axis.

Reimplemented in ODEJoint, SimbodyJoint, DARTJoint, SimbodyBallJoint, BulletScrewJoint, DARTBallJoint, ODEBallJoint, ODEUniversalJoint, BulletHinge2Joint, BulletBallJoint, BulletUniversalJoint, BulletHingeJoint, BulletFixedJoint, BulletSliderJoint, and SimbodyScrewJoint.

virtual void SetVelocity ( unsigned int  _index,
double  _vel 
)
pure virtual

Set the velocity of an axis(index).

In ODE and Bullet, the SetVelocityMaximal function is used to set the velocity of the child link relative to the parent. In Simbody and DART, this function updates the velocity state, which has a recursive effect on the rest of the chain.

Parameters
[in]_indexIndex of the axis.
[in]_velVelocity.

Implemented in BulletScrewJoint, DARTScrewJoint, SimbodyScrewJoint, ODEScrewJoint, BulletSliderJoint, ODEGearboxJoint, ODEHinge2Joint, ODESliderJoint, BulletHinge2Joint, ODEHingeJoint, ODEUniversalJoint, DARTHinge2Joint, DARTUniversalJoint, ODEFixedJoint, BulletBallJoint, DARTFixedJoint, DARTHingeJoint, SimbodyBallJoint, SimbodyHinge2Joint, DARTSliderJoint, SimbodyUniversalJoint, BulletUniversalJoint, BulletHingeJoint, ODEBallJoint, BulletFixedJoint, DARTBallJoint, SimbodyFixedJoint, SimbodyHingeJoint, and SimbodySliderJoint.

Referenced by Joint::DisconnectJointUpdate().

virtual void SetVelocityLimit ( unsigned int  _index,
double  _velocity 
)
virtual

Set the velocity limit on a joint axis.

Parameters
[in]_indexIndex of the axis to set.
[in]_velocityVelocity limit for the axis.

Referenced by Joint::DisconnectJointUpdate().

bool SetVelocityMaximal ( unsigned int  _index,
double  _velocity 
)
protected

Helper function for maximal coordinate solver SetVelocity.

The velocity of the child link of this joint is updated relative to the current parent velocity. It currently does not act recursively.

Parameters
[in]_indexIndex of the joint axis (degree of freedom).
[in]_velocityVelocity to set at this joint.
Returns
returns true if operation succeeds, false if it fails.

Referenced by Joint::DisconnectJointUpdate().

void SetWorld ( const WorldPtr _newWorld)
inherited

Set the world this object belongs to.

This will also set the world for all children.

Parameters
[in]_newWorldThe new World this object is part of.

Referenced by Base::Update().

std::string TypeStr ( ) const
inherited

Get the string name for the entity type.

Returns
The string name for this entity.

Referenced by Base::Update().

virtual void UnregisterIntrospectionItems ( )
protectedvirtualinherited

Unregister items in the introspection service.

Referenced by Base::Update().

void Update ( )
virtual

Update the joint.

Reimplemented from Base.

virtual void UpdateParameters ( sdf::ElementPtr  _sdf)
virtual

Update the parameters using new sdf values.

Parameters
[in]_sdfSDF values to update from.

Reimplemented from Base.

virtual double UpperLimit ( const unsigned int  _index = 0) const
virtual

Get the joint's upper limit.

For rotational axes, the value is in radians. For prismatic axes, it is in meters.

It returns ignition::math::NAN_D in case the limit can't be obtained. For instance, if the index is invalid, if the joint is fixed, etc.

Parameters
[in]_indexIndex of the axis, defaults to 0.
Returns
Lower limit of the axis.

Reimplemented in SimbodyJoint, DARTJoint, DARTScrewJoint, BulletBallJoint, BulletHinge2Joint, SimbodyBallJoint, BulletUniversalJoint, BulletHingeJoint, DARTBallJoint, ODEBallJoint, BulletSliderJoint, and SimbodyScrewJoint.

Referenced by Joint::DisconnectJointUpdate().

common::URI URI ( ) const
inherited

Return the common::URI of this entity.

The URI includes the world where the entity is contained and all the hierarchy of sub-entities that can compose this entity. E.g.: A link entity contains the name of the link and the model where the link is contained.

Returns
The URI of this entity.

Referenced by Base::Update().

ignition::math::Pose3d WorldPose ( ) const

Get pose of joint frame relative to world frame.

Note that the joint frame is defined with a fixed offset from the child link frame.

Returns
Pose of joint frame relative to world frame.

Referenced by Joint::DisconnectJointUpdate().

Member Data Documentation

LinkPtr anchorLink
protected

Anchor link.

ignition::math::Vector3d anchorPos
protected

Anchor pose.

This is the xyz offset of the joint frame from child frame specified in the parent link frame

ignition::math::Pose3d anchorPose
protected

Anchor pose specified in SDF <joint><pose> tag.

AnchorPose is the transform from child link frame to joint frame specified in the child link frame. AnchorPos is more relevant in normal usage, but sometimes, we do need this (e.g. GetForceTorque and joint visualization).

gazebo::event::ConnectionPtr applyDamping
protected

apply damping for adding viscous damping forces on updates

bool axisParentModelFrame[2]
protected

Flags that are set to true if an axis value is expressed in the parent model frame.

Otherwise use the joint frame. See issue #494.

LinkPtr childLink
protected

The first link this joint connects to.

Base_V children
protectedinherited

Children of this entity.

double dissipationCoefficient[2]
protected

joint viscous damping coefficient

double effortLimit[2]
protected

Store Joint effort limit as specified in SDF.

std::vector<common::URI> introspectionItems
protectedinherited

All the introspection items regsitered for this.

double lowerLimit[2]
protected

Store Joint position lower limit as specified in SDF.

ModelPtr model
protected

Pointer to the parent model.

BasePtr parent
protectedinherited

Parent of this entity.

ignition::math::Pose3d parentAnchorPose
protected

Anchor pose relative to parent link frame.

LinkPtr parentLink
protected

The second link this joint connects to.

bool provideFeedback
protected

Provide Feedback data for contact forces.

sdf::ElementPtr sdf
protectedinherited

The SDF values for this object.

double springReferencePosition[2]
protected

joint spring reference (zero load) position

double stiffnessCoefficient[2]
protected

joint stiffnessCoefficient

double upperLimit[2]
protected

Store Joint position upper limit as specified in SDF.

double velocityLimit[2]
protected

Store Joint velocity limit as specified in SDF.

WorldPtr world
protectedinherited

Pointer to the world.

JointWrench wrench
protected

Cache Joint force torque values in case physics engine clears them at the end of update step.


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