Wondering about Pure Pursuit Algorithm Code

5 ビュー (過去 30 日間)
Tran
Tran 2025 年 10 月 9 日
コメント済み: Tran 2025 年 10 月 10 日
I have read many documents about this algorithm and understand how it works.
However, it is hard to use for my report to my lecturer if there is nothing to sure that this block works as it is described in the desciption. Can someone help me find out the code or some way to prove that?
Thank you so much, guys.
  1 件のコメント
Tran
Tran 2025 年 10 月 10 日
I have did a check on this pure pursuit block, with initial position [x y yaw] is [0 0 0] and the postion for 2 points that i created is (1,1) and (2, 0.5).
Then I run the model to check the target direction of PP block, the result is 16.27 degree. I have checked atan2 of that 2 point which gave me 45deg for (1,1) and 14.04deg for ( 2, 0.5). At this time i set lookahead distance is 1m so no point will be caught right? For the result is 16.27, so I thought that the point matlab was chasing is the interpolated point between 2 points.
After that, I create a check line (pink one) try to know what is that block function chasing. But i cannot explain what is happenning.
So I change the ld to 1.5m, the Target direction change to 14.04 deg which is the second point. But if as describtion is chasing the interpolated point, the result shoule be the point (1.2, 0.9) on the figure 4.
Even if i change the initial yaw to pi/2 the result will be -75.96 deg, which is still the (2, 0.5).
Can someone help me with this.
Thank you for helping me.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2025 年 10 月 10 日
edit controllerPurePursuit
The source code is provided.
  1 件のコメント
Tran
Tran 2025 年 10 月 10 日
Thank you so much, Sir.
Have a good day.
Guys just need to type 'edit controllerPurePursuit' in Command Window to see the code.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by