Overview

ALLeds contains helper methods for controlling the Light Emiting Devices (LEDs).

Methods

void createGroup (const string& groupName, const vector<string>& ledNames)

Makes a group name for ease of setting multiple LEDs.

groupName

The name of the group.

ledNames

A vector of the names of the LEDs in the group.

void earLedsSetAngle (const int& degrees, const float& duration, const bool& leaveOnAtEnd)

An animation to show a direction with the ears.

degrees

The angle you want to show in degrees (int). 0 is up, 90 is forwards, 180 is down and 270 is back.

duration

The duration in seconds of the animation.

leaveOnAtEnd

If true the last led is left on at the end of the animation.

void fade (const string& name, const float& intensity, const float& duration)

Sets the intensity of a LED or Group of LEDs within a given time.

name

The name of the LED or Group.

intensity

The intensity of the LED or Group (a value between 0 and 1).

duration

The duration of the fade in seconds

Example in python :

# Example showing how to fade the left eye group to mid-intensity
name = 'LeftEye'
intensity = 0.5
duration = 1.0
proxy.fade(name, intensity, duration)

Example in c++ :

// Example showing how to fade the left eye group to mid-intensity
std::string name = 'LeftEye';
float intensity = 0.5f;
float duration = 1.0f;
proxy.fade(name, intensity, duration);

void fadeListRGB (const string& name, const AL::ALValue& rgbList, const AL::ALValue& timeList)

Chain a list of color for a device, as the motion.doMove command.

name

The name of the LED or Group.

rgbList

List of RGB led value, RGB as seen in hexa-decimal: 0x00RRGGBB.

timeList

List of time to go to given intensity.

void fadeRGB (const string& name, const int& rgb, const float& duration)

Sets the intensity of a led. If the name matches an RGB led, all channels are set to the same value.

name

The name of the LED or Group.

rgb

The RGB value led, RGB as seen in hexa-decimal: 0x00RRGGBB.

duration

Time used to fade in seconds.

AL::ALValue getIntensity (const string& name)

Gets the intensity of a LED or device

name

The name of the LED or Group.

Returns

The intensity of the LED or Group.

vector<string> listLEDs ()

Lists the short LED names.

Returns

A vector of LED names.

vector<string> listLED (const string& arg1)

Lists the devices aliased by a short LED name.

arg1

arg

Returns

A vector of device names.

vector<string> listGroup (const string& groupName)

Lists the devices in the group.

groupName

The name of the Group.

Returns

A vector of string device names.

Example in python :

# Example showing how print a list of the LEDs in a group
groupName = 'AllLeds'
result = proxy.listGroup(groupName)
print '
'.join(result)

Example in c++ :

// Example showing how to get a list of all the LEDs in a group
std::string groupName = 'AllLeds';
std::vector<std::string> result = proxy.listGroup(groupName);

vector<string> listGroups ()

Lists available group names.

Returns

A vector of group names.

Example in python :

# Example showing how to print all groups
result = proxy.listGroups()
print '
'.join(result)

Example in c++ :

// Example showing how to get a list of all groups
std::vector<std::string> result = proxy.listGroups();

void off (const string& name)

Switch to a minimum intensity a LED or Group of LEDs.

name

The name of the LED or Group.

Example in python :

# Example showing how to switch off a group
name = 'FaceLeds'
proxy.off(name)

Example in c++ :

// Example showing how to switch off a group
std::string name = 'FaceLeds';
proxy.off(name);

void on (const string& name)

Switch to a maximum intensity a LED or Group of LEDs.

name

The name of the LED or Group.

Example in python :

# Example showing how to switch on a group
name = 'FaceLeds'
proxy.on(name)

Example in c++ :

// Example showing how to switch on a group
std::string name = 'FaceLeds';
proxy.on(name);

void rasta (const float& duration)

Launch a green/yellow/red rasta animation on all body.

duration

Approximate duration of the animation in seconds.

Example in python :

# Example showing a one second rasta animation
duration = 1.0
proxy.rasta(duration)

Example in c++ :

// Example showing a one second rasta animation
float duration = 1.0f;
proxy.rasta(duration);

void rotateEyes (const int& rgb, const float& timeForRotation, const float& totalDuration)

Launch a rotation using the leds of the eyes.

rgb

the RGB value led, RGB as seen in hexa-decimal: 0x00RRGGBB.

timeForRotation

Approximate time to make one turn.

totalDuration

Approximate duration of the animation in seconds.

void randomEyes (const float& duration)

Launch a random animation in eyes

duration

Approximate duration of the animation in seconds.

void setIntensity (const string& name, const float& intensity)

Sets the intensity of a LED or Group of LEDs.

name

The name of the LED or Group.

intensity

The intensity of the LED or Group (a value between 0 and 1).


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