What is an Activity ¶
An Activity is a specific Behavior able to run in the ALAutonomousLife framework.
For further details, see: Understanding Autonomous Life settings.
There are two kinds of 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.
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:
- Create a new Project containing at least one Behavior.
- In the Project Properties, set the Behavior properties as follows:
For an Interactive Activity ¶
|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.|
You can also follow the tutorial: Creating an Interactive activity.
Activity - Best practices ¶
First check the best practices of Application.
Basic Awareness and Autonomous Moves ¶
The developer should assume that ALBasicAwareness and ALAutonomousMoves services are already started when an 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 ALAutonomousMoves at any time during an Activity. The services will be resumed and reset by ALAutonomousLife when an Activity exits.
It may be desirable to change the parameters of ALBasicAwareness, or temporarily stop it to reclaim CPU.
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.