lmBase.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 _LMBASE_H_
23 #define _LMBASE_H_
24 /********************************************************************************/
25 #include "common/dllexport.h"
26 #include "common/Timer.h"
27 #include "KNI_InvKin/ikBase.h"
28 #include "common/exception.h"
29 #include <vector>
30 #include <cmath>
31 
32 #include "boost/numeric/ublas/matrix.hpp"
33 #include "boost/numeric/ublas/vector.hpp"
34 #include "boost/numeric/ublas/vector_proxy.hpp"
35 #include "boost/numeric/ublas/triangular.hpp"
36 #include "boost/numeric/ublas/lu.hpp"
37 #include "boost/numeric/ublas/io.hpp"
38 
39 /********************************************************************************/
40 
41 
42 //---------------------------------------------------------------------------//
43 
48 
49 
53 public:
54  JointSpeedException() throw():
55  Exception("Joint speed too high", -70) {}
56 };
57 
61 public:
63  Exception("Wait parameter set to false", -71) {}
64 };
65 
66 
67 //---------------------------------------------------------------------------//
68 
73 class DLLDIR_LM CLMBase : public CikBase {
74 
75  private:
78 
79 
90  double totalTime(double distance, double acc, double dec, double vmax);
91 
103  double relPosition(double reltime, double distance, double acc, double dec,
104  double vmax);
105 
122  void splineCoefficients(int steps, double *timearray, double *encoderarray,
123  double *arr_p1, double *arr_p2, double *arr_p3, double *arr_p4);
124 
136  bool checkJointSpeed(std::vector<int> lastsolution,
137  std::vector<int> solution, double time);
138 
148  int getSpeed(int distance, int acceleration, int time);
149 
150 
151  public:
152 
153  CLMBase() : _maximumVelocity(20), _activatePositionController(true) {}
154 
156  void movLM(double X, double Y, double Z,
157  double Al, double Be, double Ga,
158  bool exactflag, double vmax, bool wait=true, int tolerance = 100, long timeout = TM_ENDLESS);
159 
178  void movLM2P(double X1, double Y1, double Z1, double Al1, double Be1,
179  double Ga1, double X2, double Y2, double Z2, double Al2, double Be2,
180  double Ga2, bool exactflag, double vmax, bool wait=true,
181  int tolerance = 100, long timeout = TM_ENDLESS);
182 
201  void movP2P(double X1, double Y1, double Z1, double Ph1, double Th1,
202  double Ps1, double X2, double Y2, double Z2, double Ph2, double Th2,
203  double Ps2, bool exactflag, double vmax, bool wait=true,
204  long timeout = TM_ENDLESS);
205 
206  void setMaximumLinearVelocity(double maximumVelocity);
207  double getMaximumLinearVelocity() const;
208 
212  void setActivatePositionController(bool activate);
213 
216  bool getActivatePositionController();
217 
219  void moveRobotLinearTo(
220  double x, double y, double z,
221  double phi, double theta, double psi,
222  bool waitUntilReached = true,
223  int waitTimeout = TM_ENDLESS);
224 
229  void moveRobotLinearTo(
230  std::vector<double> coordinates,
231  bool waitUntilReached = true,
232  int waitTimeout = TM_ENDLESS);
233 
236  void moveRobotTo(double x, double y, double z,
237  double phi, double theta, double psi,
238  bool waitUntilReached = true, int waitTimeout = TM_ENDLESS);
239 
244  void moveRobotTo(std::vector<double> coordinates, bool waitUntilReached = true, int waitTimeout = TM_ENDLESS);
245 
246 };
247 /********************************************************************************/
248 #endif //_IKBASE_H_
249 /********************************************************************************/
int acceleration
double _maximumVelocity
Definition: lmBase.h:76
CLMBase()
Definition: lmBase.h:153
#define TM_ENDLESS
timeout symbol for &#39;endless&#39; waiting
Definition: kmlBase.h:51
bool _activatePositionController
Definition: lmBase.h:77
#define DLLDIR_LM
Definition: dllexport.h:32
Definition: ikBase.h:49
Linear movement Class.
Definition: lmBase.h:73


kni
Author(s): Martin Günther
autogenerated on Fri Jan 3 2020 04:01:16