anyKode Marilou
|
Air pressure management.
class DeviceAirPressure : public Device;
ModaCpp.h
The DeviceAirPressure class do not have to be even instanciated by the program itself : it must be obtained by QueryDeviceAirPressure of the class RobotPHX.
The various parameters passed to the functions of access to the device are interpreted and modified if necessary in order to respect the constraints imposed in modeling.
//Sample gets the air pressure device from a cone zone then apply pressure #include "stdafx.h" #include "Modacpp.h" #include "conio.h" #define MODASERVER "localhost" #define MYROBOTNAME "/" int main(int argc, char* argv[]) { ModaCPP::Connection *connection=new ModaCPP::Connection(true); //Try connect to MODA server if(connection->Connect(MODASERVER)) { _cprintf("Connection ok to moda server\r\n"); //Find the robot ModaCPP::RobotPHX *phx=connection->QueryRobotPHX(MYROBOTNAME); if(phx) { _cprintf("robot found\r\n"); ModaCPP::DeviceAirPressure *pDevice=phx->QueryDeviceAirPressure("zone0/air"); if(pDevice) { _cprintf("device found\r\n"); pDevice->GoForce(50); connection->Sleep(2000); pDevice->GoForce(-50); connection->Sleep(4000); pDevice->GoForce(50); } } else { _cprintf("robot not found\r\n"); } } else { _cprintf("Unable to connect to moda server\r\n"); } //Disconnect & delete connection->Disconnect(); delete connection; _getch(); return 0; }
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
|
What do you think about this topic? Send feedback!
|