# how to handle multiple way-points for 2D path following

조회 수: 9(최근 30일)
William Campbell 2020년 2월 22일
댓글: William Campbell 2021년 9월 13일
I am trying to generate a path following profile from multiple way-points that I generated from path planning. My path following algorithm is in a MatLab function within a Simulink model which includes a controller and a simple kinematic model. I can run the Simulink model each time for one pair of successive way-points and get a sensible path between these successive way-points, but am struggling to feed in all 'pairs' of waypoints through the simulation and get an xy profile of the whole path. Am I approaching this problem from the correct angle ie asking the controller to calculate a path between each successive pair of way-points and plot the overall profile.
##### 댓글 수: 2표시숨기기 이전 댓글 수: 1
William Campbell 2020년 2월 23일
Hello Jacob,
thanks for your comments - I have been struggling with the for-loop within the MatLab function script but don't seem to be getting too far. I get the 1-D input vectors of my way-points into the function script from the workspace and the first set of way-points flow through the algorithm calculations and output the variables to the controller and kinetic model in Simulink. But I am not able to get the for-loop to create an x-y matrix once the current x-position is close to the x-position of the second way-point, reset the initial conditions of the kinematic model and advance to the next pair of way-points. I believe there is a Robotic toolbox on later MatLab versions but these are later than the version I am using (R2017a). Do you know of any example scripts that I could look at in R2017a ?

댓글을 달려면 로그인하십시오.

### 채택된 답변

Amrtanshu Raj 2021년 9월 13일
Hi,
As per my understanding you have a set of waypoints and want to get a path through those points. You can use the purePursuit controller and step it to get a complete path. It also lets you add constraints to the motion.
##### 댓글 수: 1표시숨기기 없음
William Campbell 2021년 9월 13일
Hello Amrtanshu,

댓글을 달려면 로그인하십시오.

R2017a

### Community Treasure Hunt

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

Start Hunting!

Translated by