ALMemory

ALMemory contains three types of data and provides three different APIs.

  • Mainly data from sensors and joints
  • Event
  • Micro-event

Data from sensors and joints

  • Data have no history.
  • Data are only 32 bits variable.
  • User can get pointer on data for a very fast access.
  • No subscribe on data.

API
void insertData(const std::string &name, const ALValue &value)
ALValue getData(const std::string &name)
float *ALMemoryFastAccess::getDataPtr(AL::ALPtr<AL::ALBroker> pBroker, const std::string &pStrValue, bool bAllowUnexistantVariable)

Use getDataPtr to get sensors and joint value in your real-time C++ algorithm. Use getData in most of C++/python algorithm.

Event

You can subscribe to event. Event subscribtion run the extractor that generate the event. For example, subscribe to event FaceDetected launch face detection algorithm. Subscribe to event WordRecognized run speech recognition. By default no extractors are running. NAOqi can manage history and long term memory based on event.

API
declareEvent(const std::string &eventName)
raiseEvent(const std::string &eventName, const ALValue &value)
subscribeToEvent( const std::string& dataName, const std::string& moduleName, const std::string& message, const std::string& callback )

Micro-event

Micro-events are mostly use internaly for callback system.

API
declareMicroEvent(const std::string &microEventName)
raiseMicroEvent(const std::string &microEventName, const ALValue &value)
subscribeToMicroEvent( const std::string& dataName, const std::string& moduleName, const std::string& message, const std::string& callback )





Copyright © 2010 Aldebaran-Robotics - All rights reserved