AnalyticalGuess/include/kinematics.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2008 by Neuronics AG *
3  * support@neuronics.ch *
4  ***************************************************************************/
5 
10 #ifndef _ANAGUESS_KINEMATICS_H_
11 #define _ANAGUESS_KINEMATICS_H_
12 
13 //std:
14 #include <string>
15 #include <queue>
16 #include <vector>
17 #include <map>
18 #include <algorithm>
19 
20 #include "exception.h"
21 
22 namespace AnaGuess {
23 
24 const double cTolerance = 0.0001;
25 
29 public:
31  Exception("No solution found", -10) {}
32 
33 };
34 
35 
37 
42 class Kinematics {
43 
44 private:
50  std::vector<double> mSegmentLength;
52  std::vector<double> mAngleOffset;
54  std::vector<double> mAngleStop;
56  std::vector<int> mEncodersPerCycle;
58  std::vector<int> mEncoderOffset;
60  std::vector<int> mRotationDirection;
62  virtual bool initialize() = 0;
63 
64 
65 public:
67  virtual ~Kinematics(){}
68 
70  virtual std::vector<double> getLinkLength() = 0;
72  virtual std::vector<int> getEpc() = 0;
74  virtual std::vector<int> getEncOff() = 0;
76  virtual std::vector<int> getDir() = 0;
78  virtual std::vector<double> getAngOff() = 0;
80  virtual std::vector<double> getAngStop() = 0;
82  virtual std::vector<double> getAngRange() = 0;
84  virtual std::vector<double> getAngMin() = 0;
86  virtual std::vector<double> getAngMax() = 0;
88  virtual bool setLinkLength(const std::vector<double> aLengths) = 0;
90  virtual bool setAngOff(const std::vector<double> aAngOff) = 0;
92  virtual bool setAngStop(const std::vector<double> aAngStop) = 0;
93 
98  virtual bool enc2rad(std::vector<double>& aAngles, const std::vector<int> aEncoders) = 0;
99 
104  virtual bool rad2enc(std::vector<int>& aEncoders, const std::vector<double> aAngles) = 0;
105 
110  virtual bool directKinematics(std::vector<double>& aPosition, const std::vector<double> aAngles) = 0;
111 
118  virtual bool inverseKinematics(std::vector<double>& aAngles, const std::vector<double> aPosition, const std::vector<double> aStartingAngles) = 0;
119 };
121 
122 } // namespace
123 
124 #endif //_ANAGUESS_KINEMATICS_H_
_encT rad2enc(_angleT const &angle, _angleT const &angleOffset, _encT const &epc, _encT const &encOffset, _encT const &rotDir)
std::vector< double > mSegmentLength
Effector segment lengths vector [m].
std::vector< double > mAngleOffset
Angle offset vector [rad].
std::vector< int > mRotationDirection
Rotation direction vector [1|-1].
Base Class for the kinematics implementations.
std::vector< int > mEncodersPerCycle
Encoders per cycle vector.
int mNumberOfMotors
Number of motors of the robot.
int mNumberOfSegments
Number of segments of the robot.
_angleT enc2rad(_encT const &enc, _angleT const &angleOffset, _encT const &epc, _encT const &encOffset, _encT const &rotDir)
virtual ~Kinematics()
Virtual destructor.
std::vector< int > mEncoderOffset
Encoder offset vector.
std::vector< double > mAngleStop
Angle stop vector [rad].


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