基于全信息结构的单人动态博弈模型和后退视距控制算法的博弈论自适应巡航控制算法设计(Matlab代码实现)

     目录

💥1 概述

📚2 运行结果

🎉3 参考文献

👨‍💻4 Matlab代码

💥1 概述

在本项目中,我们将自动驾驶挑战限制在一维范围内,自动驾驶者的目标是在避免碰撞的同时达到设定速度。

从结果中,我们得出结论,ACC是成功的。在ACC算法下工作的自我车辆适当地应用其最大加速度以避免被追尾。避免碰撞后,可以看到它正试图达到100m/s的设定点,但仅限于前车的位置。​

总之,此ACC算法在选择最佳操作之前模拟所有操作的性能。在此模拟期间,算法假设其他代理将在接下来的 N 个时间步长中承诺其速度,并评估 N 个时间步的所有可能操作的状态。一旦通过简单的运动学方程计算出状态,就可以通过沿每个动作的轨迹应用成本函数来评估动作的性能。然后选择与最佳性能(即最低成本)相关的操作。

📚2 运行结果

主函数部分代码:

%% Adaptive Cruise Control System
% Define the sample time, |Ts|, and simulation duration, |T|, in seconds 
close all;clear;
Ts = 0.05;
T = 50;
%Define human driver's freq & amplitude of acccel
​
HA=2;
HF=0.4;     %Radians
​
%%
% Specify the linear model for ego car.
G_ego = tf(1,[0.5,1,0]);
​
%%
vref=21;L_RDis=7;L_Vel=26.8;R_RDis=20;R_Vel=30;
% Specify the initial position and velocity for the two vehicles.
x0_lead = 80;   % initial position for lead car (m)
v0_lead = 30;   % initial velocity for lead car (m/s)
​
x0_ego = 20;   % initial position for ego car (m)
v0_ego = 30;   % initial velocity for ego car (m/s)
​
x0_rear = 14;   % initial position for rear car (m)
v0_rear = 30;   % initial velocity for rear car (m/s)
​
%%
% Specify the driver-set velocity in m/s.
v_set = 100;
​
%% Simulation Analysis
% Run the simulation.
sim('ACCsystem.slx')
​
%%
figure(1);subplot(211);
yyaxis left
plot(Lv);hold on
plot(Ev);
plot(Rv);
​
grid on;
​
title(['Vehicle Velocities: Vref= ',num2str(v_set) ])
xlabel('Time')
ylabel('Velocity (m/s)')
​
yyaxis right
plot(Ea); hold off
ylabel('Ego Acceleration')
legend('Lead','Ego','Rear','Ego-Accerlation')
​
%% Plot Relative Distances
subplot(212)
plot(Ep.Time,Lp.Data-Ep.Data);hold on
yline(0);
plot(Ep.Time,Rp.Data-Ep.Data);
hold off
title('Relative Lead/Rear Distances from Ego')
xlabel('Time(s)')
ylabel('Relative distance (m)')
legend('Lead Vehicle Offset','Ego Vehicle','Rear Vehicle offset')
%% Circular Plot
%X,V,A
X=[Lp.Data';Ep.Data';Rp.Data'];
V=[Lv.Data';Ev.Data';Rv.Data'];
A=[La.Data';Ea.Data';Ra.Data'];
​
N=3;        %Number of Players
Nh = 2;     %Number of Humans
iH = [1,3]; %Position of Humans
R = 1000;      %Radius of Circle
eV=0.05;
K=T/Ts;
​
%Video initialization
​
myVideo = VideoWriter('ACC_Demo'); %open video file
myVideo.FrameRate = 10;  %can adjust this, 5 - 10 works well for me
open(myVideo)
​
dW = N*pi/(eV*N);
XC = @( x ) R*sin( x/dW );
YC = @( x ) R*cos( x/dW );
​
COLORS = { [0 0.4470 0.7410], [0.8500 0.3250 0.0980], [0.9290 0.6940 0.1250],...
    [0.4940 0.1840 0.5560], [0.4660 0.6740 0.1880], [0.3010 0.7450 0.9330],...
    [0.6350 0.0780 0.1840] };
​
NAMES = {'Trajectories', 'Accelerations', 'Distance between Agents', 'Velocities'};
XLAB = {'','Time(s)','Time(s)','Time(s)'};
YLAB = {'','Acceleration (m/s^2)','Distance (m)','Velocity (m/s)'};
​
figure('Name','Animation','NumberTitle','off','WindowState','maximized')
for k = 1:4
    ax(k) = subplot(2,2,k);
    title( NAMES{k} );
    xlabel( XLAB{k} );
    ylabel( YLAB{k} );
    hold on
    grid on
    grid minor
end

🎉3 参考文献

[1]戴旭彬,孙涛,夏维.基于MPC的自适应巡航算法改进研究[J].机电工程,2018,35(06):644-648+657.

部分理论引用网络文献,若有侵权联系博主删除。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值