add check for vel_limt == 0

This commit is contained in:
Yannis Chatzikonstantinou
2019-06-14 22:48:57 +03:00
parent ec27bed59a
commit cfb0e11272
+1 -1
View File
@@ -201,7 +201,7 @@ bool Controller::update(float pos_estimate, float vel_estimate, float* current_s
}
// Velocity limiting in current mode
if (config_.control_mode < CTRL_MODE_VELOCITY_CONTROL) {
if (config_.control_mode < CTRL_MODE_VELOCITY_CONTROL && config_.vel_limit > 0) {
float Imax = (config_.vel_limit - fabsf(vel_estimate)) * config_.vel_gain;
if (Iq > 0 && Iq > Imax) {
limited = true;