Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
neuronics_katana.cpp
1 
2 /***************************************************************************
3  * neuronics_katana.cpp - Fawkes to OpenRAVE Neuronics Katana6M180 Manipulator Data
4  *
5  * Created: Thu Sep 08 15:34:52 2011
6  * Copyright 2011 Bahram Maleki-Fard, AllemaniACs RoboCup Team
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #include "neuronics_katana.h"
24 #include "../manipulator.h"
25 
26 #include <cmath>
27 #include <cstdio>
28 
29  namespace fawkes {
30 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 /** @class OpenRaveManipulatorNeuronicsKatana <plugins/openrave/manipulators/neuronics_katana.h>
35  * Class containing information about all neuronics-katana motors.
36  * It is the Katana6M180 type. Model is provided by OpenRAVE.
37  * @author Bahram Maleki-Fard
38  */
39 
40 /** Constructor.
41  * @param count number of motors of OpenRAVE model
42  * @param countDevice number of motors of real device
43  */
44 OpenRaveManipulatorNeuronicsKatana::OpenRaveManipulatorNeuronicsKatana(unsigned int count, unsigned int countDevice) :
45  OpenRaveManipulator( count, countDevice )
46 {
47 }
48 
49 /** Destructor. */
51 {
52 }
53 
54 
55 
56 
57 /* ########## various ######### */
58 /** Transform single OpenRAVE motor angle to real device angle
59  * @param number motor number of real device
60  * @param angle motor angle of OpenRAVE model
61  * @return transformed angle
62  */
63 float
64 OpenRaveManipulatorNeuronicsKatana::angle_OR_to_device(unsigned int number, float angle) const
65 {
66  float _angle;
67 
68  switch( number ) {
69  case 0:
70  _angle = M_PI - angle;
71  break;
72  case 1:
73  _angle = M_PI/2 - angle;
74  break;
75  case 2:
76  _angle = M_PI - angle;
77  break;
78  case 3:
79  _angle = M_PI - angle;
80  break;
81  case 4:
82  _angle = M_PI - angle;
83  break;
84  default:
85  _angle = angle;
86  break;
87  }
88 
89  return _angle;
90 }
91 
92 /** Transform single device motor angle to OpenRAVE angle
93  * @param number motor number of real device
94  * @param angle motor angle of real device
95  * @return transformed angle
96  */
97 float
98 OpenRaveManipulatorNeuronicsKatana::angle_device_to_OR(unsigned int number, float angle) const
99 {
100  float _angle;
101 
102  switch( number ) {
103  case 0:
104  _angle = M_PI - angle;
105  break;
106  case 1:
107  _angle = M_PI/2 - angle;
108  break;
109  case 2:
110  _angle = M_PI - angle;
111  break;
112  case 3:
113  _angle = M_PI - angle;
114  break;
115  case 4:
116  _angle = M_PI - angle;
117  break;
118  default:
119  _angle = angle;
120  break;
121  }
122 
123  return _angle;
124 }
125 } // end namespace fawkes
virtual ~OpenRaveManipulatorNeuronicsKatana()
Destructor.
Class containing information about all manipulator motors.
Definition: manipulator.h:35