Specialized proxy

($AL_DIR/modules/proxies)

Using a specialized proxy is the easiest way to call an Aldebaran Robotics method.

  • Include the .h header file corresponding to your module
  • Create the specialized proxy object
  • Call the method

Specialized proxy API:

Method Description
ALProxy(std::string Module) Constructor to call in local/remote module
ALProxy(std::string Module, std::string IP, int port) Constructor to call in remote module. Proxy will never make LPC.
methodName(parameters) methodName is .h module method. Call method
post.methodName(parameters) methodName is .h module method. Call method in a thread

// C++ sample // we suppose user created a module with module generator #include "almemoryproxy.h" // instantiate a new proxy. Poor performance, create it in initialisation ALPtr<ALMemoryProxy> proxy = ALPtr<ALMemoryProxy> (new ALMemoryProxy(getParentBroker())); proxy->insertData("val1", 0); // instantiate a new proxy without smart pointer (same poor performance) ALMemoryProxy proxy2(getParentBroker()); prox2.insertData("val2", 1); // get existing proxy (best performance) getParentBroker()->getMemoryProxy()->insertData("val3", 2);





Copyright © 2010 Aldebaran-Robotics - All rights reserved