Overview

ALlauncher allows to link dynamicaly with library, run executable, unload library, check if module is loaded...

Methods

vector<string> launchLocal (const string& moduleName)

Loads dynamicaly a module

moduleName

the name of the modulePack to launch or the name of the python script to evaluate

Returns

list of modules loaded

bool launchExecutable (const string& moduleName)

runs an executable and connect it to current broker (executable)

moduleName

the name of the modulePack to launch or the name of the script file to execute

Returns

true if ok

bool launchScript (const string& moduleName)

runs a script connected the current broker

moduleName

the name of the script to launch (python)

Returns

true if ok

bool launchPythonModule (const string& moduleName)

Import a python module

moduleName

the name of the module to launch

Returns

true if ok

bool isModulePresent (const string& strPartOfModuleName)

Tests the existence of an active module in the global system (in same executable or in another executable of the distributed system)

strPartOfModuleName

a part of the name of the module to test existence

Returns

the returned value is true if this module is present

vector<string> getGlobalModuleList ()

get the list of modules loaded on the robot and connected on the robot

Returns

array of present modules


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.


Example Code

Example in python :

# We assume you have a module called Foo in a foo project,
# hence in a libfoo.so (or foo.dll) library.
launcher = ALProxy('ALLauncher', ip, port)
if not launcher.isModulePresent('Foo'):
  launcher.launchLocal('foo')
foo = ALProxy('ALFoo', ip, port)

# Careful: you have to use the name of the module for isModulePresent,
# but the name of the library for launchLocal

Copyright © 2010 Aldebaran Robotics - All rights reserved