Commit 33224191 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel

Use transition name as ID for the SoT

parent e961230f
......@@ -127,7 +127,16 @@ class Factory(GraphFactoryAbstract):
nids = { n.name: n.id for n in elmts.nodes }
self.transitionIds = { n.name: n.id for n in elmts.edges }
self.supervisor.sots = { ids[n]: sot for n, sot in self.sots.items() if ids.has_key(n) }
# self.supervisor.sots = { ids[n]: sot for n, sot in self.sots.items() if ids.has_key(n) }
# self.supervisor.grasps = { (gh, w): t for gh, ts in self.tasks._grasp.items() for w, t in ts.items() }
# self.supervisor.hpTasks = self.hpTasks
# self.supervisor.lpTasks = self.lpTasks
# self.supervisor.postActions = {
# ids[trans] : {
# nids[state]: sot for state, sot in values.items() if nids.has_key(state)
# } for trans, values in self.postActions.items() if ids.has_key(trans)
# }
# self.supervisor.preActions = { ids[trans] : sot for trans, sot in self.preActions.items() if ids.has_key(trans) }
self.supervisor.sots = self.sots
self.supervisor.grasps = { (gh, w): t for gh, ts in self.tasks._grasp.items() for w, t in ts.items() }
self.supervisor.hpTasks = self.hpTasks
......
......@@ -35,7 +35,7 @@ class RosInterface(object):
rsp.msg = str(e)
return rsp
else:
answer = self.runCommand ("supervisor.runPreAction({})".format(req.transition_name))
answer = self.runCommand ("supervisor.runPreAction('{}')".format(req.transition_name))
if len(answer.standarderror) != 0:
rospy.logerr(answer.standarderror)
rsp.success = False
......@@ -55,7 +55,7 @@ class RosInterface(object):
rsp.msg = str(e)
return rsp
else:
answer = self.runCommand ("supervisor.plugSot({}, False)".format(req.
answer = self.runCommand ("supervisor.plugSot('{}', False)".format(req.transition_name))
if len(answer.standarderror) != 0:
rospy.logerr(answer.standarderror)
rsp.success = False
......@@ -75,7 +75,7 @@ class RosInterface(object):
rsp.msg = str(e)
return rsp
else:
answer = self.runCommand ("supervisor.runPostAction({})".format(req.transition_name))
answer = self.runCommand ("supervisor.runPostAction('{}')".format(req.transition_name))
if len(answer.standarderror) != 0:
rospy.logerr(answer.standarderror)
rsp.success = False
......
......@@ -65,7 +65,7 @@ class Supervisor(object):
self.keep_posture._signalPositionRef().value = tuple([-0.74, 0.0, 1.0, 0.0, 0.0, 0.0] + list(self.sotrobot.dynamic.position.value)[6:])
self.keep_posture.pushTo(sot)
self.sots[-1] = sot
self.sots[""] = sot
def topics (self):
c = self.hpTasks + self.lpTasks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment