vibrating object? is this expected behaviour?

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
deepcode
Posts: 8
Joined: Sat Aug 26, 2017 2:04 am

vibrating object? is this expected behaviour?

Post by deepcode »

I was playing with modifying the examples.
I made a very simple script by modifying the collision example. I just have a cube and it is always vibrating. Why is this happening? Is this the expected behavior? How can I make it stop vibrating:

import pybullet as p
p.connect(p.GUI)
p.loadURDF("plane.urdf")
cubeId = p.loadURDF("cube_small.urdf",0,0,10)
p.setGravity(0,0,-10)
p.setRealTimeSimulation(0)
cid = p.createConstraint(cubeId,-1,-1,-1,p.JOINT_FIXED,[0,0,0],[0,0,0],[0,0,0])
while 1:
p.stepSimulation()



here is a video showing the problem: https://cl.ly/2j1U202L1j1k
deepcode
Posts: 8
Joined: Sat Aug 26, 2017 2:04 am

Re: vibrating object? is this expected behaviour?

Post by deepcode »

and those urdfs are the ones included with pybullet.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: vibrating object? is this expected behaviour?

Post by Erwin Coumans »

You constraint to move the cube to [0,0,0] conflicts with the contact constraints between cube and plane, which is also at [0,0,0].

Either change the constraint or move the plane down, for example

Code: Select all

import pybullet as p
p.connect(p.GUI)
p.loadURDF("plane.urdf",[0,0,-0.2]
)
cubeId = p.loadURDF("cube_small.urdf",0,0,10)
p.setGravity(0,0,-10)
p.setRealTimeSimulation(0)
cid = p.createConstraint(cubeId,-1,-1,-1,p.JOINT_FIXED,[0,0,0],[0,0,-0.2],[0,0,0])
while 1:
        p.stepSimulation()
Post Reply