# Ways of applying force to a body in Gazebo In a Gazebo API there are many methods of applying force to a link.

• SetForce

• SetTorque

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.

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.

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

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.

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.

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

edit retag close merge delete

1

Sort by » oldest newest most voted

What is the frame used in AddForce api?

more