Changing Orientation of object during Simulation

Typically: "How do I... ", "How can I... " questions
Post Reply
xelda1988
Posts: 13
Joined: 02 Jul 2013, 17:13

Changing Orientation of object during Simulation

Post by xelda1988 » 17 Jul 2013, 13:48

Hi
During the Simulation I want to change the Orientation of a whole robotic hand, where the shape tree base is a static shape.

I do the following inside a child script:

if counter == 50000 then
orientation = {0.2,0.3,0} -- euler angles
simSetObjectOrientation(robot_handle, -1, orientation)
end

But this doesn't change the objects orientation - what can I do?

Cheers,
Alex

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

Re: Changing Orientation of object during Simulation

Post by coppelia » 17 Jul 2013, 14:10

Hello Alex,

if your object robot_handle is really static, it should change the orientation. Unless there is something else going on. Maybe could you share your scene? (with Google drive or similar)

Cheers

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

Re: Changing Orientation of object during Simulation

Post by coppelia » 17 Jul 2013, 15:15

I had a quick look at your scene:
  • Make sure your inertias are large enough. Right now there is a large error in the joints because of that.
  • The piece of code you mention is never executed, since the simulation will pause after 10 seconds and any script error will also pause the simulation (this is a non-default setting). Just copy and paste your simSetObjectOrientation code under the line where you retrieve the wrist handle: it will work.
  • Make sure to inpsect the simulation output for information about program errors, etc.
  • It is never a good idea to instantaneously move the static wriste of a robot: in reality, this is impossible, since this would put infinite force/torque constraints on the finger joints for instance. Or, if you have to do it, do it in small steps. The best is to make the wrist non-static and to mount it on a joint.
Cheers

xelda1988
Posts: 13
Joined: 02 Jul 2013, 17:13

Re: Changing Orientation of object during Simulation

Post by xelda1988 » 17 Jul 2013, 18:17

Works perfectly now, I just added 3 revolute joints for spherical motor control and changed the inertia parameters!

Post Reply