예제 #1
0
# ALMemory variable where the ALLandMarkdetection module outputs its results.
memValue = "/Test"

# Create a python broker on the local machine.
broker = ALBroker("pythonBroker", LOCAL_IP, LOCAL_PORT, IP, PORT)

import pdb; pdb.set_trace()

try:
  markHandlerName = "markHandler"
  # Create our module object.
  markHandler = MarkHandlerModule(markHandlerName)

  # Have module.onMarkChange called back when detection results change.
  memoryProxy = ALProxy("ALMemory")
  memoryProxy.subscribeOnData(memValue, markHandler.getName(), "",
    "onMarkChange")

  # Let the NaoMark detection run for a little while.
  time.sleep(5)

  # Shut the Python Broker down
  broker.shutdown()

except Exception, e:
  print "%s Error:"  %(testName)
  print str(e)
  testFailed = 1

import pdb; pdb.set_trace()

# Check that we detected some Naomarks.