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 
25 #include "../manipulator.h"
26 
27 #include <cmath>
28 #include <cstdio>
29 
30 namespace fawkes {
31 
32 /** @class OpenRaveManipulatorKatana6M180 <plugins/openrave/manipulators/katana6M180.h>
33  * Class containing information about all katana6M180 motors.
34  * @author Bahram Maleki-Fard
35  */
36 
37 /** Constructor.
38  * @param count number of motors of OpenRAVE model
39  * @param countDevice number of motors of real device
40  */
42  unsigned int countDevice)
43 : OpenRaveManipulator(count, countDevice)
44 {
45 }
46 
47 /** Destructor. */
49 {
50 }
51 
52 /** Create a new copy of this OpenRaveManipulator instance.
53  * @return A pointer to the copied instance
54  */
57 {
59 }
60 
61 /* ########## various ######### */
62 float
63 OpenRaveManipulatorKatana6M180::angle_OR_to_device(unsigned int number, float angle) const
64 {
65  float _angle;
66 
67  switch (number) {
68  case 0: _angle = angle + M_PI; break;
69  case 1: _angle = angle + M_PI / 2; break;
70  case 2: _angle = angle + M_PI; break;
71  case 3: _angle = M_PI - angle; break;
72  case 4: _angle = 1.5 * M_PI - angle; break;
73  default: _angle = angle; break;
74  }
75 
76  return _angle;
77 }
78 
79 float
80 OpenRaveManipulatorKatana6M180::angle_device_to_OR(unsigned int number, float angle) const
81 {
82  float _angle;
83 
84  switch (number) {
85  case 0: _angle = angle - M_PI; break;
86  case 1: _angle = angle - M_PI / 2; break;
87  case 2: _angle = angle - M_PI; break;
88  case 3: _angle = M_PI - angle; break;
89  case 4: _angle = 1.5 * M_PI - angle; break;
90  default: _angle = angle; break;
91  }
92 
93  return _angle;
94 }
95 } // end namespace fawkes
fawkes::RefPtr< OpenRaveManipulator >
fawkes
Fawkes library namespace.
fawkes::OpenRaveManipulatorKatana6M180::copy
virtual OpenRaveManipulatorPtr copy()
Create a new copy of this OpenRaveManipulator instance.
Definition: katana6M180.cpp:56
fawkes::OpenRaveManipulator
Class containing information about all manipulator motors.
Definition: manipulator.h:33
fawkes::OpenRaveManipulatorKatana6M180::OpenRaveManipulatorKatana6M180
OpenRaveManipulatorKatana6M180(unsigned int count, unsigned int countDevice)
Constructor.
Definition: katana6M180.cpp:41
fawkes::OpenRaveManipulatorKatana6M180::~OpenRaveManipulatorKatana6M180
virtual ~OpenRaveManipulatorKatana6M180()
Destructor.
Definition: katana6M180.cpp:48