# MATLAB代做|FPGA代做|python代做-动态机器人轨迹的matlab仿真

### 时间：2021-4-3 23:53:30 点击：

核心提示：MATLAB代做|FPGA代做|python代做-动态机器人轨迹的matlab仿真...
function mobile_robot_NN()
clc
close all
clear all
%% =========== Set the paramters =======
T=0.01; % Sampling Time
k=2; % Sampling counter
x(k-1)=0; % initilize the state x
y(k-1)=0; % initilize the state y
theta(k-1)=0; % initilize the state theta
tfinal=100; % final simulation time
t=0; % intilize the time
%=====================================
%% =========== The main loop ==========
while(t<=tfinal)
t=t+T; % increase the time
V=0.5;W=1;
theta(k)=W*T+theta(k-1); % calculating theta
x(k)=V*cos(theta(k))*T+x(k-1); % calculating x
y(k)=V*sin(theta(k))*T+y(k-1); % calculating y
draw_robot(); % Draw the robot and it's path
k=k+1; % increase the sampling counter
end
%=====================================
%% === Draw the mobile robot & Path ====
function draw_robot()
xmin=-1.2; % setting the figure limits
xmax=1.2;
ymin=-1.2;
ymax=1.2;
mob_L=0.2; % The Mobile Robot length
mob_W=0.1; % The Mobile Robot width
Tire_W=0.05; % The Tire width
Tire_L=mob_L/2;  % The Tire length
plot(x,y,'-r') % Dawing the Path
axis([xmin xmax ymin ymax]) % setting the figure limits
axis square
hold on

% Body
v1=[mob_L;-mob_W];
v2=[-mob_L/4;-mob_W];
v3=[-mob_L/4;mob_W];
v4=[mob_L;mob_W];
%Right Tire
v5=[Tire_L/2;-mob_W-0.02];
v6=[Tire_L/2;-mob_W-Tire_W-0.02];
v7=[-Tire_L/2;-mob_W-Tire_W-0.02];
v8=[-Tire_L/2;-mob_W-0.02];
%Left Tire
v9=[Tire_L/2;mob_W+0.02];
v10=[Tire_L/2;mob_W+Tire_W+0.02];
v11=[-Tire_L/2;mob_W+Tire_W+0.02];
v12=[-Tire_L/2;mob_W+0.02];
%Line
v13=[0;-mob_W-0.02];
v14=[0;mob_W+0.02];
%Front Tire
v15=[mob_L;Tire_W/2];
v16=[mob_L;-Tire_W/2];
v17=[mob_L-Tire_L/1.5;-Tire_W/2];
v18=[mob_L-Tire_L/1.5;Tire_W/2];

R=[cos(theta(k)) -sin(theta(k));sin(theta(k)) cos(theta(k))]; % Rotation Matrix
P=[x(k);y(k)]; % Position Matrix

v1=R*v1+P;
v2=R*v2+P;
v3=R*v3+P;
v4=R*v4+P;

v5=R*v5+P;
v6=R*v6+P;
v7=R*v7+P;
v8=R*v8+P;

v9=R*v9+P;
v10=R*v10+P;
v11=R*v11+P;
v12=R*v12+P;

v13=R*v13+P;
v14=R*v14+P;

v15=R*v15+P;
v16=R*v16+P;
v17=R*v17+P;
v18=R*v18+P;

B34

• 百度搜索
• Google搜索
• 查阅资料过程中
• 论坛发现
• 百度贴吧发现
• 朋友介绍
• 大名：
• 内容：
##### 本类固顶
• matlab代做|matlab专业代做|matlab淘宝代做|python人工智能代做|FPGA项目合作|C代做|C++代做(www.hslogic.com) © 2021 版权所有 All Rights Reserved.
• Email:highspeed_logic@163.com 站长QQ: 1224848052

专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文，毕业论文，Coursework、Eassy、Assignment