Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
the code to put in your Choregraphe box to load the Image Recognition Database on your Nao or Pepper
class MyClass(GeneratedClass):
def __init__(self):
def onLoad(self):
self.reco = ALProxy("ALVisionRecognition")
self.fmgr = ALProxy("ALFrameManager")
def onUnload(self):
def onInput_onStart(self):
# self.getParameter refers to Choregraphe box parameters
path = self.fmgr.getBehaviorPath(self.behaviorId) + self.getParameter("path")
# this is the most important call
if self.reco.changeDatabase(path, self.getParameter("db name")):'Vision Database was loaded')
self.logger.warning('Could not load vision recognition database')
def onInput_onStop(self):
self.onUnload() #it is recommended to reuse the clean-up as the box is stopped
self.onStopped() #activate the output of the box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.