Fawkes API  Fawkes Development Version
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 /** Create a new copy of this OpenRaveManipulator instance.
55  * @return A pointer to the copied instance
56  */
59 {
61 }
62 
63 
64 /* ########## various ######### */
65 float
66 OpenRaveManipulatorNeuronicsKatana::angle_OR_to_device(unsigned int number, float angle) const
67 {
68  float _angle;
69 
70  switch( number ) {
71  case 0:
72  _angle = M_PI - angle;
73  break;
74  case 1:
75  _angle = M_PI/2 - angle;
76  break;
77  case 2:
78  _angle = M_PI - angle;
79  break;
80  case 3:
81  _angle = M_PI - angle;
82  break;
83  case 4:
84  _angle = M_PI - angle;
85  break;
86  default:
87  _angle = angle;
88  break;
89  }
90 
91  return _angle;
92 }
93 
94 float
95 OpenRaveManipulatorNeuronicsKatana::angle_device_to_OR(unsigned int number, float angle) const
96 {
97  float _angle;
98 
99  switch( number ) {
100  case 0:
101  _angle = M_PI - angle;
102  break;
103  case 1:
104  _angle = M_PI/2 - angle;
105  break;
106  case 2:
107  _angle = M_PI - angle;
108  break;
109  case 3:
110  _angle = M_PI - angle;
111  break;
112  case 4:
113  _angle = M_PI - angle;
114  break;
115  default:
116  _angle = angle;
117  break;
118  }
119 
120  return _angle;
121 }
122 } // end namespace fawkes
virtual OpenRaveManipulatorPtr copy()
Create a new copy of this OpenRaveManipulator instance.
Fawkes library namespace.
OpenRaveManipulatorNeuronicsKatana(unsigned int count, unsigned int countDevice)
Constructor.
virtual ~OpenRaveManipulatorNeuronicsKatana()
Destructor.
Class containing information about all manipulator motors.
Definition: manipulator.h:35