0
$\begingroup$

Gazebo Answers logo

Let's suppose I have my own physics engine, how can I make it interact with gazebo?

I can't find any description on how the simulation loop works or when all the physic routines are called.

Looking at the API I can see there is a section "Physics" and how the other engines reimplement these classes and methods, what I want to know is how can I modify the physical behavior of the various simulation element at various level and moment?

thanks in advance for any answer


Originally posted by gianluca.bardaro on Gazebo Answers with karma: 3 on 2016-03-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

The title of your question is about using your own physics engine, but you also mention altering the behavior of simulation elements . To me this implies you'd like to use an existing physics engine but change its behavior. I'll try to answer both versions.

Use a new physics engine

Option 1 : Implement the physics API

If you have an existing physics engine, you can implement Gazebo's physics interface just as ODE, Bullet, Simbody, and DART have done. This is a non-trivial amount of work. Take a look at the PhysicsFactory, and at the ODE implementation for reference.

Option 2: Use gazebo as a library

You can use gazebo as a library, which would allow your physics engine to control simulation. Take a look here for a simple example of using gazebo in a custom main loop.

Option 3: Write a plugin

You could write a world or system plugin that loads your physics engine, and also control gazebo. Here are a few tutorials.

Alter simulation elements

Option 1: Write a plugin

You could write a plugin to move, spawn, delete and adjust the properties of models. Tutorials.

Option 2: Fork gazebo and make changes in the code

You can always fork gazebo, and directly modify the code to do anything you want. This approach could produce fast results, but would be difficult to maintain.

There are probably other methods, but these are good starting points.


Originally posted by nkoenig with karma: 7676 on 2016-03-25

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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