
UAV Path Following Path Switching Problem
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammed Emin Yavuzaslan
am 10 Mär. 2025
Kommentiert: Muhammed Emin Yavuzaslan
am 19 Mär. 2025
Hi everyone ,
I'm trying to implement a path following algorithm for UAV (Carrot Chase) with matlab for a line-circle path.
I have already implemented the algorithm for straight line and the loiter separately and this codes are work fine. But, since they are geometrically different shapes, they have different algorithms. So we need to switch algorithms when switching between these two shapes if we want to follow this two shapes together . And i added a algorithm for that but i have a problem.
After following the first straight path and following the first loiter path, it should have moved on to the second straight path, but it follows the first loiter path forever.
How can we fix it ?
Thanks
0 Kommentare
Antworten (1)
Altaïr
am 17 Mär. 2025
In the carrot chase algorithm, I assume that (XM0, YM0), and (XT0, YT0) represent the current and target waypoints respectively. Since these variables are defined as inputs to the carrotchase_ode function, they get re-initialized at each iteration. To address this, declare them as persistent variables and use different names for the corresponding inputs in carrotchase_ode. This ensures they retain their values across iterations.

Persistent variables start as empty, and this property can be used to set their initial values. After making these changes, consider debugging the logic for switching between the algorithms for line and circle. For more information on persistent variables, kindly refer to the documentation: https://www.mathworks.com/help/releases/R2023a/matlab/ref/persistent.html
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!