Overview

Frame manager is used to play choregraphe projects in naoqi. It needs Choregraphe projects in input and will return an ID for each project. It can also only read a given box/timeline in a complex behavior.

Methods

string newBehavior (const string& path, const string& xmlFile)

Creates a new behavior, from a box found in an xml file. Note that you have to give the xml file contents, so this method is not very user friendly. You have to open the file, and send the string that matches the file contents if you are working from a file. You probably want to use newBehaviorFromFile instead.

path

The path to reach the box to instantiate in the project ("" if root).

xmlFile

The choregraphe project (in plain text for the moment).

Returns

return a unique identifier for the created box.

string newBehaviorFromFile (const string& xmlFilePath, const string& path)

Creates a new behavior, from a box found in an xml file stored in the robot.

xmlFilePath

Path to Xml file, ex : "/home/youhou/mybehavior.xar".

path

The path to reach the box to instantiate in the project ("" if root).

Returns

return a unique identifier for the created box, that can be used by playBehavior

string newBehaviorFromChoregraphe ()

Creates a new behavior, from the current Choregraphe behavior (uploaded to /tmp/currentChoregrapheBehavior/behavior.xar).

Returns

return a unique identifier for the created behavior

string createAndPlayTimeline (const string& xmlFile)

Creates and play completely a timeline

xmlFile

The choregraphe project (in plain text for the moment).

Returns

return a unique identifier for the created box that contains the timeline. You must call deleteBehavior on it at some point.

void deleteBehavior (const string& id)

Deletes a behavior (meaning a box). Stop the whole behavior contained in this box first.

id

The id of the box to delete.

void completeBehavior (const string& id)

It will play a behavior and block until the behavior is finished. Note that it can block forever if the behavior output is never called.

id

The id of the box.

void dataChanged (const string& dataName, const AL::ALValue& data, const string& message)

Called by ALMemory when subcription data is updated.

dataName

Name of the subscribed data.

data

Value of the the subscribed data

message

The message give when subscribing.

void playTimeline (const string& id)

Starts playing a timeline contained in a given box. If the box is a flow diagram, it will look for the first onStart input of type Bang, and stimulate it !

id

The id of the box.

void stopTimeline (const string& id)

Stops playing a timeline contained in a given box, at the current frame

id

The id of the box.

void setTimelineFps (const string& id, const int& fps)

Sets the FPS of a given timeline

id

The id of the timeline.

fps

The FPS to set.

int getTimelineFps (const string& id)

Gets the FPS of a given timeline

id

The id of the timeline.

Returns

Returns the timeline's FPS.

void playBehavior (const string& id)

Starts a behavior

id

The id of the box.

void exitBehavior (const string& id)

Exit the reading of a timeline contained in a given box

id

The id of the box.

float getMotionLength (const string& id)

Returns in seconds, the duration of a given movement stored in a box. Returns 0 if the behavior has no motion layers.

id

The id of the box.

Returns

Returns the time in seconds.

void gotoAndStop (const string& id, const string& frame)

Goes to a certain frame and pause

id

The id of the box containing the box.

frame

The behavior frame name we want the timeline to go to. If will jump to the starting index of the name given.

void gotoAndStop (const string& id, const int& frame)

Goes to a certain frame and pause

id

The id of the box containing the box.

frame

The frame we want the timeline to go to.

void gotoAndPlay (const string& id, const string& frame)

Goes to a certain frame and continue playing

id

The id of the box containing the box.

frame

The behavior frame name we want the timeline to go to. If will jump to the starting index of the name given.

void gotoAndPlay (const string& id, const int& frame)

Goes to a certain frame and continue playing

id

The id of the box containing the box.

frame

The frame we want the timeline to go to.

void cleanBehaviors ()

Stop playing any behavior in FrameManager, and delete all of them.

string getBehaviorPath (const string& id)

Returns a playing behavior absolute path.

id

The id of the behavior.

Returns

Returns the absolute path of given behavior.

void onRubyError (const string& boxname, const string& methodname, const string& error)

Transmit Ruby error to Choregraphe or logger. Should not be called manually.

boxname

Name of the box raising the error

methodname

Name of the method

error

Error string

void onPythonError (const string& boxname, const string& methodname, const string& error)

Transmit Python error to Choregraphe or logger. Should not be called manually.

boxname

Name of the box raising the error

methodname

Name of the method

error

Error string

void onUrbiError (const string& boxname, const string& methodname, const string& location, const string& error)

Transmit Urbi error to Choregraphe or logger. Should not be called manually.

boxname

Name of the box raising the error

methodname

Name of the method

location

Location of the error

error

Error string

void onRubyPrint (const string& message)

Print Ruby message in Choregraphe or logger. Should not be called manually.

message

Message to print

void onPythonPrint (const string& message)

Print Python message in Choregraphe or logger. Should not be called manually.

message

Message to print

void playDefaultProject ()

Play default behavior

void onUrbiPrint (const string& message)

Print Urbi message in Choregraphe or logger. Should not be called manually.

message

Message to print


Methods inherited from ALModule

void exit ()

Exits and unregisters the module.

string version ()

Returns the version of the module.

Returns

A string containing the version of the module.

bool ping ()

Just a ping. Always returns true

Returns

returns true

vector<string> getMethodList ()

Retrieves the module's method list.

Returns

An array of method names.

AL::ALValue getMethodHelp (const string& methodName)

Retrieves a method's description.

methodName

The name of the method.

Returns

A structure containing the method's description.

AL::ALValue getModuleHelp ()

Retrieves the module's description.

Returns

A structure describing the module.

string getBrokerName ()

Gets the name of the parent broker.

Returns

The name of the parent broker.

string getUsage (const string& name)

Gets the method usage string. This summarise how to use the method.

name

The name of the method.

Returns

A string that summarises the usage of the method.


Copyright © 2010 Aldebaran Robotics - All rights reserved