标签:div 技术 角度 src width plot ima 而不是 front
一、前轮偏角,要注意此处的角度是matlab中的角度方向,0度指向y轴正向,90度指向x轴正向,而不是以前轮为0 ,左右正负pi。
所以其实当frontAngle = 0 时,或者等于 pi时,分别对应前轮实际正负pi/2。原地旋转,frontAngle对应90度时反而对应前轮实际0度,直线行驶。
clc;
clear;
% 参考博客
% https://blog.csdn.net/iProphet/article/details/83754283
v = 0.3; % 前轮线速度
d = 0.8; % 前轮和后轮中心的距离
p = [1 1];
%前轮偏角,要注意此处的角度是matlab中的角度方向,0度指向y轴正向,90度指向x轴正向,而不是以前轮为0 ,左右正负pi
frontAngle = 3*pi/4;
theta = 0; % 车辆初始航向
for i = 1:10
detax = v * sin(frontAngle) * cos(theta);
detay = v * cos(frontAngle) * sin(theta);
dentheta = v * sin(frontAngle) / d;
pos = [p(end,1)+detax p(end,2)+detay];
p = [p;pos];
theta = theta + dentheta;
end
plot(p(:,1),p(:,2),‘-r‘);
axis equal;
hold on;
二、测试图3*pi/4时

三、运动学模型
参考博客:https://blog.csdn.net/iProphet/article/details/83754283
运动模型:

公式:前轮角度和速度可以转换为后轮中心的角速度和线速度。

标签:div 技术 角度 src width plot ima 而不是 front
原文地址:https://www.cnblogs.com/wbscpp/p/13221746.html