diff --git a/lfr_state_machine.cpp b/lfr_state_machine.cpp index 673f63b..3952898 100644 --- a/lfr_state_machine.cpp +++ b/lfr_state_machine.cpp @@ -67,9 +67,9 @@ void LFR_StateMachine::parseString(string s) double wheels[4] = {0.0, 0.0, 0.0, 0.0}; int mode = std::stoi(splitStr[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()); uartCommunicator.sendTelegram(wheels[0], wheels[1], wheels[2], wheels[3]);