[tforms,vel,acc] = transformtraj(T0,TF,tInterval,tSamples)
generates a trajectory that interpolates between two 4-by-4 homogeneous transformations,
T0 and TF, with points based on the time
interval and given time samples.
Interpolate between the points. Plot the trajectory using plotTransforms. Convert the transformations to quaternion rotations and linear transitions. The figure shows all the intermediate transformations of the coordinate frame.
Initial transformation, specified as a 4-by-4 homogeneous transformation. The
function generates a trajectory that starts at the initial transformation,
T0, and goes to the final transformation,
TF.
Data Types: single | double
TF — Final transformation 4-by-4 homogeneous transformation
Final transformation, specified as a 4-by-4 homogeneous transformation. The function
generates a trajectory that starts at the initial transformation,
T0, and goes to the final transformation,
TF.
Data Types: single | double
tInterval — Start and end times for trajectory two-element vector
Start and end times for the trajectory, specified as a two-element vector in
seconds.
Example: [0 10]
Data Types: single | double
tSamples — Time samples for trajectory m-element vector
Time samples for the trajectory, specified as an m-element vector
in seconds. The output trajectory, rotVector, is a vector of
orientations.
Example: 0:0.01:10
Data Types: single | double
Name-Value Pair Arguments
Specify optional
comma-separated pairs of Name,Value arguments. Name is
the argument name and Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
Example: 'TimeScaling',[0 1 2; 0 1 0; 0 0 0]
'TimeScaling' — Time scaling vector and first two derivatives 3-by-m vector
Time scaling vector and the first two derivatives, specified as a
3-by-m vector, where m is the length of
tSamples. By default, the time scaling is a linear time scaling
between the time points in tInterval.
For a nonlinear time scaling, specify the values of the time points as positions
in meters in the first row. The second and third rows are the velocity and
acceleration of the time points in m/s and m/s2,
respectively. For example, to follow the path with a linear velocity to the halfway
point, and then jump to the end, the time-scaling would
be:
Transformation trajectory, returned as a 4-by-4-by-m homogeneous
transformation matrix array, where m is the number of points in
tSamples.
vel — Transformation velocities 6-by-m matrix
Transformation velocities, returned as a 6-by-m matrix in m/s,
where m is the number of points in tSamples. The
first three elements are the angular velocities, and the second three elements are the
velocities in time.
acc — Transformation accelerations 6-by-m matrix
Transformation accelerations, returned as a 6-by-m matrix in
m/s2, where m is the number of points in
tSamples. The first three elements are the angular accelerations,
and the second three elements are the accelerations in time.
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.