Starting the detection

To start the face detection function, use a ALFaceDetection proxy to subscribe to ALFaceDetection. In Python, the code for this subscription is:

from naoqi import ALProxy IP = "your_robot_ip" PORT = 9559 # Create a proxy to ALFaceDetection faceProxy = ALProxy("ALFaceDetection", IP, PORT) # Subscribe to the ALFaceDetection extractor period = 500 faceProxy.subscribe("Test_Face", period, 0.0 )

The "period" parameter specifies - in milliseconds - how often ALFaceDetection writes its results in an ALMemory output variable called "FaceDetected". The next section explains this point further. Once at least one subscription to the ALFaceDetection module is done, ALFaceDetection starts to run.





Copyright © 2010 Aldebaran-Robotics - All rights reserved