Setting physics engine time step explicitly

asked 2019-04-01 11:09:23 -0500

ManosAngelidis gravatar image

Hello,

I am currently using gazebo with ODE to simulate fluids, with the fluid simulation part being done with an external framework. The fluid simulation is making use of an adaptive timestep, which changes during the simulation. The way that the communication between gazebo and the fluid dynamics engine is done is through a world plugin. As the fluid timestep is adaptive, it is necessary to use the same time step for both the physical and the fluid simulation. Is there a way to achieve this programmatically? I see that I can specify the timestep through the physics engine pointer doing something like this

this->world->GetPhysicsEngine()->SetMaxStepSize(TimeManager::getCurrent()->getTimeStepSize());

, where the getTimeStepSize refers to the fluid simulation. I am doing the update on every ConnectWorldUpdateEnd event. But this does not guarantee that the timestep will be the same, since it only sets the maximum step size, not the actual time step size. Is that enough? Any help would be appreciated.

Best, Manos

edit retag flag offensive close merge delete