Fawkes API  Fawkes Development Version
katana6M180.cpp
1 
2 /***************************************************************************
3  * katana6M180.cpp - Fawkes to OpenRAVE Katana6M180 Manipulator Data
4  *
5  * Created: Thu Sep 16 14:50:34 2010
6  * Copyright 2010 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 "katana6M180.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 OpenRaveManipulatorKatana6M180 <plugins/openrave/manipulators/katana6M180.h>
35  * Class containing information about all katana6M180 motors.
36  * @author Bahram Maleki-Fard
37  */
38 
39 /** Constructor.
40  * @param count number of motors of OpenRAVE model
41  * @param countDevice number of motors of real device
42  */
43 OpenRaveManipulatorKatana6M180::OpenRaveManipulatorKatana6M180(unsigned int count, unsigned int countDevice) :
44  OpenRaveManipulator( count, countDevice )
45 {
46 }
47 
48 /** Destructor. */
50 {
51 }
52 
53 /** Create a new copy of this OpenRaveManipulator instance.
54  * @return A pointer to the copied instance
55  */
58 {
60 }
61 
62 
63 /* ########## various ######### */
64 float
65 OpenRaveManipulatorKatana6M180::angle_OR_to_device(unsigned int number, float angle) const
66 {
67  float _angle;
68 
69  switch( number ) {
70  case 0:
71  _angle = angle + M_PI;
72  break;
73  case 1:
74  _angle = angle + M_PI/2;
75  break;
76  case 2:
77  _angle = angle + M_PI;
78  break;
79  case 3:
80  _angle = M_PI - angle;
81  break;
82  case 4:
83  _angle = 1.5*M_PI - angle;
84  break;
85  default:
86  _angle = angle;
87  break;
88  }
89 
90  return _angle;
91 }
92 
93 float
94 OpenRaveManipulatorKatana6M180::angle_device_to_OR(unsigned int number, float angle) const
95 {
96  float _angle;
97 
98  switch( number ) {
99  case 0:
100  _angle = angle - M_PI;
101  break;
102  case 1:
103  _angle = angle - M_PI/2;
104  break;
105  case 2:
106  _angle = angle - M_PI;
107  break;
108  case 3:
109  _angle = M_PI - angle;
110  break;
111  case 4:
112  _angle = 1.5*M_PI - angle;
113  break;
114  default:
115  _angle = angle;
116  break;
117  }
118 
119  return _angle;
120 }
121 } // end namespace fawkes
Fawkes library namespace.
Class containing information about all manipulator motors.
Definition: manipulator.h:35
virtual OpenRaveManipulatorPtr copy()
Create a new copy of this OpenRaveManipulator instance.
Definition: katana6M180.cpp:57
virtual ~OpenRaveManipulatorKatana6M180()
Destructor.
Definition: katana6M180.cpp:49
OpenRaveManipulatorKatana6M180(unsigned int count, unsigned int countDevice)
Constructor.
Definition: katana6M180.cpp:43