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

Typically: "How do I... ", "How can I... " questions
Post Reply
coder212
Posts: 7
Joined: 10 Sep 2021, 13:29

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

Post 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?

coppelia
Site Admin
Posts: 8975
Joined: 14 Dec 2012, 00:25

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

Post 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

Post Reply