kmlBase.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 
25 //--------------------------------------------------------------------------//
26 #ifndef _KMLBASE_H_
27 #define _KMLBASE_H_
28 //--------------------------------------------------------------------------//
29 #include "common/dllexport.h"
30 
31 #include "KNI/cplBase.h"
32 #include "KNI/kmlCommon.h"
33 #include "KNI/kmlMotBase.h"
34 #include "KNI/kmlSctBase.h"
35 
36 #include "KNI/cdlCOM.h"
37 #include "KNI/cdlCOMExceptions.h"
38 
39 
40 //--------------------------------------------------------------------------//
42 #define K400_OLD_PROTOCOL_THRESHOLD 3
43 
44 #if !defined (BYTE_DECLARED)
45 #define BYTE_DECLARED
46 typedef unsigned char byte;
47 #endif
48 
49 //--------------------------------------------------------------------------//
50 
51 #define TM_ENDLESS -1
52 
53 //--------------------------------------------------------------------------//
54 
55 class CKatBase; //katana
56 class CMotBase; //motor
57 class CSctBase; //sensor contoller
58 
59 
60 
61 //--------------------------------------------------------------------------//
62 // CKatBase ----------------------------------------------------------------//
63 //--------------------------------------------------------------------------//
64 
67 struct TKatGNL {
69  char modelName[255];
70 };
71 
74 struct TKatMFW {
77 };
78 
81 struct TKatIDS {
82  byte strID[256];
83 };
84 
87 struct TKatCTB {
88  byte cmdtbl[256];
89 };
90 
93 struct TKatCBX {
94  bool inp[2];
95  bool out[2];
96 };
97 
100 struct TKatECH {
102 };
103 
113 struct TKatEFF {
114  double arr_segment[4];
115 };
116 
117 
118 
119 //--------------------------------------------------------------------------//
120 
133 
134 protected:
141 
145 
149 
150 public: const TKatGNL* GetGNL() { return &gnl; } const TKatMFW* GetMFW() { return &mfw; } const TKatIDS* GetIDS() { return &ids; } const TKatCTB* GetCTB() { return &ctb; } const TKatCBX* GetCBX() { return &cbx; } const TKatECH* GetECH() { return &ech; }
163  const TKatMOT* GetMOT() { return &mot; } const TKatSCT* GetSCT() { return &sct; } TKatEFF* GetEFF() { return &eff; }
170 
171 
172  CKatBase() {}
175  virtual ~CKatBase() {}
176 
177  virtual bool init(
178  const TKatGNL _gnl,
179  const TKatMOT _mot,
180  const TKatSCT _sct,
181  const TKatEFF _eff,
182  CCplBase* _protocol
183  );
184  void recvMFW(); void recvIDS(); void recvCTB(); void recvGMS(); void waitFor(TMotStsFlg status, int waitTimeout, bool gripper); void recvECH(); void recvMPS();
202  int checkKatanaType(int type);
203 
208  void getMasterFirmware(short* fw, short* rev);
209  void enableCrashLimits(); void disableCrashLimits(); void unBlock();
220  void setCrashLimit(long idx, int limit);
223  void setPositionCollisionLimit(long idx, int limit);
226  void setSpeedCollisionLimit(long idx, int limit);
227 
231  void startSplineMovement(int exactflag, int moreflag = 1);
232 
237  void setAndStartPolyMovement(std::vector<short> polynomial, int exactflag, int moreflag);
238 
240  int readDigitalIO();
241 
243  int flushMoveBuffers();
244 };
245 
246 
247 
248 
249 
250 /****************************************************************************/
251 #endif //_KMLBASE_H_
252 /****************************************************************************/
unsigned char byte
type specification (8 bit)
Definition: cdlBase.h:29
char modelName[255]
model name
Definition: kmlBase.h:69
TKatMOT mot
motors
Definition: kmlBase.h:142
static std::unique_ptr< CCplSerialCRC > protocol
Definition: kni_wrapper.cpp:24
TKatMFW mfw
master&#39;s firmware version/revision
Definition: kmlBase.h:136
Abstract base class for protocol definiton.
Definition: cplBase.h:47
virtual ~CKatBase()
destructor
Definition: kmlBase.h:175
[SCT] every sens ctrl&#39;s attributes
Definition: kmlSctBase.h:41
TKatEFF eff
end effector
Definition: kmlBase.h:144
#define DLLDIR
Definition: dllexport.h:30
Sensor Controller class.
Definition: kmlSctBase.h:72
TKatSCT sct
sensor controllers
Definition: kmlBase.h:143
Base Katana class.
Definition: kmlBase.h:132
short mMasterVersion
master version of robot we are communicating with
Definition: kmlBase.h:147
TKatECH ech
echo
Definition: kmlBase.h:140
TMotStsFlg
status flags
Definition: kmlMotBase.h:58
CCplBase * getProtocol()
get a handle of the protocol, used in CKatana
Definition: kmlBase.h:200
byte rev
revision
Definition: kmlBase.h:76
TKatCBX cbx
connector box
Definition: kmlBase.h:139
[CTB] command table defined in the firmware
Definition: kmlBase.h:87
byte echo
echo answer
Definition: kmlBase.h:101
short mMasterRevision
master firmware revision
Definition: kmlBase.h:148
Inverse Kinematics structure of the endeffektor.
Definition: kmlBase.h:113
[IDS] identification string
Definition: kmlBase.h:81
[MOT] every motor&#39;s attributes
Definition: kmlMotBase.h:40
setPositionCollisionLimit
Definition: KNI.py:175
byte adr
jumper adress
Definition: kmlBase.h:68
[MFW] master firmware version/revision number
Definition: kmlBase.h:74
[GNL] general robot attributes
Definition: kmlBase.h:67
Motor class.
Definition: kmlMotBase.h:220
TKatCTB ctb
cmd table
Definition: kmlBase.h:138
CKatBase()
Definition: kmlBase.h:172
CCplBase * protocol
protocol interface
Definition: kmlBase.h:146
TKatGNL gnl
katana general
Definition: kmlBase.h:135
DLLEXPORT int flushMoveBuffers()
flush all the movebuffers
startSplineMovement
Definition: KNI.py:177
TKatIDS ids
ID string.
Definition: kmlBase.h:137
[ECH] echo
Definition: kmlBase.h:100
[CBX] connector box
Definition: kmlBase.h:93
byte ver
version
Definition: kmlBase.h:75
unsigned char byte
type specification (8 bit)
Definition: kmlBase.h:46


kni
Author(s): Martin Günther
autogenerated on Fri Jun 7 2019 22:06:44