Page 1 of 1

vibrating object? is this expected behaviour?

Posted: Sat Dec 23, 2017 10:35 pm
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

Re: vibrating object? is this expected behaviour?

Posted: Fri Dec 29, 2017 7:28 pm
by deepcode
and those urdfs are the ones included with pybullet.

Re: vibrating object? is this expected behaviour?

Posted: Wed Jan 03, 2018 4:11 pm
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()