代码拉取完成,页面将自动刷新
同步操作将从 Dean/PIDtoolbox 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
function [angleRate] = PTrc2deg(X,rcRate,rcExpo,superrate, rcRateConstant)
% raw RCcommand data to RCrate in deg/s, i.e. "set point"
% with help from: https://github.com/betaflight/betaflight-configurator/blob/master/src/js/RateCurve.js
% X is a vector containing a single axis of RCcommand data scaled from -500 to 500,
% rcRate(0-255),rcExpo(0-100),superrate(0-100)
expoPower=3;
rcRateConstant=rcRateConstant;
angleRate=[];
rcRate=rcRate/100;
rcExpo=(rcExpo/100);
superrate=superrate/100;
maxRC=500;
rcCommandf = X / maxRC;
rcCommandfAbs = abs(rcCommandf) / 1;%max(abs(rcCommandf));
if (rcRate > 2)
rcRate = rcRate + (rcRate - 2) * 14.54;
end
if (rcExpo > 0)
%disp('rcExpo > 0')
rcCommandf = rcCommandf .* power(rcCommandfAbs, expoPower) * rcExpo + rcCommandf * (1-rcExpo);
end
if (superrate > 0)
%disp('superrate > 0')
rcFactor = 1 ./ (1 - rcCommandfAbs * superrate); % this creates the super expo curve needed to convert RCcommand to RCrate
angleRate = (rcRateConstant * rcRate * rcCommandf);
angleRate = angleRate .* rcFactor;
% disp(['angleRate:' num2str(angleRate) ' rcFactor:' num2str(rcFactor)])
else
angleRate = (rcRateConstant * rcRate * rcCommandf);
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。