Move an object

Typically: "How do I... ", "How can I... " questions
Post Reply
MaartenHo
Posts: 19
Joined: 11 Mar 2019, 14:25

Move an object

Post by MaartenHo » 15 Mar 2019, 10:21

Hi,

I'm working on a case where I have to move a frame up and down.

The case is an axis that rotates (rotation set up by motor) and I have to move the frame up and down related to the rotation of the axis. So I have to make a translation out of a rotation.

Second question:
- The frame starts at a height of 0,1m (z-axis) and is hold up by a belt, I already know that I can't simulate the belt, but the frame has a mass of 100kg and it says it needs a torque of 26,1Nm to hold the frame in it's startposition, how can I simulate this startsituation and how can I simulate the movement of the frame?

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

Re: Move an object

Post by coppelia » 15 Mar 2019, 16:59

Hello,

if your simulation does not need to be dynamic, then you can simply set the desired position/orientation of an object via sim.setObjectPosition and sim.setObjectOrientation.

If your simulation needs to be dynamic, you can build you actuator like:

Code: Select all

BaseShape(static) --> revoluteJoint --> auxiliaryShape(dynamic) --> prismaticJoint --> frameShape(dynamic)
Then you can link the two joints via a linear equation. This is when using the Vortex engine (see your other post). If one of the joints is in position control, then you can have the other joint linked to the first one by simply mimicing its positions inside of a joint control callback function.

Cheers

MaartenHo
Posts: 19
Joined: 11 Mar 2019, 14:25

Re: Move an object

Post by MaartenHo » 21 Mar 2019, 08:56

What do you mean with the auxiliaryShape? Is this a dummy link?

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

Re: Move an object

Post by coppelia » 22 Mar 2019, 14:01

In V-REP, you can't have following:

Code: Select all

shape --> dynamicallyEnabledJoint1 --> dynamicallyEnabledJoint2 --> shape
but you can have following:

Code: Select all

shape --> dynamicallyEnabledJoint1 --> auxiliaryShape --> dynamicallyEnabledJoint2 --> shape
see this page for details.

So the tricky thing is to correctly adjust the mass and inertia of the auxiliary shape, so that it doesn't negatively impact the simulation. Remember also the design considerations 6, 7 and 8 from the same page.

Cheers

MaartenHo
Posts: 19
Joined: 11 Mar 2019, 14:25

Re: Move an object

Post by MaartenHo » 25 Mar 2019, 10:55

I understand the hierarchy, but I don't understand what the auxiliaryShape is? Is that a dummy-link that I have to add or is this something else?

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

Re: Move an object

Post by coppelia » 25 Mar 2019, 14:42

The name auxiliaryShape tells you that it is a shape ;)
So it can be a spherical shape, a cuboid shape, etc. But it needs to be dynamically enabled (i.e. have a mass and inertia, and fall (if not constrained to any other object).

Cheers

MaartenHo
Posts: 19
Joined: 11 Mar 2019, 14:25

Re: Move an object

Post by MaartenHo » 28 Mar 2019, 08:37

I tried this but instead of moving up and down, the frame moves in a circle.

Post Reply