Getting a proxy to ALFaceDetection

After some initialization steps, we first instantiate a proxy to the ALFaceDetection module.

# This test demonstrates how to use the ALFaceDetection module. # Note that you might not have this module depending on your distribution # # - We first instantiate a proxy to the ALFaceDetection module # Note that this module should be loaded on the robot's NAOqi. # The module output its results in ALMemory in a variable # called "FaceDetected" # - We then read this ALMemory value and check whether we get # interesting things. import time from naoqi import ALProxy # Replace here with your robot's IP address IP = "10.0.252.91" PORT = 9559 # Create a proxy to ALFaceDetection try: faceProxy = ALProxy("ALFaceDetection", IP, PORT) except Exception, e: print "Error when creating face detection proxy:" print str(e) exit(1) # Subscribe to the ALFaceDetection proxy # This means that the module will write in ALMemory with # the given period below period = 500 faceProxy.subscribe("Test_Face", period, 0.0 )





Copyright © 2010 Aldebaran-Robotics - All rights reserved