0
$\begingroup$

Gazebo Answers logo

Hello Gazebo Community,

I am a programmer that has come from ROS where I didn't have to rely on physics to simulate an arm moving, and I am having problems understanding how to prevent the arm from falling to the floor (from its rest state where the arm is pointing up).

I have some understanding of how to enable the model plugins to apply forces and torques to joints and bodies but i am not sure how i would apply the forces or torques to prevent the model from free falling.

in terms of what I have, I defined my 7 dof arm from scratch in a SDF, I defined the links(collision/visual/inertia), joints(pose/axis/NOT dynamics). I am using gazebo 7.3.1, and sdf ver 1.4. I have installed libgazebo7 to have access to the Gazebo libraries.

I am hoping this awesome community could enlighten me about a couple things:

  1. Is there a joint other than revolute that I should be using to properly control the robot arm. I looked into gearbox joint but not really sure if thats needed.
  2. Should I be using some sort of PID control plugin that controls the force that is being applied to the joints. BTW is there a way to apply torques to joints and not the bodies themselves using the Gazebo physics joints c++ library?
  3. Are there example programs/plugins that are available for me to look at that show how control a robot arm

Thanks Francis123.


Originally posted by Francis123 on Gazebo Answers with karma: 33 on 2016-10-21

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

If you're using ROS, you should probably start by adding some standard ros controller plugins to your model:

There are a few tutorials, starting with this one.

these plugins should handle the PID for you, and let you just control position/velocity via a standard ros interface


Originally posted by Peter Mitrano with karma: 768 on 2016-10-21

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Francis123 on 2016-10-24:
Thanks Peter for the advice. What I am trying to validate are contact dynamics in Gazebo while passing torque based commands using Matlab. I am familiar with ROS control and have used its control plugins before for position and velocity on previous occasions outside of Gazebo. My colleagues would want to use ROS as least as possible. Are there any options within Gazebo to allow me to achieve the same results?

Comment by Peter Mitrano on 2016-10-24:
Yea for sure. the ROS thing are just heavy wrappers of the existing PID functionality in all gazebo joints. The easiest way (in my opinion) is to send gazebo::msgs::JointCmd. Fill out the joint name, PID, and target and it will just work. You say matlab... gazebo plugins must be C++, and you need C++ to send gazebo msgs. But assuming you can get some C++ going somewhere then it shouldn't be hard.

Comment by Peter Mitrano on 2016-10-24:
Also, one thing to help with the free-fall thing is damping. Try setting damping (try things between 1-20 depending on how heavy your links are). I sometimes just set damping really high to simulate joints where the motor doesn't backdrive easily, but that isn't really an accurate way of doing it

Comment by Francis123 on 2016-10-24:
Ok, looking through the tutorials for control model plugins in Gazebo (http://gazebosim.org/tutorials?tut=guided_i5) I do not see a use case for gazebo::msgs::JointCmd. But can I assume that if I create a Gazebo node (in c++) to publish commands using that message type I do not have to write a gazebo control plugin in c++? For the Matlab side there is a way to convert the functions into c++ programs so the torque outputs can be handled by the gazebo control plugin.

Comment by Peter Mitrano on 2016-10-25:
correct. The PID interface is already build in for all joints in gazebo. As long as you publish that message it will work. the joint panel hiding on the right side of gazebo uses the same thing. check /gazebo/default/my_model/joint_cmd.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.