Connect 2 cuboids to one Shape

Typically: "How do I... ", "How can I... " questions
Sena
Posts: 9
Joined: 13 Jun 2022, 15:21

Connect 2 cuboids to one Shape

Post by Sena »

Hello,

I would like to know if it is possible to connect 2 cuboids to one Shape.
For example, take a cylinder and each side connect a cuboid.
Because i'm controlling the position from both cuboid and so the cylinder
will move according to those positions.

Thank in advance

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

Re: Connect 2 cuboids to one Shape

Post by coppelia »

Hello,

if you have a non-dynamic situation, then you can simply make any object child of the cylinder in order to attach it to it. Via the GUI, or via sim.setObjectParent:

Code: Select all

cylinder --> cuboid1
         --> cuboid2
If you have a dynamic situation, then you will have to use a force/torque sensor in-between:

Code: Select all

cylinder --> forceSensor1 --> cuboid1
         --> forceSensor2 --> cuboid2
in this case, use also sim.setObjectParent and sim.createForceSensor, sim.setObjectPosition, etc.

Cheers

Sena
Posts: 9
Joined: 13 Jun 2022, 15:21

Re: Connect 2 cuboids to one Shape

Post by Sena »

Thanks for your answer,
But I'm sorry I may have explained my question wrong.
I'm looking to connect them in this way

cuboid1 --> cylinder
cuboid2 --> cylinder

Is it possible please ?

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

Re: Connect 2 cuboids to one Shape

Post by coppelia »

No, you need to use the cylinder as the parent of the two cuboids. That shouldn't make any difference. What exactly are you trying to achieve?

cheers

Sena
Posts: 9
Joined: 13 Jun 2022, 15:21

Re: Connect 2 cuboids to one Shape

Post by Sena »

I'm getting position from a sensor that gives me the position of different body's joint.
Here the 2 cuboids represent one the shoulder position & the other one elbows position.
I need to connect them to a shape (cylinder type) to form a hand.
I am ready to listen any other solution
thanks

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

Re: Connect 2 cuboids to one Shape

Post by coppelia »

then why not simply:

Code: Select all

cuboid1 --> cylinder --> cuboid2
or
cuboid1 --> forceSensor1 --> cylinder --> forceSensor2 --> cuboid2
?

Sena
Posts: 9
Joined: 13 Jun 2022, 15:21

Re: Connect 2 cuboids to one Shape

Post by Sena »

I tried the first one, but the cylinder is only connected to the Cuboid1 i need to be connected also to the cuboid2 (physically)

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

Re: Connect 2 cuboids to one Shape

Post by coppelia »

Do you have a robot arm, and want to additionally connect item together?
e.g. Take following situation:

Code: Select all

shape1 --> joint --> cylinder --> joint --> shape2
imagine you wanted, at some point to rigidly connect shape1 and shape2 to the cylinder, then you could:
  • make sure the two joints are in position control, and the target position doesn't change.
  • you can always use additional constraints, so called loop closure constraints, e.g.:
Cheers

Sena
Posts: 9
Joined: 13 Jun 2022, 15:21

Re: Connect 2 cuboids to one Shape

Post by Sena »

Is it possible to upload image to explain better ?
Image

Cuboid 1 (shoulder) : position evolution
Cuboid 2 (elbow) : position evolution

I choose to add a cylinder to have a visual to see the pitch angle of the shoulder by connecting this cylinder between the shoulder and the elbow.
But i don't know how to do this.

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

Re: Connect 2 cuboids to one Shape

Post by coppelia »

You can post a link to your image hosted on DropBox or similar.
Sorry, from your explanation I still don't get it...

Post Reply