Home | Tutorials | Wiki | Issues
Ask Your Question
0

Return forces/torques set to joints via physics::Joint::SetParam("vel", ...)

asked 2019-02-27 02:45:29 -0500

FabianMene gravatar image

As far as I understand this function from this tutorial, it sets a force/torque to the joint such that the resulting acceleration results in achieving the specified velocity within one time step, where the force is saturated to "fmax".

Is there a way to return the force being applied to the joint?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-03-15 04:45:58 -0500

kumpakri gravatar image

updated 2019-03-15 04:51:17 -0500

Look into the API documentation http://gazebosim.org/api

You didn't mention your version of Gazebo, so for example from Gazebo 9 API

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] _index Not used right now

Returns The force and torque at the joint, see above for details on conventions.

Implemented in ODEJoint, SimbodyJoint, BulletJoint, and DARTJoint.

So using following instruction should give you the force and wrench.

myJointPtr->GetForceTorque(0)

The index 0 denotes the axis of the joint. I don't know why, but generarly whenever the gazebo API method wants an index of the axis, it always is 0, no matter if the axis is x, y or z.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-02-27 02:45:29 -0500

Seen: 95 times

Last updated: Mar 15