how can I create a (8 or infinity) shaped trajectory using 'WaypointTrajectory' or 'KinematicTrajectory' system object?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
BISWAJIT NAIK
am 19 Feb. 2022
Kommentiert: BISWAJIT NAIK
am 8 Mär. 2022
I want waypoints ? and Euler angles? for that.
0 Kommentare
Akzeptierte Antwort
Ryan Salvo
am 1 Mär. 2022
Hi Biswajit,
Here is code that will create a figure 8 shaped trajectory with the waypointTrajectory object.
Thanks,
Ryan
% Specify waypoints, times of arrival, and sampling rate.
wp = [0 0 0; 2 -2 0; 4 0 0; 6 2 0; 8 0 0; 6 -2 0; 4 0 0; 2 2 0; 0 0 0];
toa = 4*(0:size(wp,1)-1).';
Fs = 100;
% Create trajectory.
traj = waypointTrajectory(wp, toa, SampleRate=Fs);
% Get position.
t = 0:1/Fs:toa(end);
pos = lookupPose(traj, t);
% Plot.
figure
plot(pos(:,1), pos(:,2))
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Assembly finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!