Modern_Robotics/code/MATLAB/QuinticTimeScaling.m

21 lines
560 B
Mathematica
Raw Normal View History

%*** CHAPTER 9: TRAJECTORY GENERATION ***
function s = QuinticTimeScaling(Tf, t)
% 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:
%{
clear; clc;
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