Pull fixCommonParams and sendCommand out of driving modes
This commit is contained in:
committed by
CommanderRedYT
parent
5971061bc7
commit
3e70a1fc74
@ -21,4 +21,9 @@ void updateDrivingMode()
|
||||
|
||||
if (currentMode)
|
||||
currentMode->update();
|
||||
|
||||
fixCommonParams();
|
||||
|
||||
// Last, send values to motor controllers
|
||||
sendCommands();
|
||||
}
|
||||
|
@ -258,8 +258,6 @@ void DefaultMode::update()
|
||||
motor.cruiseCtrlEna = false;
|
||||
motor.nCruiseMotTgt = 0;
|
||||
}
|
||||
fixCommonParams();
|
||||
}
|
||||
}
|
||||
sendCommands();
|
||||
}
|
||||
|
@ -76,9 +76,5 @@ void GametrakMode::update()
|
||||
motor.nCruiseMotTgt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
fixCommonParams();
|
||||
|
||||
sendCommands();
|
||||
}
|
||||
#endif
|
||||
|
@ -14,8 +14,4 @@ void IgnoreInputMode::update()
|
||||
motor.cruiseCtrlEna = false;
|
||||
motor.nCruiseMotTgt = 0;
|
||||
}
|
||||
|
||||
fixCommonParams();
|
||||
|
||||
sendCommands();
|
||||
}
|
||||
|
@ -105,8 +105,4 @@ void LarsmMode::update()
|
||||
motor.nCruiseMotTgt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
fixCommonParams();
|
||||
|
||||
sendCommands();
|
||||
}
|
||||
|
@ -78,8 +78,4 @@ void MickMode::update()
|
||||
motor.nCruiseMotTgt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
fixCommonParams();
|
||||
|
||||
sendCommands();
|
||||
}
|
||||
|
@ -34,7 +34,4 @@ void MotortestMode::update()
|
||||
motor.cruiseCtrlEna = false;
|
||||
motor.nCruiseMotTgt = 0;
|
||||
}
|
||||
|
||||
fixCommonParams();
|
||||
sendCommands();
|
||||
}
|
||||
|
@ -42,10 +42,6 @@ void RemoteControlMode::update()
|
||||
controllers.back.command.left.pwm = m_remoteCommand->backLeft;
|
||||
controllers.back.command.right.pwm = m_remoteCommand->backRight;
|
||||
}
|
||||
|
||||
fixCommonParams();
|
||||
|
||||
sendCommands();
|
||||
}
|
||||
|
||||
void RemoteControlMode::setCommand(const RemoteCommand &command)
|
||||
|
@ -53,8 +53,4 @@ void TempomatMode::update()
|
||||
motor.nCruiseMotTgt = nCruiseMotTgt;
|
||||
}
|
||||
}
|
||||
|
||||
fixCommonParams();
|
||||
|
||||
sendCommands();
|
||||
}
|
||||
|
@ -219,9 +219,7 @@ void WheelchairMode::update()
|
||||
controller.command.right.cruiseCtrlEna = false;
|
||||
controller.command.right.nCruiseMotTgt = 0;
|
||||
}
|
||||
fixCommonParams();
|
||||
}
|
||||
}
|
||||
sendCommands();
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user