Simulation of Assembling

Typically: "How do I... ", "How can I... " questions
Post Reply
Jonatas Teixeira
Posts: 9
Joined: 13 Oct 2023, 18:04

Simulation of Assembling

Post by Jonatas Teixeira »

Hello,
I'm trying to simulate the assembling of two random objects.
I've done some search over the forum and found two possibilities, force sensors and sim.groupShapes().

I already tried the sim.groupShapes function and have got some undesired behaviors: the whole robotic arm was included in the group (even turning off the "collidable" properties of the robot links). I don't know if there is a way to add a force sensor during the program execution.

What are the possibilities of doing it work right?

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

Re: Simulation of Assembling

Post by coppelia »

Hello,

sorry for the late reply...

If you need to rigidly attach two dynamically enabled shapes, then indeed, best would be to use a force sensor. Typically, you'd start with (unattached shape2):

Code: Select all

shape1 --> foceSensor
shape2
and end with (attached shape2):

Code: Select all

shape1 --> foceSensor --> shape2
The attachment happens with sim.setObjectParent(shape2Handle, forceSensorHandle)

If you group 2 or more shapes, then you obtain a brand new shape that includes all the shapes. Typically, you wouldn't do that during simulation, but you could. The function to use is sim.groupShapes(listOfShapes)

Only the shapes contained in listOfShapes will be grouped.

Cheers

Post Reply