mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
added to parser so we can read raw sensordata from cliffsensor (thanks anwar)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <iostream>
|
||||
//checkedValue const maken
|
||||
//bitwise operators nachecken met website van kobuki serial website
|
||||
//cliffsensor kan rauwe getallen zijn
|
||||
int KobukiParser::parseKobukiMessage(TKobukiData &output, unsigned char *data) {
|
||||
int rtrnvalue = checkChecksum(data);
|
||||
if (rtrnvalue != 0) {
|
||||
@@ -152,13 +153,13 @@ void KobukiParser::parseGyroData(TKobukiData &output, unsigned char *data, int &
|
||||
checkedValue += 5; // 3 unused
|
||||
}
|
||||
|
||||
void KobukiParser::parseCliffSensorData(TKobukiData &output, unsigned char *data, int &checkedValue){
|
||||
output.CliffSensorRight = data[checkedValue];
|
||||
checkedValue++;
|
||||
output.CliffSensorCenter = data[checkedValue];
|
||||
checkedValue++;
|
||||
output.CliffSensorLeft = data[checkedValue];
|
||||
checkedValue++;
|
||||
void KobukiParser::parseCliffSensorData(TKobukiData &output, unsigned char *data, int &checkedValue) {
|
||||
output.CliffSensorRight = (data[checkedValue] << 8) | data[checkedValue + 1];
|
||||
checkedValue += 2;
|
||||
output.CliffSensorCenter = (data[checkedValue] << 8) | data[checkedValue + 1];
|
||||
checkedValue += 2;
|
||||
output.CliffSensorLeft = (data[checkedValue] << 8) | data[checkedValue + 1];
|
||||
checkedValue += 2;
|
||||
}
|
||||
|
||||
void KobukiParser::parseWheelCurrentData(TKobukiData &output, unsigned char *data, int &checkedValue){
|
||||
|
Reference in New Issue
Block a user