Page 1 of 1

How to get body acceleration?

Posted: Thu Apr 09, 2020 10:58 pm
by miker2
I've looked over the PyBullet user guide and can't seem to find a solution to this question. Is there an accessor for the linear acceleration of a body?

Specifically I'd like the linear acceleration of the base link.
I see the `getBasePositionAndOrientatiion` & `getBaseVelocity(model)` methods, but I see no method for accessing the acceleration of the base (or any other link).

Re: How to get body acceleration?

Posted: Thu Apr 23, 2020 6:12 pm
by tayalmanan
Hi,
you can use while loop to accelerate the bot in a way you want.
For example,

Code: Select all

while True:
    cubePos, cubeOrn = p.getBasePositionAndOrientation(bot)
    cubeEuler = p.getEulerFromQuaternion(cubeOrn)  
    dv = k*cubeEuler[0]
   p.stepSimulation()
Hope this helps!!! :P

Re: How to get body acceleration?

Posted: Thu Jun 24, 2021 8:25 pm
by miker2
Thanks for the reply, but not quite what I'm looking for. I'm controlling the robot (using joint controllers) and I want to be able to get the acceleration of the base due to the dynamics. I can take a backwards difference of the velocities from one timestep to another, but I was hoping that there was a method to access the accelerations directly.