Adding Object Issue

Typically: "How do I... ", "How can I... " questions
Post Reply
gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

Adding Object Issue

Post 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

fferri
Posts: 1297
Joined: 09 Sep 2013, 19:28

Re: Adding Object Issue

Post by fferri »

Your shapes are not primitives or convex.

Try decomposing with primitives or convex decomposition.

See also Designing dynamic simulations.

gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

Re: Adding Object Issue

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

gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

Re: Adding Object Issue

Post 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

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

Re: Adding Object Issue

Post 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

gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

Re: Adding Object Issue

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

Post Reply