machines-in-motion / bullet_utils

Python wrapper around pybullet.
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Reading Forces & Accelerometer from PyBullet #13

Open hammoudbilal opened 2 years ago

hammoudbilal commented 2 years ago

I am writing this as a reference as I might forget about it by next week. I will fix it in the next few days, but here are some issues,

  1. PinBulletWrapper.get_force() seems to return contact forces in the negative direction (clear on the z axis not so sure about the other directions). Would it make sense to flip it? I will look into pybullet documentation and why is this happening.

  2. The other issue with PinBulletWrapper.get_force() is that it returns only the active contacts, so we get a varying size list, would it make sense to store this list in the fixed number of end effectors, and set all in-active contacts to zero? or will that break too much code ? @jviereck

  3. @nrotella as I understand you added all the IMU functionality to the same wrapper? Just to confirm PinBulletWrapper.get_base_imu_linacc() and PinBulletWrapper.get_base_imu_angvel() transform the IMU readings from IMU frame to base frame or is it the other way arround? but in order to do that I have to call PinBulletWrapper.compute_numerical_quantities(dt) first ?

let me know what you guys think and I'll work on fixing/changing stuff if need be :)

jviereck commented 2 years ago

1) Sure 2) Happy to change this as well. 3) How about we call PinBulletWrapper.compute_numerical_quantities(dt) with the step function?

hammoudbilal commented 2 years ago

I can take care of the first two points, and it seems that PinBulletWrapper.compute_numerical_quantities(dt) gets computed in BulletEnv.step() so no need to take action on this one. I will close this issue once I fix the first two points