Getting position of object in pyBullet
Posted: Fri Nov 22, 2019 7:50 am
i created simple basic example in pyBullet where i spawn 1 SDF model
This model is dropped into the world. Is there any way i could get its position after some time? lets say its dropped, it falls and then i get its new position
Code: Select all
import pybullet as p
import time
import pybullet_data
physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version
p.setAdditionalSearchPath(pybullet_data.getDataPath()) #optionally
p.setGravity(0,0,-10)
planeId = p.loadURDF("plane.urdf")
boxId = p.loadSDF("imnenoh.sdf")
for i in range (10000):
p.stepSimulation()
time.sleep(1./240.)
p.disconnect()