Gazebo | Ignition | Community
Ask Your Question

Additional Gravity Source

asked 2015-03-02 04:23:54 -0500

JPSG gravatar image

updated 2015-03-02 04:25:31 -0500

Hello Everyone. I was wondering if it were possible to include an additional gravity source in the gazebo world (for example, create a fixed object somewhere and give it a gravitational force that can attract other objects in its vicinity). I have had a bit of a look with ODE, but I could not turn up much information. Perhaps it is possible with one of the other physics engines? Does anybody have any experience with this type of thing?

Thanks again!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-02 06:19:41 -0500

AndreiHaidu gravatar image

Hi there,

I am not sure if the physics engines have such a functionality, because usually gravity applies on the whole world uniformly.

But if you want to add an additional force that only attracts objects in its vicinity, you could write a plugin to check for objects distances and then apply a force on them relative to the distance.

A world plugin could easily do the job. Just iterate through all the models and apply the computed force on them.

Cheers, Andrei

edit flag offensive delete link more


Thanks for your suggestion Andrei, very helpful. I spent a couple of days on it, and I've written something based off your advice that does the trick.


JPSG gravatar imageJPSG ( 2015-03-03 23:45:25 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2015-03-02 04:23:54 -0500

Seen: 218 times

Last updated: Mar 02 '15