KatanaNativeInterface $VERSION$
ikBase.h
Go to the documentation of this file.
1/*
2 * Katana Native Interface - A C++ interface to the robot arm Katana.
3 * Copyright (C) 2005 Neuronics AG
4 * Check out the AUTHORS file for detailed contact information.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/******************************************************************************************************************/
22#ifndef _IKBASE_H_
23#define _IKBASE_H_
24/******************************************************************************************************************/
25
26#include "common/exception.h"
27#include "common/dllexport.h"
28
29#include "KNI/kmlExt.h"
30#include "KNI/kmlCommon.h"
31
33
34#include <vector>
35#include <memory>
36
37/******************************************************************************************************************/
38
39#ifndef TM_ENDLESS
40#define TM_ENDLESS -1
41#endif
42
43
44class DLLDIR_IK CikBase : public CKatana {
45
46 private:
47 std::auto_ptr<KNI::KatanaKinematics> _kinematicsImpl;
50
51 public:
52
53 CikBase() : _kinematicsIsInitialized(false) { };
55
58 void DKApos(double* position);
59
64 void getCoordinates(double& x, double& y, double& z, double& phi, double& theta, double& psi, bool refreshEncoders = true);
65
69 void IKCalculate(double X,
70 double Y,
71 double Z,
72 double Al,
73 double Be,
74 double Ga,
75 std::vector<int>::iterator solution_iter);
76
80 void IKCalculate(double X,
81 double Y,
82 double Z,
83 double Al,
84 double Be,
85 double Ga,
86 std::vector<int>::iterator solution_iter,
87 const std::vector<int>& actualPosition );
88
91 void IKGoto(double X,
92 double Y,
93 double Z,
94 double Al,
95 double Be,
96 double Ga,
97 bool wait = false,
98 int tolerance = 100,
99 long timeout = TM_ENDLESS);
100
103 void moveRobotTo(double x,
104 double y,
105 double z,
106 double phi,
107 double theta,
108 double psi,
109 bool waitUntilReached = false, int waitTimeout = TM_ENDLESS);
110
115 void moveRobotTo( std::vector<double> coordinates, bool waitUntilReached = false, int waitTimeout = TM_ENDLESS);
116
117};
118
119/******************************************************************************************************************/
120#endif //_IKBASE_H_
121/******************************************************************************************************************/
Extended Katana class with additional functions.
Definition: kmlExt.h:64
Definition: ikBase.h:44
void DKApos(double *position)
Returns the current position of the robot in cartesian coordinates.
~CikBase()
Definition: ikBase.h:54
bool _kinematicsIsInitialized
Definition: ikBase.h:48
void moveRobotTo(std::vector< double > coordinates, bool waitUntilReached=false, int waitTimeout=TM_ENDLESS)
This method does the same as the one above and is mainly provided for convenience.
void IKGoto(double X, double Y, double Z, double Al, double Be, double Ga, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Moves to robot to given cartesian coordinates and euler-angles.
void IKCalculate(double X, double Y, double Z, double Al, double Be, double Ga, std::vector< int >::iterator solution_iter)
Calculates a set of encoders for the given coordinates.
void getCoordinates(double &x, double &y, double &z, double &phi, double &theta, double &psi, bool refreshEncoders=true)
Returns the current position of the robot in cartesian coordinates.
void _initKinematics()
CikBase()
Definition: ikBase.h:53
void moveRobotTo(double x, double y, double z, double phi, double theta, double psi, bool waitUntilReached=false, int waitTimeout=TM_ENDLESS)
Moves to robot to given cartesian coordinates and euler-angles.
void IKCalculate(double X, double Y, double Z, double Al, double Be, double Ga, std::vector< int >::iterator solution_iter, const std::vector< int > &actualPosition)
Calculates a set of encoders for the given coordinates.
std::auto_ptr< KNI::KatanaKinematics > _kinematicsImpl
Definition: ikBase.h:47
#define DLLDIR_IK
Definition: dllexport.h:31
#define TM_ENDLESS
timeout symbol for 'endless' waiting
Definition: kmlBase.h:51