ALBehaviorManager API

NAOqi Core - Overview | API


Namespace : AL

#include <alproxies/albehaviormanagerproxy.h>

Event list

  • ALBehaviorManager/BehaviorAdded()
  • ALBehaviorManager/BehaviorRemoved()
  • ALBehaviorManager/BehaviorUpdated()
  • BehaviorsRun()

Methods

void ALBehaviorManagerProxy::addDefaultBehavior(const std::string& prefixedBehavior)

Set the given behavior as default

Parameters:
  • behavior – Behavior name.
std::vector<std::string> ALBehaviorManagerProxy::getBehaviorNames()

Deprecated since version 1.14: use ALBehaviorManagerProxy::getInstalledBehaviors() instead

Get behaviors

Returns:Returns the list of behaviors prefixed by their type (User/ or System/).
std::vector<std::string> ALBehaviorManagerProxy::getDefaultBehaviors()

Get default behaviors

Returns:Return default behaviors
std::vector<std::string> ALBehaviorManagerProxy::getInstalledBehaviors()
Returns:Returns the behaviors list
std::vector<std::string> ALBehaviorManagerProxy::getRunningBehaviors()

Get running behaviors

Returns:Return running behaviors
std::vector<std::string> ALBehaviorManagerProxy::getSystemBehaviorNames()

Get system behaviors

Returns:Returns the list of system behaviors prefixed by System/.
std::vector<std::string> ALBehaviorManagerProxy::getUserBehaviorNames()

Get user’s behaviors

Deprecated since version 1.14: use ALBehaviorManagerProxy::getInstalledBehaviors() instead

Returns:Returns the list of user’s behaviors prefixed by User/.
bool ALBehaviorManagerProxy::installBehavior(const std::string& absolutePath, const std::string& localPath, const bool& overwrite)

There are two overloads of this function:

Install a behavior.

Check and take the behavior found at the given absolute path and import it to the given local path, relative to behaviors path.

On success, behavior added signal is emitted.

Parameters:
  • absolutePath – A path on the local file system of a behavior to install.
  • localPath – The destination path relative to behaviors path.
  • overwrite – Whether to replace existing behaviors if present.
Returns:

true on success, false otherwise.

bool ALBehaviorManagerProxy::installBehavior(const std::string& localPath)

Install a behavior.

Check the given local path for a valid behavior.

On success, behavior added or updated signal is emitted.

Parameters:
  • localPath – The relative path of the behavior.
Returns:

true on success, false otherwise.

bool ALBehaviorManagerProxy::isBehaviorInstalled(const std::string& name)
Parameters:
  • name – The behavior directory name
Returns:

Returns true if it is a valid behavior

bool ALBehaviorManagerProxy::isBehaviorPresent(const std::string& prefixedBehavior)

Deprecated since version 1.14: use ALBehaviorManagerProxy::isBehaviorInstalled() instead

Tell if the supplied name corresponds to an existing behavior.

Parameters:
  • prefixedBehavior – Prefixed behavior.
Returns:

Returns true if it is an existing behavior

bool ALBehaviorManagerProxy::isBehaviorRunning(const std::string& name)

Tell if supplied name corresponds to a running behavior

Parameters:
  • name – Behavior name.
Returns:

Returns true if the name supplied is a running behavior

void ALBehaviorManagerProxy::playDefaultProject()

Play default behaviors

bool ALBehaviorManagerProxy::preloadBehavior(const std::string& name)

Load a behavior

Parameters:
  • name – Behavior name.
Returns:

Returns true if it was successfully loaded.

bool ALBehaviorManagerProxy::removeBehavior(const std::string& name)

Remove a behavior from the filesystem

Parameters:
  • name – Behavior name.
Returns:

Return true if succeeded, else false

void ALBehaviorManagerProxy::removeDefaultBehavior(const std::string& name)

Remove the given behavior from the default behaviors

Parameters:
  • name – Behavior name.
void ALBehaviorManagerProxy::runBehavior(const std::string& name)

Run a behavior

Parameters:
  • name – Behavior name.
void ALBehaviorManagerProxy::stopAllBehaviors()

Stop all behaviors

void ALBehaviorManagerProxy::stopBehavior(const std::string& name)

Stop a behavior

Parameters:
  • name – Behavior name.

Events

ALBehaviorManager/BehaviorAdded(const std::string& behavior)

Raised when a behavior is installed.

Parameters:
  • eventName (std::string) – “None”
  • behavior – the name of the behavior installed
  • subscriberIdentifier (std::string) –
ALBehaviorManager/BehaviorRemoved(const std::string& behavior)

Raised when a behavior is removed.

Parameters:
  • eventName (std::string) – “None”
  • behavior – the name of the behavior removed
  • subscriberIdentifier (std::string) –
ALBehaviorManager/BehaviorUpdated(const std::string& behavior)

Raised when a behavior is updated.

Parameters:
  • eventName (std::string) – “None”
  • behavior – the name of the behavior updated
  • subscriberIdentifier (std::string) –
Event: "BehaviorsRun"
callback(std::string eventName, const std::vector<std::string>& runningBehaviorList, std::string subscriberIdentifier)

Raised when the list of running behaviors change.

Parameters:
  • eventName (std::string) – “BehaviorsRun”
  • runningBehaviorList – list of all running behaviors
  • subscriberIdentifier (std::string) –