Fading

This can be done with the "fade" command.

Prototype:

/** setIntensity. Sets the intensity of a LED or group of LEDs. * @param pName The name of the led, RGB led, or group * @param pIntensity The intensity between 0-1 * @param pDuration : The duration of the fade in seconds */ void fade( const std::string& pName, const float& pIntensity, const float& pDuration);

Python:

# Replace "127.0.0.1" with the IP of your NAO leds = ALProxy("ALLeds","127.0.0.1",9559) # Fade the ears to on then off, using 2 seconds for each fade leds.fade("EarLeds",1.0,2.0) leds.fade("EarLeds",0.0,2.0)

C++:

ALPtr<ALLedsProxy> leds = ALPtr<ALLedsProxy>(new ALLedsProxy(getParentBroker())); // Fade the ears to on then off, using 2 seconds for each fade leds.fade("EarLeds",1.0f,2.0f); leds.fade("EarLeds",0.0f,2.0f);





Copyright © 2010 Aldebaran-Robotics - All rights reserved