20 from naoqi_driver.naoqi_node
import NaoqiNode
21 from std_srvs.srv
import (
27 from distutils.version
import LooseVersion
31 NaoqiNode.__init__(self,
'naoqi_background_movement')
36 rospy.loginfo(
"naoqi_background_movement initialized")
39 rospy.loginfo(
"Connecting to NaoQi at %s:%d", self.pip, self.pport)
42 rospy.logerr(
"Could not get a proxy to ALSystem")
45 if LooseVersion(self.systemProxy.systemVersion()) < LooseVersion(
"2.4"):
46 rospy.logerr(
"Naoqi version of your robot is " + str(self.systemProxy.systemVersion()) +
", which doesn't have a proxy to ALBackgroundMovement.")
51 rospy.logerr(
"Could not get a proxy to ALBackgroundMovement.")
55 res = SetBoolResponse()
58 self.backgroundMovementProxy.setEnabled(req.data)
61 except RuntimeError, e:
62 rospy.logerr(
"Exception caught:\n%s", e)
67 res = TriggerResponse()
68 res.success = self.backgroundMovementProxy.isEnabled()
70 except RuntimeError, e:
71 rospy.logerr(
"Exception caught:\n%s", e)
74 if __name__ ==
'__main__':
def handleIsEnabledSrv(self, req)
def handleSetEnabledSrv(self, req)