KatanaNativeInterface $VERSION$
KatanaKinematics6M90T.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 KNIKatanaKinematics6M90T_H
21#define KNIKatanaKinematics6M90T_H
22
23#include "common/dllexport.h"
24
27
28#include <vector>
29
30
31namespace KNI {
32
40
41public:
42
43 void init(metrics const& length, parameter_container const& parameters);
44
45 // strong guarantee provided here:
46 void DK(coordinates& solution, encoders const& current_encoders) const;
47 void IK(encoders::iterator solution, coordinates const& pose, encoders const& cur_angles) const;
48
49
50private:
51
52 struct position {
53 double x;
54 double y;
55 double z;
56 };
57
58 struct angles_calc {
59 double theta1;
60 double theta2;
61 double theta3;
62 double theta4;
63 double theta5;
64 double theta6;
65 double theta234;
66 double b1;
67 double b2;
68 double costh3;
69 };
70
71 typedef std::vector<angles_calc> angles_container;
72
75
76 static const double _tolerance; // initialized in .cpp
77 static const int _nrOfPossibleSolutions;
78
79 void _setLength(metrics const& length) { _length = length; }
80 void _setParameters(parameter_container const& parameters) { _parameters = parameters; }
81
82 void IK_theta234theta5(angles_calc& angle, const position &p_gr) const;
83 void IK_b1b2costh3_6MS(angles_calc &a, const position &p) const;
84
85 void thetacomp(angles_calc &a, const position &p_m, const coordinates& pose) const;
86
87 bool angledef(angles_calc &a) const;
88
89 bool GripperTest(const position &p_gr, const angles_calc &angle) const;
90 bool AnglePositionTest(const angles_calc &a) const;
91 bool PositionTest6MS(const double& theta1, const double& theta2, const double& theta3, const double& theta234, const position &p) const;
92
93 double findFirstEqualAngle(const angles& v1, const angles& v2) const;
94
95};
96
97
98
99
100
101}
102
103#endif
void IK_theta234theta5(angles_calc &angle, const position &p_gr) const
void _setParameters(parameter_container const &parameters)
void DK(coordinates &solution, encoders const &current_encoders) const
Direct Kinematic.
void thetacomp(angles_calc &a, const position &p_m, const coordinates &pose) const
void init(metrics const &length, parameter_container const &parameters)
Initialize the parameters for the calculations.
double findFirstEqualAngle(const angles &v1, const angles &v2) const
static const int _nrOfPossibleSolutions
bool AnglePositionTest(const angles_calc &a) const
bool GripperTest(const position &p_gr, const angles_calc &angle) const
std::vector< angles_calc > angles_container
void IK(encoders::iterator solution, coordinates const &pose, encoders const &cur_angles) const
Inverse Kinematic.
bool angledef(angles_calc &a) const
void _setLength(metrics const &length)
bool PositionTest6MS(const double &theta1, const double &theta2, const double &theta3, const double &theta234, const position &p) const
void IK_b1b2costh3_6MS(angles_calc &a, const position &p) const
The base class for all kinematic implementations.
std::vector< double > coordinates
To store coordinates.
std::vector< double > angles
Being used to store angles (in radian).
std::vector< KinematicParameters > parameter_container
std::vector< int > encoders
To store encoders.
std::vector< double > metrics
To store metrics, 'aka' the length's of the different segments of the robot.
#define DLLDIR_IK
Definition: dllexport.h:31
Definition: Timer.h:30