Skip to content
Snippets Groups Projects
Commit 0c5cf1dc authored by Nicolas Mansard's avatar Nicolas Mansard
Browse files

Corrected a hard-coded 36 dim.

parent 3ce8af8b
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,7 @@ class MetaTaskDynPosture(object): ...@@ -60,6 +60,7 @@ class MetaTaskDynPosture(object):
"larm": range(29,35), \ "larm": range(29,35), \
"lhand": [35], \ "lhand": [35], \
} }
nbDof = None
def __init__(self,dyn,dt,name="posture"): def __init__(self,dyn,dt,name="posture"):
self.dyn=dyn self.dyn=dyn
self.name=name self.name=name
...@@ -72,6 +73,7 @@ class MetaTaskDynPosture(object): ...@@ -72,6 +73,7 @@ class MetaTaskDynPosture(object):
plug(dyn.position,self.feature.errorIN) plug(dyn.position,self.feature.errorIN)
robotDim = len(dyn.position.value) robotDim = len(dyn.position.value)
self.feature.jacobianIN.value = matrixToTuple( identity(robotDim) ) self.feature.jacobianIN.value = matrixToTuple( identity(robotDim) )
# self.feature.setReference(self.featureDes.name)
self.feature.sdes.value = self.featureDes.name self.feature.sdes.value = self.featureDes.name
self.task.add(self.feature.name) self.task.add(self.feature.name)
...@@ -92,7 +94,9 @@ class MetaTaskDynPosture(object): ...@@ -92,7 +94,9 @@ class MetaTaskDynPosture(object):
def gotoq(self,gain=None,**kwargs): def gotoq(self,gain=None,**kwargs):
act=list() act=list()
qdes = zeros((36,1)) if MetaTaskDynPosture.nbDof==None:
MetaTaskDynPosture.nbDof = len(self.feature.errorIN.value)
qdes = zeros((MetaTaskDynPosture.nbDof,1))
for n,v in kwargs.items(): for n,v in kwargs.items():
r = self.postureRange[n] r = self.postureRange[n]
act += r act += r
...@@ -116,6 +120,7 @@ class MetaTaskDynCom(object): ...@@ -116,6 +120,7 @@ class MetaTaskDynCom(object):
plug(dyn.com,self.feature.errorIN) plug(dyn.com,self.feature.errorIN)
plug(dyn.Jcom,self.feature.jacobianIN) plug(dyn.Jcom,self.feature.jacobianIN)
# self.feature.setReference(self.featureDes.name)
self.feature.sdes.value = self.featureDes.name self.feature.sdes.value = self.featureDes.name
self.task.add(self.feature.name) self.task.add(self.feature.name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment