rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
706 stars 344 forks source link

WIP: allow void value (-1) in SetDOFValues indices #1310

Closed cielavenir closed 1 year ago

cielavenir commented 1 year ago

So that we can call SetDOFValues([1.0, 1.0, 1.0, 1.0, 0, 0, 2.0], [0, 1, 2, 3, 4, -1, -1, 7])

/cc @ntohge

rdiankov commented 1 year ago

@kanbouchou what do you think?

kanbouchou commented 1 year ago

@kanbouchou what do you think?

I'm not sure what the use of this api is. @cielavenir how would you use this -1 syntex? why not SetDOFValues([1.0, 1.0, 1.0, 1.0, 1.0, 2.0], [0, 1, 2, 3, 4, 7])?

cielavenir commented 1 year ago

@kanbouchou I wrote the complete description in mujinsimulator 1616, which I cannot post here.

cielavenir commented 1 year ago
dofvalues=array([1.0, 1.0, 1.0, 1.0, 1.0, 0, 0, 2.0])
doforder=array([0, 1, 2, 3, 4, -1, -1, 7])
SetDOFValues(dofvalues[doforder>=0], doforder[doforder>=0])
cielavenir commented 1 year ago

Pushed SetDOFValues(dofvalues[doforder>=0], doforder[doforder>=0]) way to mujinsimulator, this one can be closed.