资源简介
双差动单元的四轮差动小车的循路控制。
代码片段和文件信息
clear
clc
close all
%--------------------------------------------------------------------------
%% Initialization
R = 5; % 大圆半径 The radius of the circular path
r = 2; %小圆半径 The radius of the transition circular path
ds = 0.4; % 离散距离 Discrete distance
D = 0.5; % 轮距 Track width
wheel_R = 0.1; % 车轮半径 The wheel radius
w0 = 0.07/wheel_R; % 轮子初始转速 Initial angular velocity
%--------------------------------------------------------------------------
disThreshold = 0.04; % 距离阈值,小车与目标点距离进入该阈值后目标点变成下一个点
% The lower limit of the threshold value of target point selection
InitHead = 90*pi/180; % 小车方向基准3点钟方向为0度(即x轴正方向),顺时针为正
% 3 o ‘clock be the reference direction zero degrees
head = -90*pi/180; % 小车初始指向为12点钟方向,The initial Angle is 12 o ‘clock
head = head + InitHead;
endTheta = -1.5*pi-asin(r/(R-r)); % endTheta 为终点角度
% The end angle that can make the circle be closed
%--------------------------------------------------------------------------
% 计算三个角度 Three central angles
theta_1 = asin(r/(R-r)); %The center of a small circle
theta_2 = pi/2 - theta_1;
theta_3 = pi - theta_2;
%% Generate temporary path
% straight-line portion
% 计算路径1的点
y_1 = (R-r) * cos(theta_1);
%The point at which a straight line meets the small circle
line_1y = 0:ds:y_1;
line_1x = zeros(size(line_1y));
path_1 = [line_1x;line_1y];% Generate partial path of straight line
% circular arc portion
% 计算路径2的点
% 计算小圆中心坐标 The coordinates of the center of small circle
rx = r;
ry = y_1;
% 以ds距离采样,计算每次间隔的圆心角
% The central Angle between two sampling points is calculated according to
% the sampling distance ds
dtheta_2 = 2*asin(ds/2/r);
% 计算每个采样点的角度
theta = pi:-dtheta_2:(pi-theta_3);
% 第二条路径
path_2 = [r*cos(theta)+rx;r*sin(theta)+ry];% Generate partial path of circular arc
%% Generate expected path
% 计算路径3的点 Generation of the expect circular path
% 以ds距离采样,计算每次间隔的圆心角
dtheta_3 = 2*asin(ds/2/R);
% 计算每个采样点的角度
theta = pi/2-theta_1:-dtheta_3:endTheta;
path_3 =[R*cos(theta);R*sin(theta)];
path = [path_1path_2path_3];
transT = [cos(head)-sin(head);
sin(head)cos(head)];
path = transT*path;
len = size(path2);
ax = 0:size(path2)-1;
%follow path
path1x = path(12:length(path));
path1y = path(22:length(path));
path2 = path;
ax2 = 0:size(path2)-2;
figure
plot(path(1:)path(2:)‘.r‘);
axis([-66-66]);
axis equal
save data.mat
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-12 03:40 simulation D-d robot\
文件 8627 2019-03-12 03:41 simulation D-d robot\data.mat
文件 2683 2019-03-12 02:33 simulation D-d robot\dataInit.m
文件 736 2019-03-11 08:53 simulation D-d robot\PlotRobot.m
文件 540 2019-03-12 03:05 simulation D-d robot\result.m
文件 53380 2019-03-12 03:40 simulation D-d robot\simulation_model.slx
文件 4726 2019-03-12 03:25 simulation D-d robot\simulation_model.slxc
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\sim\
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\sim\varcache\
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\sim\varcache\simulation_model\
文件 392 2019-03-12 03:25 simulation D-d robot\slprj\sim\varcache\simulation_model\checksumOfCache.mat
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\sim\varcache\simulation_model\tmwinternal\
文件 312 2019-03-12 03:25 simulation D-d robot\slprj\sim\varcache\simulation_model\tmwinternal\simuli
文件 3792 2019-03-12 03:25 simulation D-d robot\slprj\sim\varcache\simulation_model\varInfo.mat
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\_jitprj\
文件 10276 2019-03-12 03:25 simulation D-d robot\slprj\_jitprj\s2uirV6UfHP6nQpn3iLR9qD.l
文件 891 2019-03-12 03:25 simulation D-d robot\slprj\_jitprj\s2uirV6UfHP6nQpn3iLR9qD.mat
文件 8924 2019-03-12 03:25 simulation D-d robot\slprj\_jitprj\sBRlD0PpHrsoAky8Y2uSCgH.l
文件 871 2019-03-12 03:25 simulation D-d robot\slprj\_jitprj\sBRlD0PpHrsoAky8Y2uSCgH.mat
文件 10816 2019-03-12 03:25 simulation D-d robot\slprj\_jitprj\smhheaVmTwOZS4Mz9iDhBB.l
文件 885 2019-03-12 03:25 simulation D-d robot\slprj\_jitprj\smhheaVmTwOZS4Mz9iDhBB.mat
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\EMLReport\
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\EMLReport\s2uirV6UfHP6nQpn3iLR9qD\
文件 2647 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\EMLReport\s2uirV6UfHP6nQpn3iLR9qD.mat
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\EMLReport\sBRlD0PpHrsoAky8Y2uSCgH\
文件 2486 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\EMLReport\sBRlD0PpHrsoAky8Y2uSCgH.mat
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\EMLReport\smhheaVmTwOZS4Mz9iDhBB\
文件 30425 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\EMLReport\smhheaVmTwOZS4Mz9iDhBB.mat
目录 0 2019-03-12 03:25 simulation D-d robot\slprj\_sfprj\precompile\
............此处省略11个文件信息
- 上一篇:图片相似度matlab代码
- 下一篇:MATLAB经典案例
相关资源
- 串行级联cpm系统MATLAB仿真
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
川公网安备 51152502000135号
评论
共有 条评论