53 for (
int s=0; s<
sct.
cnt; s++) {
113 for (i=0; i<
mot.
cnt; i++) {
126 for (
int i = 0; i < nOfMot; ++i) {
135 for (
int i = 0; i < nOfMot; ++i) {
138 if ((reached[i] ==
false) && (
mot.
arr[i].
pvp.
msf == status)) {
141 if (reached[i] ==
false)
171 short version, revision;
203 p[2] = (char)(limit >> 8);
204 p[3] = (char)(limit);
218 for (
int i=0; i <
mot.
cnt; ++i) {
225 std::vector<byte> sendBuf(3), recvBuf(2, 0);
227 sendBuf[0] =
'G'+128 ;
228 sendBuf[1] = (
byte) moreflag;
229 sendBuf[2] = (
byte) exactflag;
230 protocol->
comm(&sendBuf.front(), &recvBuf.front(), &readBytes);
235 std::vector<byte> sendBuf(75), recvBuf(3, 0);
238 for (
int i = 0; i < (int)polynomial.size(); ++i) {
239 sendBuf[2*i+1] =
static_cast<byte>(polynomial[i] >> 8);
240 sendBuf[2*i+2] =
static_cast<byte>(polynomial[i]);
242 sendBuf[73] = (
byte) moreflag;
243 sendBuf[74] = (
byte) exactflag;
244 protocol->
comm(&sendBuf.front(), &recvBuf.front(), &readBytes);
255 for (
int i=0; i<
mot.
cnt; i++) {
256 mot.
arr[i].
pvp.
pos = (((short)buf[2*i+1]) <<8) | buf[2*i+2];
263 if((type == 400) || (type == 450)){
268 else if(type == 300){
unsigned char byte
type specification (8 bit)
virtual bool init(const TKatGNL _gnl, const TKatMOT _mot, const TKatSCT _sct, const TKatEFF _eff, CCplBase *_protocol)
void enableCrashLimits()
crash limits enable
TMotPVP pvp
reading motor parameters
TKatMFW mfw
master's firmware version/revision
byte cmdtbl[256]
command table
Abstract base class for protocol definiton.
[SCT] every sens ctrl's attributes
void setAndStartPolyMovement(std::vector< short > polynomial, int exactflag, int moreflag)
void setSpeedCollisionLimit(long idx, int limit)
set collision speed limits
TKatSCT sct
sensor controllers
void startSplineMovement(int exactflag, int moreflag=1)
TSctDesc * desc
description[]
short mMasterVersion
master version of robot we are communicating with
CMotBase * arr
array of motors
int flushMoveBuffers()
flush move buffers on all motors:
void disableCrashLimits()
crash limits disable
void recvMFW()
receive data
int readDigitalIO()
get digital I/O data from Katana400:
void waitFor(TMotStsFlg status, int waitTimeout, bool gripper)
wait for motor on all motors
const TKatMOT * GetMOT()
Get a pointer to the desired structure.
short mMasterRevision
master firmware revision
virtual void comm(const byte *pack, byte *buf, byte *size)=0
Base communication function.
void recvMPS()
read all motor positions simultaneously
Inverse Kinematics structure of the endeffektor.
[MOT] every motor's attributes
void setPositionCollisionLimit(int limit)
Set the collision limit.
void recvGMS()
receive data
CSctBase * arr
array of sens ctrl's
TMotDesc * desc
description[]
void recvECH()
receive data
bool init(CKatBase *_own, const TMotDesc _motDesc, CCplBase *protocol)
void getMasterFirmware(short *fw, short *rev)
Get the master firmware of the robot we are communicating with.
[GNL] general robot attributes
void resetBlocked()
unblock the motor.
TMotStsFlg msf
motor status flag
#define K400_OLD_PROTOCOL_THRESHOLD
The old protocol is only supported up to K400 version 0.x.x.
void setCrashLimit(long idx, int limit)
set collision limits
int checkKatanaType(int type)
checks for a K300 or K400
CCplBase * protocol
protocol interface
TKatGNL gnl
katana general
void setPositionCollisionLimit(long idx, int limit)
set collision position limits
void unBlock()
unblock robot after a crash
bool init(CKatBase *_own, const TSctDesc _sctDesc, CCplBase *protocol)
void setSpeedCollisionLimit(int limit)
Set the collision limit.
void recvCTB()
receive data
void recvIDS()
receive data
short cnt
count of sens ctrl's