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 Center および File ExchangeSurface 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