I had a question regarding 'transformtraj' function

조회 수: 2 (최근 30일)
Gal
Gal 2024년 4월 3일
댓글: Gal 2024년 5월 4일
Hi. i have looked into the function after trying to run the example given inside the function's code.
some how, it looks as the minimum jerk trajectory doesn't meets the set time interval.
is it a bug? or dont i understand the function's intention?

답변 (1개)

MULI
MULI 2024년 4월 23일
편집: MULI 2024년 4월 23일
Hi Gal,
I understand that when you ran one of the examples in documentation provided for ‘transformtraj’ you could not get minimum trajectory function.
  • The “transformtraj” function in MATLAB mainly focuses on creating a smooth interpolation between the initial and final transformations, which includes both position and orientation changes over time.
  • Achieving a "minimum jerk" trajectory involves a specific optimization criterion that minimizes the integral of the square of the jerk over the movement duration.
  • If your application requires a strict minimum jerk trajectory, you can use the “minjerkpolytraj function that generates a minimum jerk polynomial trajectory from given set of input waypoints with their corresponding time points.
  • This function returns positions, velocities, accelerations, and jerks at the given number of samples.
You may refer to this documentation link for more information
Hope this clears your query!
  댓글 수: 1
Gal
Gal 2024년 5월 4일
Hi Muli,
thanks for your reply.
its not exactly what ia have asked about. i will try to rephrase my question.
at the transformaj.m file there is an example code for how to use the function. (see below)
while i ran it, i had noticed the two trajectories (default time scaling and the "minimum jerk" time scaling) doesnt start and ends at the same time points (tpts at the code).
why doesn't the trajectory, using the "minimum jerk" time scaling, follows the same time interval as the default time scaling (linear)? how can it be fixed?
Cheers Gal
% Define time vector
tvec = 0:0.01:5;
% Define time over which rotation will occur
tpts = [1 4];
% Build transforms from two orientations and positions
T0 = axang2tform([0 1 1 pi/4]);
TF = axang2tform([1 0 1 6*pi/5]);
TF(1:3,4) = [1 -5 23]';
% Interpolate between the points
[tfInterp1, v1, a1] = transformtraj(T0, TF, tpts, tvec);
% Interpolate between the points using a cubic time scaling
[s, sd, sdd] = minjerkpolytraj([0 1], tpts, numel(tvec));
[tfInterp2, v2, a2] = ...
transformtraj(T0, TF, tpts, tvec, 'TimeScaling', [s; sd; sdd]);
% Compare the position interpolation
figure
plot(tvec, reshape(tfInterp1(1:3,4,:),3,size(tfInterp1,3)))
title('Linear (Solid) vs Min Jerk (Dashed) Position Time Scaling')
hold all
plot(tvec, reshape(tfInterp2(1:3,4,:),3,size(tfInterp1,3)), '--')
hold off

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by