mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
added comments
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
#include "KobukiParser.h"
|
#include "KobukiParser.h"
|
||||||
|
|
||||||
int KobukiParser::parseKobukiMessage(TKobukiData &output, unsigned char *data) {
|
int KobukiParser::parseKobukiMessage(TKobukiData &output, unsigned char *data) {
|
||||||
int rtrnvalue = checkChecksum(data);
|
//check if the checksum is correct
|
||||||
|
int rtrnvalue = CKobuki.checkChecksum(data);
|
||||||
if (rtrnvalue != 0)
|
if (rtrnvalue != 0)
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ int KobukiParser::parseKobukiMessage(TKobukiData &output, unsigned char *data) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
checkedValue += length + 2; // Skip unknown data block
|
checkedValue += length + 2; // Skip data block if nothing matches
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
#ifndef KOBUKIPARSER_H
|
#ifndef KOBUKIPARSER_H //so that class cant be loaded twice
|
||||||
#define KOBUKIPARSER_H
|
#define KOBUKIPARSER_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "CKobuki.h"
|
||||||
|
|
||||||
struct TRawGyroData {
|
struct TRawGyroData {
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
@@ -26,8 +27,6 @@ struct TKobukiData {
|
|||||||
int wheelCurrentLeft, wheelCurrentRight;
|
int wheelCurrentLeft, wheelCurrentRight;
|
||||||
int digitalInput, analogInputCh0, analogInputCh1, analogInputCh2, analogInputCh3;
|
int digitalInput, analogInputCh0, analogInputCh1, analogInputCh2, analogInputCh3;
|
||||||
int frameId;
|
int frameId;
|
||||||
std::vector<TRawGyroData> gyroData;
|
|
||||||
TExtraInfo extraInfo;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class KobukiParser {
|
class KobukiParser {
|
||||||
@@ -48,4 +47,4 @@ private:
|
|||||||
int parseUDIDData(TKobukiData &output, unsigned char *data, int &checkedValue);
|
int parseUDIDData(TKobukiData &output, unsigned char *data, int &checkedValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KOBUKIPARSER_H
|
#endif
|
Reference in New Issue
Block a user