Rosanswers logo


Is there a way to make two objects exert forces on each other in gazebo, to simulate for instance a magnet or vacuum gripper?

If not, is it possible to dynamically connect and disconnect object frames?

Kind regards, Eli

Originally posted by erkmns on ROS Answers with karma: 91 on 2011-10-19

Post score: 2

Original comments

Comment by Arkapravo on 2011-11-04:
Can you put your result in some website or video ? Should be very interesting.

Comment by erkmns on 2011-10-27:
We came up with a work-around, making external forces interact with both objects, using the apply_body_wrench service. The reference frame being the frame of the other object, and the wrench defined as a negative force in direction z.

Comment by Arkapravo on 2011-10-20:
Good question !


1 Answer 1


Rosanswers logo

Usually, it is much better to use Gazebo plugins instead of the apply_body_wrench service. The reason is that a Gazebo plugin is run exactly once for every simulation cycle, while the apply_body_wrench service interacts with the simulation in irregular intervals, leading to instabilities.

To do this:

  • specify each cubelet in an URDF file
  • add a Gazebo controller which excerts the magnetic forces

As an example of how to do this, you can look at the package manipulation_worlds, where they use a Plugin called gazebo_ros_grasp_hack to magically attach a grasped object to the PR2 gripper when both fingers make contact, in order to stop it from jittering out.

Originally posted by Martin Günther with karma: 11816 on 2012-04-13

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Abdullah on 2016-08-28:
Hi there, I saw your answer was written in 2012, I hope you are still there following gazebo, I have been trying to use this gazebo_ros_grasp_hack for so long and I couldnt figure out how to use it, may be because there isnt much of tutorials around for this plugin. I would be really really grateful


Your Answer

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