Page 1 of 1

Changing Orientation of object during Simulation

Posted: 17 Jul 2013, 13:48
by xelda1988
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

Re: Changing Orientation of object during Simulation

Posted: 17 Jul 2013, 14:10
by coppelia
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

Re: Changing Orientation of object during Simulation

Posted: 17 Jul 2013, 15:15
by coppelia
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

Re: Changing Orientation of object during Simulation

Posted: 17 Jul 2013, 18:17
by xelda1988
Works perfectly now, I just added 3 revolute joints for spherical motor control and changed the inertia parameters!