gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.19k stars 480 forks source link

New event: BeforePhysicsUpdate #1851

Closed osrf-migration closed 8 years ago

osrf-migration commented 8 years ago

Original report (archived issue) by Martin Pecka (Bitbucket: peci1).


I want to do some advanced usage of ODE in Gazebo, and there is almost a blocker for me.

In ODE, you set contact surface parameter after collision checking, but before physics update (and that completely makes sense and I hope the other engines also do it like this).

There is no way for me to call custom code in between the UpdateCollision() and UpdatePhysics() calls in the World::Update callback.

I only have a possible workaround - to disable the physics engine, make an update (which will do the collision checking and not the physics update), then call my custom code, and call UpdatePhysics() manually afterwards. This may however break a lot of things connected to the WolrdUpdateEnd event, since it'd be called before the actual physics update.

So I propose creating a new event, called e.g. BeforePhysicsUpdate, that'd be triggered after UpdateCollision and before UpdatePhysics.

osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


That sounds like a reasonable idea. Feel free to make a pull request to the gazebo7 branch with this change.

osrf-migration commented 8 years ago

Original comment by Martin Pecka (Bitbucket: peci1).


Okay. I'll prepare it.

Could you give me a clue how is it with the ABI compatibility? Can I add a new event to Events.cc/Events.hh without breaking it? Or I don't have to care about it in the gazebo7 branch? -- Martin Pecka

osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


New events shouldn't break ABI compatibility.

osrf-migration commented 8 years ago

Original comment by Martin Pecka (Bitbucket: peci1).


https://osrf-migration.github.io/gazebo-gh-pages/#!/osrf/gazebo/pull-requests/2117/added-beforephysicsupdate-world-event

osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


Resolved in pull request #2128

osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).