How to speed up PyBullet Simulation?
Posted: Thu Feb 03, 2022 11:39 am
I am new to PyBullet and I am trying to develop a planner in which I have to simulate some actions, so I need to do this as fast as possible.
I am initializing like this:
Then I control an arm to reach a position and hit small box, using setJointMotorControl2.
Finally I have this:
The overall test needs more or less 3 seconds to be execute, but since this has to be run several amount of times, how can I make it much faster?
Thank you !
I am initializing like this:
Code: Select all
self.useRealTimeSimulation = 0
self.time_step = 0.0001
if use_gui:
pybullet.connect(pybullet.GUI)
else:
pybullet.connect(pybullet.DIRECT)
pybullet.setGravity(0, 0, -9.81)
pybullet.setTimeStep(self.time_step)
pybullet.setRealTimeSimulation(self.useRealTimeSimulation)
pybullet.setPhysicsEngineParameter(numSubSteps=0)
Finally I have this:
Code: Select all
for i in range(self.steps):
pybullet.stepSimulation()
Thank you !