Skip to content

Commit

Permalink
Merge pull request #308 from McGiverGim/fix_ratelimits_maxcurve
Browse files Browse the repository at this point in the history
Fix max curve when rate_limit not defined
  • Loading branch information
mikeller committed Apr 29, 2019
1 parent ae6ce3b commit fb2268d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/flightlog.js
Expand Up @@ -1027,7 +1027,7 @@ FlightLog.prototype.rcCommandRawToDegreesPerSecond = function(value, axis, curre
*/

var limit = sysConfig["rate_limits"][axis];
if (sysConfig.pidController == 0 /* LEGACY */) {
if (sysConfig.pidController == 0 || limit == null) { /* LEGACY */
return constrain(angleRate * 4.1, -8190.0, 8190.0) >> 2; // Rate limit protection
} else {
return constrain(angleRate, -1.0 * limit, limit); // Rate limit protection (deg/sec)
Expand Down

0 comments on commit fb2268d

Please sign in to comment.