Page 1 of 1

How to set the damping value for a pure shape (cuboid) generated from a script?

Posted: 15 Sep 2021, 14:01
by coder212
I am generating cuboids for my projects to be moved along a conveyor through a script using sim.createPureShape
When I put my cuboid in a basket with an opening at the bottom to get the cuboid out, it looks like the cuboid is vibrating on the spot.
I am planning to increase the damping factor. Is it possible to set a damping value for the pure shape through the script?

Re: How to set the damping value for a pure shape (cuboid) generated from a script?

Posted: 15 Sep 2021, 15:39
by coppelia
Hello,

you have several things you should explore in order for your cuboids to become more stable. For instance:
  • adjust the inertia and/or the mass of the cuboids: sim.setShapeInertia / sim.setShapeMass
  • your suggestion to increase damping, for instance with the Bullet engine: sim.setEngineFloatParameter(sim.bullet_body_lineardamping,cuboidHandle,damping)
  • you can also imagine a more fancy solution, where the cuboid is (temporarily) dynamically disabled, via a script, when e.g. a sensor detects it: sim.setObjectInt32Param(cuboidHandle,sim.shapeintparam_static,1)
Cheers