Robotics StackExchange | Archived questions

Ways of applying force to a body in Gazebo

In a Gazebo API there are many methods of applying force to a link.

What do they do? What is the difference between AddForce and SetForce? How is AddLinkForce different from the others?

Here is their specification:

virtual void AddForce ( const math::Vector3 & _force ) pure virtual Add a force to the body.

Parameters [in] _force Force to add. Implemented in BulletLink, SimbodyLink, ODELink, and DARTLink.

virtual void AddForceAtRelativePosition ( const math::Vector3 & _force, const math::Vector3 & _relPos ) pure virtual Add a force to the body at position expressed to the body's own frame of reference.

Parameters [in] _force Force to add. [in] _relPos Position on the link to add the force. Implemented in BulletLink, SimbodyLink, ODELink, and DARTLink.

virtual void AddForceAtWorldPosition ( const math::Vector3 & _force, const math::Vector3 & _pos ) pure virtual Add a force to the body using a global position.

Parameters [in] _force Force to add. [in] _pos Position in global coord frame to add the force. Implemented in BulletLink, SimbodyLink, ODELink, and DARTLink.

virtual void AddLinkForce ( const math::Vector3 & _force, const math::Vector3 & _offset = math::Vector3::Zero ) pure virtual Add a force expressed in the link frame.

Parameters [in] _force Direction 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] _offset Offset position expressed in the link frame. It defaults to the link origin. Implemented in BulletLink, SimbodyLink, ODELink, and DARTLink.

virtual void AddRelativeTorque ( const math::Vector3 & _torque ) pure virtual Add a torque to the body, components are relative to the body's own frame of reference.

Parameters [in] _torque Torque value to add. Implemented in BulletLink, SimbodyLink, ODELink, and DARTLink.

virtual void AddTorque ( const math::Vector3 & _torque ) pure virtual Add a torque to the body.

virtual void SetForce ( const math::Vector3 & _force ) pure virtual Set the force applied to the body.

Parameters [in] _force Force value. Implemented in ODELink, BulletLink, DARTLink, and SimbodyLink.

virtual void SetTorque ( const math::Vector3 & _torque ) pure virtual Set the torque applied to the body.

Parameters [in] _torque Torque value. Implemented in ODELink, BulletLink, DARTLink, and SimbodyLink.

Asked by kumpakri on 2019-08-06 03:37:08 UTC

Comments

This issue may have some helpful context: https://bitbucket.org/osrf/gazebo/issues/354/setforce-settorque-in-class-odelink-point

Asked by chapulina on 2019-08-06 12:53:08 UTC

Answers

What is the frame used in AddForce api?

Asked by smallerapple on 2019-09-29 03:47:27 UTC

Comments