Getting a proxy to ALLandMarkDetection

After some initialization steps, we first instantiate a proxy to the ALLandMarkDetection module, and we subscribe to it.

# This test demonstrates how to use the ALLandMarkDetection module. # - We first instantiate a proxy to the ALLandMarkDetection module # Note that this module should be loaded on the robot's NAOqi. # The module output its results in ALMemory in a variable # called "LandmarkDetected" # - 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 ALLandMarkDetection try: landMarkProxy = ALProxy("ALLandMarkDetection", IP, PORT) except Exception, e: print "Error when creating landmark detection proxy:" print str(e) exit(1) # Subscribe to the ALLandMarkDetection proxy # This means that the module will write in ALMemory with # the given period below period = 500 landMarkProxy.subscribe("Test_LandMark", period, 0.0 )





Copyright © 2010 Aldebaran-Robotics - All rights reserved