To smooth the 3D track by using low pass or sgolay filter.

2 Ansichten (letzte 30 Tage)
Hi Everyone.
I have my vehicle model to move on the track. So, i have 3 data sets x,y ,z and by using these vectors i genrated a 3D track.I would like to smooth my path by using filters. I tried with low pass and sgolay filter but they are not working well or maybe i didn't use them correctly.Can anybody help to smooth the track.i have attached a matlab file.Thank you

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 1 Jun. 2020
Try this
a = [0 9 10 9 8 7 6 4 2 -12 4 3 5 8 7 11 14 6 5 0 -4 -3 -15 -11 -9 -4 0];
b = [0 0 5 10 2 10 7 12 6 12 14 20 18 12 17 6 3 -20 -4 -20 -2 -20 -2 9 -1 0 0];
c = [0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 -15 -5 -10 0 15 2 10 -2 0 0];
t = linspace(0, 1, numel(a));
tq = linspace(0, 1, 10*numel(a));
x = pchip(t, a, tq);
y = pchip(t, b, tq);
z = pchip(t, c, tq);
plot3(a,b,c)
hold on
plot3(x,y,z)
grid on
xlabel('X(m)');
ylabel('Y(m)');
zlabel('Z(m)');
You can also try to replace pchip with spline() and makima()
  2 Kommentare
Imtiaz Ahmad
Imtiaz Ahmad am 1 Jun. 2020
Hello Mr. Ameer Hamza,
Thank you so much.It worked for me.
Ameer Hamza
Ameer Hamza am 2 Jun. 2020
I am glad to be of help!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Interpolation 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!

Translated by