Activity

What is an Activity

An Activity is a specific Behavior able to run in the ALAutonomousLife framework.

For further details, see: nao Life and Applications.

There are two kinds of activity:

  • Solitary activity:

    Purpose: intended to prepare, wait for, and encourage entering the interactive state. Design constrains: May be interrupted for an Interactive Activity at any time.

  • Interactive activity:

    Purpose: an Activity should be Interactive if human interaction is required for it to function. Design constrains: will not be interrupted by any other activity, but have to quit properly in order to give the focus back.

Creating an Activity

To create an Activity:

  1. Create a new Application containg at least one Behavior.
  2. Set the Project Properties as follows:

For an Interactive Activity

Step Action
Set the Nature of the Behavior to: “Interactive”.
If you want the activity to be launchable by the default dialog activity, set also the Name, Tags, and Trigger Sentences.
If you want the activity to be autonomously launched by ALAutonomousLife, set the Launch trigger condition field, using Launch trigger conditions.

For a Solitary Activity

Step Action
Set the Nature of the Behavior to: “Solitary”.

Set the Launch trigger condition field, using Launch trigger conditions.

This will allow it to be autonomously launched by ALAutonomousLife.

You can also follow the tutorial: Creating a Solitary activity.

Activity - Best practices

First check the best practices of Application.

Basic Awareness and Breathing

The developer should assume that ALBasicAwareness and ALMotion breath services are already started when their Activity is started. These two services help smooth the transition between activities, and to help ease the developer from re-implementing these features into each of their activities in different ways.

Stopping the services for the purpose of managing motor control is not necessary:

The developer may of course stop/start/customize ALBasicAwareness and ALMotion breath at any time during their Activity. The services will be resumed and reset when an Activity exits.

It may be desirable to change the parameters of ALBasicAwareness, or temporarily stop it to reclaim CPU.

For further details see: ALBasicAwareness and breath.

Exiting an activity

An activity should always finish: in all cases, there should be a path to the output of your Behavior. If it never finishes, the robot will be stuck forever in the activity.