Page 1 of 1

Adding Object Issue

Posted: 13 Jun 2024, 23:59
by gplminhduc147
Hello,
I wanna add objects with U shape into coppeliasim with python and remoteApi. However, the gravity effects on objects seem wrong.
This is the short record of my issue: https://youtu.be/AWVNzEVxhYU (Full code of remoteApiCommandServer's childscript is under comment)

I've already defined the parameters of these objects in remoteApiCommandServer script:

Code: Select all

sim.setShapeColor(shapeHandle, nil, sim.colorcomponent_ambient_diffuse, inShapeShapeColor)
sim.setObjectInt32Param(shapeHandle, sim.shapeintparam_static, 0)
sim.setObjectInt32Param(shapeHandle, sim.shapeintparam_respondable, 1)
sim.setArrayParam(sim.arrayparam_gravity, {0,0,-9.8})
Didn't I do anything wrong here? and how to fix this issue? Thank you

Re: Adding Object Issue

Posted: 14 Jun 2024, 07:28
by fferri
Your shapes are not primitives or convex.

Try decomposing with primitives or convex decomposition.

See also Designing dynamic simulations.

Re: Adding Object Issue

Posted: 15 Jun 2024, 13:43
by gplminhduc147
fferri wrote: 14 Jun 2024, 07:28 Your shapes are not primitives or convex.

Try decomposing with primitives or convex decomposition.

See also Designing dynamic simulations.
Oh I've got this. Thank you for your help !!!

Re: Adding Object Issue

Posted: 22 Jun 2024, 02:49
by gplminhduc147
fferri wrote: 14 Jun 2024, 07:28 Your shapes are not primitives or convex.

Try decomposing with primitives or convex decomposition.

See also Designing dynamic simulations.
Hello It's me again. I've already tried sim.convexDecompose() function and the warning disappeared. However, the object's falling look a bit unrealistic (I'll put a link video below). It looks like the evironment treat my shape as a "plane"

https://youtu.be/iXrL4lUxFHs

How can I solve this problem? I'll be very grateful to you if you could teach me how. Thank you

Re: Adding Object Issue

Posted: 24 Jun 2024, 05:53
by coppelia
Hello,

select your shape, then [Tools > Visualize inertias]: does it look right?
What mass and inertia does your shape have? Did you follow design considerations 7 & 8?
What happens with a different engine?

Cheers

Re: Adding Object Issue

Posted: 28 Jun 2024, 16:08
by gplminhduc147
coppelia wrote: 24 Jun 2024, 05:53 Hello,

select your shape, then [Tools > Visualize inertias]: does it look right?
What mass and inertia does your shape have? Did you follow design considerations 7 & 8?
What happens with a different engine?

Cheers
Thanks for your suggestion. I've just set the value of object's Inertia and transform matrix with sim.setShapeInertia. It's working well now.