2017-01-16 18:06:15 +00:00
|
|
|
%*** CHAPTER 9: TRAJECTORY GENERATION ***
|
|
|
|
|
|
2018-04-30 15:42:43 +00:00
|
|
|
function s = QuinticTimeScaling(Tf, t)
|
2017-01-16 18:06:15 +00:00
|
|
|
% Takes Tf: Total time of the motion in seconds from rest to rest,
|
|
|
|
|
% t: The current time t satisfying 0 < t < Tf.
|
|
|
|
|
% Returns s: The path parameter s(t) corresponding to a fifth-order
|
|
|
|
|
% polynomial motion that begins and ends at zero velocity and
|
|
|
|
|
% zero acceleration.
|
|
|
|
|
% Example Input:
|
|
|
|
|
%{
|
2018-04-30 15:42:43 +00:00
|
|
|
clear; clc;
|
2017-01-16 18:06:15 +00:00
|
|
|
Tf = 2;
|
|
|
|
|
t = 0.6;
|
|
|
|
|
s = QuinticTimeScaling(Tf,t)
|
|
|
|
|
%}
|
|
|
|
|
% Output:
|
|
|
|
|
% s =
|
|
|
|
|
% 0.1631
|
|
|
|
|
|
|
|
|
|
s = 10 * (t / Tf) ^ 3 - 15 * (t / Tf) ^ 4 + 6 * (t / Tf) ^ 5;
|
|
|
|
|
end
|