Index error

This commit is contained in:
Tim Zeuner 2023-02-22 14:42:09 +01:00
parent 366b3db8f9
commit 9d896df965

View File

@ -67,9 +67,9 @@ void LFR_StateMachine::parseString(string s)
double wheels[4] = {0.0, 0.0, 0.0, 0.0}; double wheels[4] = {0.0, 0.0, 0.0, 0.0};
int mode = std::stoi(splitStr[0]); int mode = std::stoi(splitStr[0]);
if(mode == 0) { if(mode == 0) {
for(int i = 1; i < 4; i++) for(int i = 1; i <= 4; i++)
{ {
wheels[i] = std::stod(splitStr[i]); wheels[i-1] = std::stod(splitStr[i]);
} }
setState(State::Manual::getInstance()); setState(State::Manual::getInstance());
uartCommunicator.sendTelegram(wheels[0], wheels[1], wheels[2], wheels[3]); uartCommunicator.sendTelegram(wheels[0], wheels[1], wheels[2], wheels[3]);