Combine two existing non-static models

Typically: "How do I... ", "How can I... " questions
Post Reply
filipposanfilippo
Posts: 5
Joined: 07 Jan 2015, 09:51

Combine two existing non-static models

Post by filipposanfilippo » 08 Apr 2019, 16:07

How can I combine two existing non-static models in vrep? The documentation says that I can use force sensors to integrate them but exactly how should I do that?

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

Re: Combine two existing non-static models

Post by coppelia » 09 Apr 2019, 08:26

Hello,

if you have two non-static shapes, then you can use a force sensor to link them rigidly, like:

Code: Select all

shape1 --> forceSensor --> shape2
But if you have more complex items such as models, it is a bit more difficult, depending on where they need to be rigidly connected. E.g. with following two models:

Code: Select all

shapeA1 --> jointA --> shapeA2
shapeB1 --> jointB --> shapeB2
if you want to connect them at the base (easy), then you can do:

Code: Select all

shapeA1 --> jointA --> shapeA2
        --> forceSensor --> shapeB1 --> jointB --> shapeB2
If you want to connect them at the tip, it is more difficult. You can either rearrange the model's hierarchy, so that the models are built upside-down and you can connect them again at the base.

Or you have to use a loop-closure, like:

Code: Select all

shapeA1 --> jointA --> shapeA2 --> loopClosureDummyA
shapeB1 --> jointB --> shapeB2 --> forceSensor --> loopClosureDummyB
where loopClosureDummyA and loopClosureDummyB are linked via a dynamic overlap constraint.

Cheers

Post Reply