Beispiel #1
0
 def runPostAction(self, req):
     rsp = PlugSotResponse()
     if self.supervisor is not None:
         try:
             success = self.supervisor.runPostAction(req.transition_name)
         except Exception as e:
             rospy.logerr(str(e))
             rsp.success = False
             rsp.msg = str(e)
             return rsp
     else:
         answer = self.runCommand("supervisor.runPostAction('{}')".format(
             req.transition_name))
         if len(answer.standarderror) != 0:
             rsp.success = False
             rsp.msg = answer.standarderror
             return rsp
         else:
             exec("success = " + answer.result)
     rsp.success = success
     rsp.msg = "Successfully called supervisor."
     return rsp
Beispiel #2
0
 def plugSot(self, req):
     rsp = PlugSotResponse()
     if self.supervisor is not None:
         try:
             self.supervisor.plugSot(req.transition_name, False)
         except Exception as e:
             rospy.logerr(str(e))
             rsp.success = False
             rsp.msg = str(e)
             return rsp
     else:
         answer = self.runCommand("supervisor.plugSot('{}', False)".format(
             req.transition_name))
         if len(answer.standarderror) != 0:
             rsp.success = False
             rsp.msg = answer.standarderror
             return rsp
     rsp.success = True
     return rsp
Beispiel #3
0
 def runPreAction(self, req):
     rsp = PlugSotResponse()
     if self.supervisor is not None:
         try:
             rsp.success, rsp.start_time = self.supervisor.runPreAction(
                 req.transition_name)
         except Exception as e:
             rospy.logerr(str(e))
             rsp.success = False
             rsp.msg = str(e)
             return rsp
     else:
         answer = self.runCommand("supervisor.runPreAction('{}')".format(
             req.transition_name))
         rsp.success, rsp.msg = self._isNotError(answer)
         if rsp.success:
             exec("rsp.success, rsp.start_time = " + answer.result)
         else:
             return rsp
     rsp.msg = "Successfully called supervisor."
     return rsp