1 Star 1 Fork 1

JeffreyChan / ReceedingHorizonControlAutonomousVehicle

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
desiredYaw.m 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Mohamed 提交于 2016-11-16 09:31 . Add files via upload
% Path Co-ordinates for Dynamic Path Following
%
% Input:-curvlinear reference path (ds,th)
% -cartesian coordinates rx.ry
% -traction speed vx
% -current position x,y
%
% Output: Heading, Curvature, Path Length
function [ssW,ssPhi]=desiredYaw(th,s,ds,dth,k,sK,sYaw,sBeta,vx,rx,ry,xi,yi,thi,dist,dlook,Betamax)
%nearest point
dx=xi-rx(end);
dy=yi-ry(end);
dmin = sqrt(dx*dx+dy*dy);
amin = size(rx,2);
%lookahead distance
for kk=0:1:size(rx,2)-1;
dx=xi-rx(end-kk);
dy=yi-ry(end-kk);
d = sqrt(dx*dx+dy*dy);
if d<dlook && s(end-kk)>=dist
amin=size(rx,2)-kk;
dmin = d;
break
end
end
%steady state steering based on curvature response
ssPhi = th(amin)-thi;
%estimate steady state Beta
ssBeta = sBeta*ssPhi;
if abs(ssBeta) > Betamax
ssBeta = Betamax*sign(ssBeta);
ssPhi = ssBeta/sBeta;
end
%steady state yaw based on steady state steering angle corrected with
ssW = ssPhi*sYaw*cos(ssBeta);
end
Matlab
1
https://gitee.com/jeffreychan/ReceedingHorizonControlAutonomousVehicle.git
git@gitee.com:jeffreychan/ReceedingHorizonControlAutonomousVehicle.git
jeffreychan
ReceedingHorizonControlAutonomousVehicle
ReceedingHorizonControlAutonomousVehicle
master

搜索帮助