ALExtractor API

NAOqi Core - Overview | ALExtractor API | ALVisionExtractor API


Method list

Any ALExtractor inherits methods from ALModule API. It also has the following specific methods:

Parameters update
Introspection
void ALExtractor::subscribe(const std::string& pSubscribedName, const int& pPeriod, const float& pPrecision)

There are two overloads of this function:

Subscribes to the extractor with given period and precision values. If not yet started by another subscriber, starts processing data periodically and publishes data in ALMemory (either as memory keys or events).

Parameters:
  • pSubscribedName – Name of the subscriber.
  • pPeriod – Period of the extractor in milliseconds.
  • pPrecision – Precision of the extractor.
void ALExtractor::subscribe(const std::string& pSubscribedName)

Subscribes to the extractor with default period (30) and precision (1).

Parameters:
  • pSubscribedName – Name of the subscriber.
void ALExtractor::unsubscribe(const std::string& pSubscribedName)

Unsubscribes a given subscriber from the extractor.

Parameters:
  • pSubscribedName – Name of the subscriber.
void ALExtractor::updatePeriod(const std::string& pSubscribedName, const int& pPeriod)

Updates the extractor period for a given subscriber if relevant.

Parameters:
  • pSubscribedName – Name of the subscriber.
  • pPeriod – New period in milliseconds.
void ALExtractor::updatePrecision(const std::string& pSubscribedName, const float& pPrecision)

Updates the extractor precision for a given subscriber if relevant.

Parameters:
  • pSubscribedName – Name of the subscriber.
  • pPeriod – New precision.
int ALExtractor::getCurrentPeriod()

Gets the current period of the extractor.

Returns:Smallest period required by all the subscribers.
float ALExtractor::getCurrentPrecision()

Gets the current precision of the extractor.

Returns:Highest precision required by all the subscribers.
int ALExtractor::getMyPeriod(const std::string& pSubscribedName)

Gets the current period of a given extractor.

Parameters:
  • pSubscribedName – Name of the subscriber.
Returns:

Current period.

float ALExtractor::getMyPrecision(const std::string& pSubscribedName)

Gets the current precision of a given extractor.

Parameters:
  • pSubscribedName – Name of the subscriber.
Returns:

Current precision.

AL::ALValue ALExtractor::getSubscribersInfo()

Gets the list of parameters for all the current subscribers (name, period and precision).

Returns:Array of the form [ [name_1, period_1, precision_1], [name_2, period_2, precision_2] ... ].
std::vector<std::string> ALExtractor::getOutputNames(void)

Gets the list of ALMemory keys modified by the extractor.

Returns:vector of names [ memoryKey_1, memoryKey_2 ... ].