icub-basic-demos
robot_interfaces.h
1 /*
2  * Copyright (C) 2011 Department of Robotics Brain and Cognitive Sciences - Istituto Italiano di Tecnologia
3  * Author: Marco Randazzo
4  * email: marco.randazzo@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 #ifndef ROBOT_INTERFACES_H
19 #define ROBOT_INTERFACES_H
20 
21 #include <yarp/dev/all.h>
22 #include <yarp/dev/ControlBoardInterfaces.h>
23 #include <iCub/skinDynLib/common.h>
24 #include <map>
25 #include <vector>
26 
27 class robot_interfaces
28 {
29  public:
30 
31  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IPositionControl*> ipos;
32  std::map<iCub::skinDynLib::BodyPart, yarp::dev::ITorqueControl*> itrq;
33  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IImpedanceControl*> iimp;
34  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IControlMode*> icmd;
35  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IInteractionMode*> iint;
36  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IEncoders*> ienc;
37  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IPidControl*> ipid;
38  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IPositionDirect*> idir;
39  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IVelocityControl*> ivel;
40  std::map<iCub::skinDynLib::BodyPart, yarp::dev::IAmplifierControl*> iamp;
41 
42  std::map<iCub::skinDynLib::BodyPart, yarp::os::Property> options;
43  std::map<iCub::skinDynLib::BodyPart, yarp::dev::PolyDriver*> dd;
44 
45  // *** CONSTRUCTORS ***
49  robot_interfaces();
50  robot_interfaces(iCub::skinDynLib::BodyPart bp1);
51  robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2);
52  robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2, iCub::skinDynLib::BodyPart bp3);
53  robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2, iCub::skinDynLib::BodyPart bp3,
54  iCub::skinDynLib::BodyPart bp4);
55  robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2, iCub::skinDynLib::BodyPart bp3,
56  iCub::skinDynLib::BodyPart bp4, iCub::skinDynLib::BodyPart bp5);
57  robot_interfaces(iCub::skinDynLib::BodyPart *bps, int size);
58 
59  bool init();
60 
61 private:
62  std::vector<iCub::skinDynLib::BodyPart> bodyParts; // list of the body parts for which the interfaces are open
63 };
64 
65 #endif
66