Matlab Robotic Toolbox工具箱学习笔记(一)

一、轨迹

路径只是空间结构,从一个位资到另一个位资;轨迹是具有时间结构的,从A 到B时路径,外加速度或时间限制。

这里我们选用五次多项式,因为他能够匹配位置、速度、加速度在起点和终点的边界条件。

Matlab Robotic Toolbox工具箱学习笔记(一)

1、一维

%生成五次多项式轨迹
[s,sd,sdd]=tpoly(0,1,100,0.5,0);%P0=0,P1=1,步长100;初始速度0.5,终点速度0
figure;
subplot(311),plot(s);
subplot(312),plot(sd);
subplot(313),plot(sdd);

Matlab Robotic Toolbox工具箱学习笔记(一)

%直线与抛物线混合
[s,sd,sdd]=lspb(0,1,100);%P0=0,P1=1,步长100;
figure;
subplot(311),plot(s);
subplot(312),plot(sd);
subplot(313),plot(sdd);

Matlab Robotic Toolbox工具箱学习笔记(一)

2、多维

%三维
x=mtraj(@tpoly,[0 2],[1 -1],50);%x1从0到1,x2从2到-1
figure;
plot(x);

Matlab Robotic Toolbox工具箱学习笔记(一)