thesis/set_trajectory.m

37 lines
769 B
Matlab
Raw Normal View History

function [ref, dref] = set_trajectory(i)
syms s
switch i
case 0
% a straigth line trajectory at v=0.5m/s
xref = 0.5*s;
yref = 0;
case 1
% a straigth line trajectory at v=10 m/s
xref = 10*s;
yref = 0;
case 2
2024-07-13 12:15:26 +02:00
% straight line, with initial error
xref = 5 + 0.5*s;
yref = 0;
case 3
% straight line, initial error, faster
xref = 5 + 10*s;
yref = 0;
case 4
2024-07-16 10:58:00 +02:00
xref = 2.5*cos(s);
yref = 2.5*sin(s);
2024-07-13 12:15:26 +02:00
case 5
2024-07-13 11:31:44 +02:00
xref = 15*cos(s);
yref = 15*sin(s);
2024-07-13 12:15:26 +02:00
case 6
2024-07-23 18:07:50 +02:00
xref = 0.4*s;
yref = cos(0.4*s);
case 7
xref = 5*cos(0.05*s);
yref = 5*sin(0.05*s);
end
ref = [xref; yref];
dref = diff(ref, s);
end