I use the following code to dynamically create a cylinder or a dumbbell.
When I run the simulation for the cylinder, the cylinder falls then quickly stop moving.
When I run the simulation for the dumbbell, it falls too but never stop moving. Its mass is the same than the cylinder one.
Why?
Code: Select all
import random
def sysCall_init():
sim = require('sim')
create_objects()
def create_objects():
# The dumbbell model path
model_path = 'dumbbell.ttm'
size = [0.04, 0.13, 0.04]
mass = 0.22
# Load a copy of the model
loaded_object = sim.loadModel(model_path)
#loaded_object = sim.createPureShape(2, 16, size, mass)
sim.setObjectPosition(loaded_object, -1, [0.1425, 0.4763, 0.145])
sim.setObjectOrientation(loaded_object, -1, [3.141592 / 2, 0, 0])
sim.setFloatProperty(loaded_object, 'bullet.angularDamping', 1.99)
sim.setFloatProperty(loaded_object, 'bullet.linearDamping', 0.99)
sim.setFloatProperty(loaded_object, 'bullet.frictionOld', 1.99)
sim.setBoolProperty(loaded_object,'dynamic',True)
sim.setBoolProperty(loaded_object,'respondable',True)
sim.resetDynamicObject(loaded_object)