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
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
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
def handle_movestatus(self, req): res = TriggerResponse() res.success = self.move_complete res.message = self.move_msg return res
def onoff_response(self, onoff): d = TriggerResponse() d.success = self.set_power(onoff) d.message = "ON" if self.is_on else "OFF" return d
def server_callback(req): rospy.loginfo('Server callback!') resp = TriggerResponse() resp.success = True resp.message = 'OK' return resp
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
def trigger2_cb(req): response = TriggerResponse() response.success = True response.message = 'well done!' return response
def onoff_response(self, onoff): d = TriggerResponse() d.success = self.set_power(onoff) d.message = 'ON' if self.is_on else 'OFF' return d
def switchSaveMap(self, req): res = TriggerResponse() res.success = True res.message = "Next map will be saved" self.saveMap = True return res
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