KatanaNativeInterface  $VERSION$
KatanaKinematics.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2006 by Tiziano Mueller *
3  * tiziano.mueller@neuronics.ch *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 #ifndef KATANAKINEMATICS_H
21 #define KATANAKINEMATICS_H
22 
23 #include "common/dllexport.h"
24 #include "common/exception.h"
25 
26 #include <vector>
27 
28 
29 namespace KNI {
30 
35 
36 
39 class NoSolutionException : public Exception {
40 public:
41  NoSolutionException() throw():
42  Exception("No solution found", -60) {}
43 
44 };
45 
49 
53 struct DLLDIR_IK KinematicParameters {
54  double angleOffset;
55  double angleStop;
56  int epc;
57  int encOffset;
58  int rotDir;
59 };
60 
64 public:
65  virtual ~KatanaKinematics() {}
66 
67  typedef std::vector<KinematicParameters> parameter_container;
68 
71  typedef std::vector<double> angles;
74  typedef std::vector<double> coordinates;
77  typedef std::vector<double> metrics;
80  typedef std::vector<int> encoders;
81 
85  virtual void init(metrics const& length, parameter_container const& parameters) = 0;
86 
92  virtual void DK(coordinates& solution, encoders const& current_encoders) const = 0;
93 
102  virtual void IK(encoders::iterator solution, coordinates const& pose, encoders const& cur_angles) const = 0;
103 
104 };
105 
106 }
107 
108 #endif
109 
DLLDIR_IK
#define DLLDIR_IK
Definition: dllexport.h:31
dllexport.h
KNI::KatanaKinematics
The base class for all kinematic implementations.
Definition: KatanaKinematics.h:81
KNI::NoSolutionException::NoSolutionException
NoSolutionException()
Definition: KatanaKinematics.h:59
KNI::KatanaKinematics::metrics
std::vector< double > metrics
To store metrics, 'aka' the length's of the different segments of the robot.
Definition: KatanaKinematics.h:95
KNI::KatanaKinematics::parameter_container
std::vector< KinematicParameters > parameter_container
Definition: KatanaKinematics.h:85
KNI
Definition: Timer.h:30
Exception
Definition: exception.h:79
KNI::KatanaKinematics::encoders
std::vector< int > encoders
To store encoders.
Definition: KatanaKinematics.h:98
exception.h
KNI::KatanaKinematics::coordinates
std::vector< double > coordinates
To store coordinates.
Definition: KatanaKinematics.h:92