iCub-main
iCubLogicalJoints.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 /*
4 * Copyright (C) 2010 RobotCub Consortium, European Commission FP6 Project IST-004370
5 * Author: Paul Fitzpatrick, Vadim Tikhanoff
6 * email: paulfitz@alum.mit.edu, vadim.tikhanoff@iit.it
7 * website: www.robotcub.org
8 * Permission is granted to copy, distribute, and/or modify this program
9 * under the terms of the GNU General Public License, version 2 or any
10 * later version published by the Free Software Foundation.
11 *
12 * A copy of the license can be found at
13 * http://www.robotcub.org/icub/license/gpl.txt
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18 * Public License for more details
19 */
20 
21 #ifndef ICUBSIMULATION_ICUBLOGICALJOINTS_INC
22 #define ICUBSIMULATION_ICUBLOGICALJOINTS_INC
23 
24 #include "LogicalJoints.h"
25 #include "OdeLogicalJoint.h"
26 #include "RobotConfig.h"
27 
28 #include <yarp/dev/DeviceDriver.h>
29 
30 #define MAX_PART 10
31 #define MAX_AXIS 40
32 
33 #define PART_ARM_LEFT 1
34 #define PART_ARM_RIGHT 2
35 #define PART_HEAD 3
36 #define PART_HEAD_RAW 9
37 #define PART_LEG_LEFT 4
38 #define PART_LEG_RIGHT 5
39 #define PART_TORSO 6
40 
47 public:
54 
61  virtual LogicalJoint& control(int part, int axis);
62 private:
63  OdeLogicalJoint simControl[MAX_PART][MAX_AXIS];
64 
65  OdeLogicalJoint& getController(int part, int axis) {
66  return simControl[part][axis];
67  }
68 };
69 
70 #endif
Abstract class for mapping from "physical" (simulated) joints in the model to control joints in the I...
Definition: LogicalJoint.h:33
Route control for the robots controlled joints to their implementation.
Definition: LogicalJoints.h:31
Convenience class for mapping from physical ODE joints in the model to control joints in the ICUB spe...
Route control for the iCub's logical joints to their ODE implementation.
virtual LogicalJoint & control(int part, int axis)
Access the ODE control for a logical joint, based on part and axis number.
iCubLogicalJoints(RobotConfig &config)
Constructor.
#define MAX_AXIS
#define MAX_PART