Gazebo: Q&A Forum - RSS feedhttp://answers.gazebosim.org/questions/Open source question and answer forum for GazeboenCopyright Askbot, 2010-2011.Tue, 25 Jul 2017 14:17:08 -0500Controlling a robotic arm in Gazebo using purely Torques/Forceshttp://answers.gazebosim.org/question/16865/controlling-a-robotic-arm-in-gazebo-using-purely-torquesforces/Hi,
I currently have the UR3 robotic arm loaded in Gazebo using their provided [URDF/Xacro](https://github.com/ros-industrial/universal_robot). I would like to make the arm move by specifying how much torque a particular joint of the arm produces.
My initial intuition would be to create a Gazebo plugin. I have been looking at the [Gazebo Physics Joint class](http://osrf-distributions.s3.amazonaws.com/gazebo/api/dev/classgazebo_1_1physics_1_1Joint.html), but I have to admit I am a bit lost as to what function to use. I have a basic plugin that can print out the links and joints of the arm, but I am having little luck moving the arm. Currently my update function of my plugin looks like this:
public: void OnUpdate(const common::UpdateInfo & /*_info*/)
{
this->model->GetJoint("shoulder_lift_joint")->SetForce(1, 10000);
}
It seems to jiggle the arm slightly but doesn't have any other effect. I am also confused about the inputs of set force. What indices correspond to which axis, and what are the units of force?
The reason I am not using the built-in [JointController class](http://osrf-distributions.s3.amazonaws.com/gazebo/api/dev/classgazebo_1_1physics_1_1JointController.html) is because eventually I want to test out my own controllers for the arm; however, the default JointController already includes a PID controller implementation built-in and only takes in the goal joint position. I would like a lower-level method to make a joint provide some torque and let Gazebo simulate what applying this torque would do.
-----
Edit:
After submitting the question, I changed the axis to 2 and the force to 1000000 (`SetForce(2,1000000)`), which was enough to break the model. So it seems the function does affect the model, but I would still like some clarification about the input parameters and whether this is the correct approach.scchowTue, 25 Jul 2017 14:17:08 -0500http://answers.gazebosim.org/question/16865/