added comments

This commit is contained in:
2024-10-05 15:51:19 +02:00
parent 50fc14d92d
commit 33e8300814
2 changed files with 6 additions and 6 deletions

View File

@@ -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;
} }
} }

View File

@@ -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