KatanaNativeInterface
$VERSION$
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
include
KNI
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 1
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
{
68
byte
adr
;
69
char
modelName
[255];
70
};
71
74
struct
TKatMFW
{
75
byte
ver
;
76
byte
rev
;
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
{
101
byte
echo
;
102
};
103
113
struct
TKatEFF
{
114
double
arr_segment
[4];
115
};
116
117
118
119
//--------------------------------------------------------------------------//
120
132
class
DLLDIR
CKatBase
{
133
134
protected
:
135
TKatGNL
gnl
;
136
TKatMFW
mfw
;
137
TKatIDS
ids
;
138
TKatCTB
ctb
;
139
TKatCBX
cbx
;
140
TKatECH
ech
;
141
142
TKatMOT
mot
;
143
TKatSCT
sct
;
144
TKatEFF
eff
;
145
146
CCplBase
*
protocol
;
147
short
mMasterVersion
;
148
short
mMasterRevision
;
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
recvCBX();
void
recvECH();
void
recvNMP();
void
recvMPS();
202
CCplBase
*
getProtocol
(){
return
protocol;}
204
int
checkKatanaType(
int
type);
205
void
sendCBX(
const
TKatCBX
* _cbx);
208
void
sendTPSP();
213
218
void
getMasterFirmware(
short
* fw,
short
* rev);
219
void
enableCrashLimits();
void
disableCrashLimits();
void
unBlock();
230
void
setCrashLimit(
long
idx,
int
limit);
233
void
setPositionCollisionLimit(
long
idx,
int
limit);
236
void
setSpeedCollisionLimit(
long
idx,
int
limit);
237
241
void
startSplineMovement(
bool
exactflag,
int
moreflag = 1);
242
245
void
startFourSplinesMovement(
bool
exactflag);
246
void
sendSLMP(
byte
* p);
249
void
sendSLM(
bool
exactflag);
252
253
};
254
255
256
257
258
259
/****************************************************************************/
260
#endif //_KMLBASE_H_
261
/****************************************************************************/
Generated by
1.8.3.1