ALBasicAwareness API

NAOqi PeoplePerception - Overview | API | Getting started


Namespace : AL


#include <alproxies/albasicawareness>

Methods

void ALBasicAwarenessProxy::startAwareness()

Starts basic awareness.

void ALBasicAwarenessProxy::stopAwareness()

Stops basic awareness.

bool ALBasicAwarenessProxy::isAwarenessRunning()

Gets the status (started or not) of the module.

Returns: Boolean value: true if the module is started, false if it’s stopped or paused.
void ALBasicAwarenessProxy::setStimulusDetectionEnabled(const std::string stimType, const bool enable)

Enables/disables detection of the specified type of stimulus.

Parameters:
  • stimType – Type of stimulus. For further details, see: Types of stimulus.
  • enable – true to enable, false to disable.
bool ALBasicAwarenessProxy::isStimulusDetectionEnabled(const std::string stimType)

Gets status enabled/disabled for the detection of the specified type of stimulus.

Parameters:
Returns:

true if enabled, false if disabled

Note

Throws AL::ALError if setting fails.

void ALBasicAwarenessProxy::setEngagementMode(const std::string& modeName)

Sets the engagement mode.

Parameters:
  • modeName – Name of the engagement mode to be set. For further details, see: Engagement Modes.
std::string ALBasicAwarenessProxy::getEngagementMode()

Gets the current engagement mode. For further details, see: Engagement Modes.

Returns: The engagement mode name.
bool ALBasicAwarenessProxy::engagePerson(const int idPersonToEngage)

Forces the robot to engage a person identified by its PeoplePerception ID.

Parameters:
Returns:

true if the robot succeeded to engage the person, else false.

void ALBasicAwarenessProxy::setTrackingMode(const std::string& trackingMode)

Sets the current tracking Mode.

Parameters:
  • trackingMode – name of the tracking mode. For further details, see: Tracking Modes.
std::string ALBasicAwarenessProxy::getTrackingMode()

Gets the current tracking mode.

Returns: the tracking mode name. For further details, see: Tracking Modes.
void ALBasicAwarenessProxy::setParameter(const std::string& paramName, const AL::ALValue& paramValue)

Sets parameters related to basic awareness features.

Parameters:
  • paramName – name of the parameter, among the following:
  • “LookStimulusSpeed”: speed of head moves when looking at a stimulus (float in ]0;1]),
  • “LookBackSpeed”: speed of head moves when looking back to previous position after false alarm (float in ]0;1]).
Parameters:
  • paramValue – value of the parameter to be set (ALValue).
AL::ALValue ALBasicAwarenessProxy::getParameter(const std::string& paramName)

Gets parameters related to basic awareness features.

Parameters:
  • paramName – name of the parameter, among: “LookStimulusSpeed”, “LookBackSpeed”.
Returns:

value of the parameter (ALValue).

void ALBasicAwarenessProxy::resetAllParameters()

Resets all parameters to their default values.

Events

Event: "ALBasicAwareness/StimulusDetected"
callback(std::string eventName, std::string stimulusName, std::string subscriberIdentifier)

Raised when a stimulus is detected.

Parameters:
  • eventName (std::string) – “ALBasicAwareness/StimulusDetected”
  • stimulusName – Name of the stimulus detected. See the names of the available stimuli in section Stimuli Types.
  • subscriberIdentifier (std::string) –

Note

To know if a person is detected in the general case, use the event HumanTracked rather than the event StimulusDetected with the value People. For example, if the robot detects a person thanks to a sound stimulus, the robot will raise the event StimulusDetected with the value Sound, then recognize the person and raise the event HumanTracked with a positive ID, but the event StimulusDetected won’t be raised with the value People.

Event: "ALBasicAwareness/HumanTracked"
callback(std::string eventName, int humanID, std::string subscriberIdentifier)

Raised when the robot begins to track a person, when the tracked person is lost, or when the tracked person’s ID is updated.

Parameters:
  • eventName (std::string) – “ALBasicAwareness/HumanTracked”
  • humanID – The ID of the currently tracked person. If no person is tracked, the value is -1.
  • subscriberIdentifier (std::string) –
Event: "ALBasicAwareness/HumanLost"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the person tracked can no longer be found for some time.