Python example

This is a very small example of a "set" method to ask for a new value (1.0) in 10s ( dcm.getTime(10000) ) for the value of the subDevice red LED on the chest (ChestBoard.Led.Red.Actuator/Value).

import naoqi from naoqi import ALProxy dcm = ALProxy("DCM","127.0.0.1",9559) t = dcm.getTime(0) dcm.set(["ChestBoard/Led/Red/Actuator/Value" , "Merge", [[0.0, t ] ]]) dcm.set(["ChestBoard/Led/Blue/Actuator/Value" , "Merge", [[0.0, t ] ]]) dcm.set(["ChestBoard/Led/Green/Actuator/Value", "Merge", [[0.0, t ] ]]) dcm.set(["ChestBoard/Led/Red/Actuator/Value" , "Merge", [[1.0, t + 3000]] ])

This request will switch off all chest's LEDs and increase value of the red LED from 0.0 to 1.0, in the next 3s.





Copyright © 2010 Aldebaran-Robotics - All rights reserved