C++ 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).

// Program running in a module. Do not forget the #include "dcmproxy.h" try { DCMProxy* dcm = new DCMProxy(pBroker); ALValue commands; commands.arraySetSize(3); commands[0] = string("ChestBoard/Led/Red/Actuator/Value"); commands[1] = string("Merge"); commands[2].arraySetSize(1); commands[2][0].arraySetSize(2); commands[2][0][0] = 1.0; commands[2][0][1] = dcm->getTime(10000); dcm->set(commands); } AL_CATCH_ERR(return false;);

This request, and if the previous order was 0, you'll see the increase of the value of the LED from 0 to 1.0, in the next 10s.





Copyright © 2010 Aldebaran-Robotics - All rights reserved