ALSensors API

NAOqi Sensors - Overview | API


Namespace : AL

#include <alproxies/alsensorsproxy.h>

Methods

int ALSensorsProxy::getCurrentPeriod()

Gets the current period.

Returns:Refresh period (in milliseconds).
float ALSensorsProxy::getCurrentPrecision()

Gets the current precision.

Returns:Precision of the extractor.
int ALSensorsProxy::getMyPeriod(const std::string& name)

Gets the period for a specific subscription.

Parameters:
  • name – Name of the module which has subscribed.
Returns:

Refresh period (in milliseconds).

float ALSensorsProxy::getMyPrecision(const std::string& name)

Gets the precision for a specific subscription.

Parameters:
  • name – name of the module which has subscribed
Returns:

precision of the extractor

std::vector<std::string> ALSensorsProxy::getOutputNames()

Get the list of values updated in ALMemory.

Returns:Array of values updated by this extractor in ALMemory
AL::ALValue ALSensorsProxy::getSubscribersInfo()

Gets the parameters given by the module.

Returns:Array of names and parameters of all subscribers.
void ALSensorsProxy::run()

Monitors sensors.

void ALSensorsProxy::subscribe(const std::string& name, const int& period, const float& precision)

Subscribes to the extractor. This causes the extractor to start writing information to memory using the keys described by getOutputNames(). These can be accessed in memory using ALMemory.getData(“keyName”). In many cases you can avoid calling subscribe on the extractor by just calling ALMemory.subscribeToEvent() supplying a callback method. This will automatically subscribe to the extractor for you.

Parameters:
  • name – Name of the module which subscribes.
  • period – Refresh period (in milliseconds) if relevant.
  • precision – Precision of the extractor if relevant.
void ALSensorsProxy::subscribe(const std::string& name)

Subscribes to the extractor. This causes the extractor to start writing information to memory using the keys described by getOutputNames(). These can be accessed in memory using ALMemory.getData(“keyName”). In many cases you can avoid calling subscribe on the extractor by just calling ALMemory.subscribeToEvent() supplying a callback method. This will automatically subscribe to the extractor for you.

Parameters:
  • name – Name of the module which subscribes.
void ALSensorsProxy::unsubscribe(const std::string& name)

Unsubscribes from the extractor.

Parameters:
  • name – Name of the module which had subscribed.
void ALSensorsProxy::updatePeriod(const std::string& name, const int& period)

Updates the period if relevant.

Parameters:
  • name – Name of the module which has subscribed.
  • period – Refresh period (in milliseconds).
void ALSensorsProxy::updatePrecision(const std::string& name, const float& precision)

Updates the precision if relevant.

Parameters:
  • name – Name of the module which has subscribed.
  • precision – Precision of the extractor.

Events

Event: "BodyStiffnessChanged"
callback(std::string eventName, int val, std::string subscriberIdentifier)

Raised when the body stiffness (average of all joints) have significantly changed.

Parameters:
  • eventName (std::string) – “BodyStiffnessChanged”
  • val
    0 means that average of stiffness is less than 0.05
    1 means that average of stiffness is betwwen 0.05 and 0.95
    2 means that average of stiffness is greater 0.95
  • subscriberIdentifier (std::string) –