Home | Tutorials | Wiki | Issues
Ask Your Question
0

how to use the 'gazebo::physics::JointFeedback Class' in the model plugin or sensor plugin?

asked 2013-02-24 23:15:32 -0500

lugd1229 gravatar image

if I add a model plugin or a sensor plugin, I want to use the gazebo::physics::JointFeedback Class to obtain the force and torque of the link, or use the gazebo::physics::Joint Class to obtain the force and torque and 'SetForce' to a joint? what .h file need to include? and how can I use the class's member function? thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-02-25 00:18:00 -0500

hsu gravatar image

I think the minimum includes you'll need are:

#include <gazebo/physics/Joint.hh>
#include <gazebo/physics/JointWrench.hh>

and use the function this way:

physics::JointPtr joint = this->model->GetJoint("my_joint_name");
physics::JointWrench wrench = joint->GetForceTorque(0);

It's not a good example as it's convoluted, but the AtlasPlugin makes use of the GetForceTorque calls to get forces and torques at wrist and ankle.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-02-24 23:15:32 -0500

Seen: 2,729 times

Last updated: Feb 25 '13