def handleGetLifeSrv(self, req):
     try:
         res = TriggerResponse()
         res.success = True
         res.message = self.lifeProxy.getState()
         rospy.loginfo("current life state is " + str(res.message))
         return res
     except RuntimeError, e:
         rospy.logerr("Exception while getting life state:\n%s", e)
         return None
Example #2
0
    def left_interaction_off_cb(self, req):
        resp = TriggerResponse()
        if not self.left_arm_mann:
            rospy.logerr('Left arm already in normal mode')
            resp.success = True
        else:

            self.switch_req.stop_controllers = [self.mannequin_controllers[1]]
            self.switch_req.start_controllers = [self.standard_controllers[1]]
            res = self.switch_control(self.switch_req)

            if res.ok:

                self.left_arm_mann = False
                self.left_int_pub.publish(False)
                resp.success = True
            else:
                resp.success = False
                resp.message = "Left arm: failed to switch interaction to OFF"

        return resp
Example #3
0
    def right_interaction_on_cb(self, req):

        resp = TriggerResponse()

        if self.right_arm_mann:
            rospy.logerr('Right arm already in interactive mode')
            resp.success = True
        else:

            self.switch_req.stop_controllers = [self.standard_controllers[0]]
            self.switch_req.start_controllers = [self.mannequin_controllers[0]]
            res = self.switch_control(self.switch_req)

            if res.ok:

                self.right_arm_mann = True
                self.right_int_pub.publish(True)
                resp.success = True
            else:
                resp.success = False
                resp.message = "Left arm: failed to switch interaction to ON"

        return resp
Example #4
0
 def handle_movestatus(self, req):
     res = TriggerResponse()
     res.success = self.move_complete
     res.message = self.move_msg
     return res
Example #5
0
 def onoff_response(self, onoff):
     d = TriggerResponse()
     d.success = self.set_power(onoff)
     d.message = "ON" if self.is_on else "OFF"
     return d
Example #6
0
def server_callback(req):
    rospy.loginfo('Server callback!')
    resp = TriggerResponse()
    resp.success = True
    resp.message = 'OK'
    return resp
Example #7
0
 def trigger_response(self):
     response = TriggerResponse()
     response.success = True
     response.message = "Testing"
     return response
 def stop_service_handler(self, request):
     self.controller_active = False
     t = TriggerResponse()
     t.success=True
     t.message="DRP Controller stopped"
     return t
Example #9
0
def trigger2_cb(req):
    response = TriggerResponse()
    response.success = True
    response.message = 'well done!'
    return response
Example #10
0
def server_callback(req):
  rospy.loginfo('Server callback!')
  resp = TriggerResponse()
  resp.success = True
  resp.message = 'OK'
  return resp
Example #11
0
 def onoff_response(self, onoff):
     d = TriggerResponse()
     d.success = self.set_power(onoff)
     d.message = 'ON' if self.is_on else 'OFF'
     return d
Example #12
0
 def switchSaveMap(self, req):
     res = TriggerResponse()
     res.success = True
     res.message = "Next map will be saved"
     self.saveMap = True
     return res
Example #13
0
 def checkIfIdle(self, req):
     res = TriggerResponse()
     res.success = self.isIdle
     res.message = ""
     return res
 def service_callback(self, request):
     self.detection_dict = self.LaserReader_object.crash_detector()
     response = TriggerResponse()
     response.success = False
     response.message = self.direction_to_move()
     return response