Mobile robot tracking behavior in XY graph

1 view (last 30 days)
T.R.O
T.R.O on 27 Aug 2022
Commented: T.R.O on 28 Aug 2022
I'm trying to mimic the travel path of a robot in an XY graph on simulink and trying to enter a desired trajectory block in matlab using just XY dimensions but I'm unsure how to go about that.
I'm also trying to place obstacles on the XY graph using a simulink block with the desired obstacle location in the X and Y plane.

Answers (1)

Sam Chak
Sam Chak on 27 Aug 2022
Edited: Sam Chak on 28 Aug 2022
You can try generating the Cubic Polynomial Trajectory. Check this example and see if it is good enough or suitable for your case.
Edit: To suggest using the sawtooth function to generate the triangular path for the mobile robot to track.
p = 40; % period of a triangle wave
T = 1.5*p; % 1.5 periods of a triangle wave
fs = 1000; % sample rate
t = 0:1/fs:T-1/fs;
sTr = sawtooth(2*pi/p*t, 0.5); % standard triangle wave
aTr = 10*(sTr + 1) + 2; % augmented triangle wave
plot(t, aTr)
grid on, ylim([0 25]), xlabel('x-axis'), ylabel('y-axis')
title('Desired trajectory for the Mobile Robot to follow')
  3 Comments
Sam Chak
Sam Chak on 28 Aug 2022
Hi @T.R.O, I have edited my Answer to show you how to design the triangle wave-like trajectory.
T.R.O
T.R.O on 28 Aug 2022
Thank you so much Sam. Very helpful.
The only other question I had was how to add obstacles in the XY plot in simulink like the picture shown below.
Thanks again

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!