iCub-main
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2011 Department of Robotics Brain and Cognitive Sciences - Istituto Italiano di Tecnologia
3 * Author: Ugo Pattacini
4 * email: ugo.pattacini@iit.it
5 * Permission is granted to copy, distribute, and/or modify this program
6 * under the terms of the GNU General Public License, version 2 or any
7 * later version published by the Free Software Foundation.
8 *
9 * A copy of the license can be found at
10 * http://www.robotcub.org/icub/license/gpl.txt
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15 * Public License for more details
16*/
17
18#include <yarp/os/all.h>
19#include <yarp/dev/all.h>
20#include <fakeMotorDevice.h>
21
22#include <iostream>
23#include <iomanip>
24
25using namespace std;
26using namespace yarp::os;
27using namespace yarp::dev;
28
35class Launcher: public RFModule
36{
37 PolyDriver driver;
38
39public:
40 /**********************************************************/
41 bool configure(ResourceFinder &rf)
42 {
43 Property options;
44 options.put("device","fakeyServer");
45 options.put("local","/fake_robot/fake_part");
46
47 driver.open(options);
48 return driver.isValid();
49 }
50
51 /**********************************************************/
52 bool close()
53 {
54 if (driver.isValid())
55 driver.close();
56
57 return true;
58 }
59
60 /**********************************************************/
61 double getPeriod() { return 1.0; }
62 bool updateModule() { return true; }
63};
64
65
66/**********************************************************/
67int main()
68{
69 Network yarp;
70 if (!yarp.checkNetwork())
71 {
72 cout<<"Error: yarp server does not seem available"<<endl;
73 return 1;
74 }
75
76 // register here the new yarp devices
77 // for dealing with the fake robot
79
80 Launcher launcher;
81 ResourceFinder rf;
82 return launcher.runModule(rf);
83}
84
85
86
This container class launches the server part of the fake motor device in order to simulate a robot c...
Definition main.cpp:36
bool close()
Definition main.cpp:52
double getPeriod()
Definition main.cpp:61
bool updateModule()
Definition main.cpp:62
bool configure(ResourceFinder &rf)
Definition main.cpp:41
void registerFakeMotorDevices()
Register new yarp devices for fake motor handling.
int main()
Definition main.cpp:67
Copyright (C) 2008 RobotCub Consortium.