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
25#include "../manipulator.h"
26
27#include <cmath>
28#include <cstdio>
29
30namespace fawkes {
31
32/** @class OpenRaveManipulatorNeuronicsKatana <plugins/openrave/manipulators/neuronics_katana.h>
33 * Class containing information about all neuronics-katana motors.
34 * It is the Katana6M180 type. Model is provided by OpenRAVE.
35 * @author Bahram Maleki-Fard
36 */
37
38/** Constructor.
39 * @param count number of motors of OpenRAVE model
40 * @param countDevice number of motors of real device
41 */
43 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/* ########## various ######### */
63float
64OpenRaveManipulatorNeuronicsKatana::angle_OR_to_device(unsigned int number, float angle) const
65{
66 float _angle;
67
68 switch (number) {
69 case 0: _angle = M_PI - angle; break;
70 case 1: _angle = M_PI / 2 - angle; break;
71 case 2: _angle = M_PI - angle; break;
72 case 3: _angle = M_PI - angle; break;
73 case 4: _angle = M_PI - angle; break;
74 default: _angle = angle; break;
75 }
76
77 return _angle;
78}
79
80float
81OpenRaveManipulatorNeuronicsKatana::angle_device_to_OR(unsigned int number, float angle) const
82{
83 float _angle;
84
85 switch (number) {
86 case 0: _angle = M_PI - angle; break;
87 case 1: _angle = M_PI / 2 - angle; break;
88 case 2: _angle = M_PI - angle; break;
89 case 3: _angle = M_PI - angle; break;
90 case 4: _angle = M_PI - angle; break;
91 default: _angle = angle; break;
92 }
93
94 return _angle;
95}
96} // end namespace fawkes
OpenRaveManipulatorNeuronicsKatana(unsigned int count, unsigned int countDevice)
Constructor.
virtual OpenRaveManipulatorPtr copy()
Create a new copy of this OpenRaveManipulator instance.
virtual ~OpenRaveManipulatorNeuronicsKatana()
Destructor.
Class containing information about all manipulator motors.
Definition: manipulator.h:33
Fawkes library namespace.