no SetJointValues after ReleaseFingers?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

no SetJointValues after ReleaseFingers?

richard
Hi,

i have a problem, and it can simply be reproduced using the example
'simple environment loading' at
http://openrave.programmingvision.com/ordocs/en/openravepy-html/index.html#rst-quick-examples

what i changed is only the joint values to reach, I can set the joint
values directly using:

----
from openravepy import *
import time
env = Environment() # create openrave environment
env.SetViewer('qtcoin') # attach viewer (optional)
env.Load('data/puma.env.xml') # load a simple scene
robot = env.GetRobots()[0] # get the first robot
print "Robot ",robot.GetName()," has ",robot.GetDOF()," joints with
values:\n",robot.GetJointValues()
robot.SetJointValues([ 0.567806 ,  -0.270869  , 3.36227 ,    2.13803
,    1.54381,    -1.52847,  -0.97738438]) # set joint 0 to value 0.5
T = robot.GetLinks()[1].GetTransform() # get the transform of link 1
print "The transformation of link 1 is:\n",T
time.sleep(5)
env.Destroy() # explicitly destroy the environment once done with it
----

That works, of course. But, when adding following lines after line 7
(print "Robot...):

----
taskmanip = interfaces.TaskManipulation(robot)
taskmanip.ReleaseFingers()
while not robot.GetController().IsDone():
    time.sleep(0.01)
----

...the hand opens, but the joint setting afterwards does not work
anymore, the robot "jumps" to the desired position only for the fraction
of a second (just that it can be recognized in the viewer) and then
"jumps" back to the old, initial position. What did I forget? When using
TaskManipulation, isn't it allowed to set joints directly anymore?

best regards

Richard

--
Richard Cubek, Dipl.-Ing.(FH)
University of Applied Sciences Ravensburg-Weingarten
Intelligent Mobile Robotics Laboratory
Phone: (0049) (0)751 501 9838
Mobile: (0049) (0)163 88 39 529


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: no SetJointValues after ReleaseFingers?

Rosen Diankov
Administrator
hi richard,

The robot controller manages the robot's states. When sending commands
to the real robot, you send a command to the robot controller using
robot.GetController().SetPath/SetDesired. The robot controller will
continue to update the internal openrave world with whatever the real
robot state.

SetJointValues/SetTransform only changes the internal openrave state,
not the controller. Therefore, the controller will overwrite the state
soon afterwards. Of course, if the environment is locked, the internal
state will not be changed.

In the beginning, the IdealController is in a special state that does
not overwrite joint angles; only after the first controller command
does it start simulating a real robot. You can of course reset it:

robot.GetController().Reset(0)

rosen,

2010/10/20 Richard Cubek <[hidden email]>:

> Hi,
>
> i have a problem, and it can simply be reproduced using the example
> 'simple environment loading' at
> http://openrave.programmingvision.com/ordocs/en/openravepy-html/index.html#rst-quick-examples
>
> what i changed is only the joint values to reach, I can set the joint
> values directly using:
>
> ----
> from openravepy import *
> import time
> env = Environment() # create openrave environment
> env.SetViewer('qtcoin') # attach viewer (optional)
> env.Load('data/puma.env.xml') # load a simple scene
> robot = env.GetRobots()[0] # get the first robot
> print "Robot ",robot.GetName()," has ",robot.GetDOF()," joints with
> values:\n",robot.GetJointValues()
> robot.SetJointValues([ 0.567806 ,  -0.270869  , 3.36227 ,    2.13803
> ,    1.54381,    -1.52847,  -0.97738438]) # set joint 0 to value 0.5
> T = robot.GetLinks()[1].GetTransform() # get the transform of link 1
> print "The transformation of link 1 is:\n",T
> time.sleep(5)
> env.Destroy() # explicitly destroy the environment once done with it
> ----
>
> That works, of course. But, when adding following lines after line 7
> (print "Robot...):
>
> ----
> taskmanip = interfaces.TaskManipulation(robot)
> taskmanip.ReleaseFingers()
> while not robot.GetController().IsDone():
>    time.sleep(0.01)
> ----
>
> ...the hand opens, but the joint setting afterwards does not work
> anymore, the robot "jumps" to the desired position only for the fraction
> of a second (just that it can be recognized in the viewer) and then
> "jumps" back to the old, initial position. What did I forget? When using
> TaskManipulation, isn't it allowed to set joints directly anymore?
>
> best regards
>
> Richard
>
> --
> Richard Cubek, Dipl.-Ing.(FH)
> University of Applied Sciences Ravensburg-Weingarten
> Intelligent Mobile Robotics Laboratory
> Phone: (0049) (0)751 501 9838
> Mobile: (0049) (0)163 88 39 529
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users