Answered step by step
Verified Expert Solution
Question
1 Approved Answer
% % Define the artificial potential field parameters % Points of attraction xa = 7 0 ; ya = 5 0 ; % Location of
Define the artificial potential field parameters Points of attraction xa ; ya ; Location of obstacles nobs ; xo ; yo ; Size of obstacles rho rho; Constants. Ka ; Kv ; Kr ; mass ; Integration step. initial conditions x; y; Initialise simulation parameters x x; y y; vx ; vy ; terminate false; t ; dt ; Store variables for later assessment traj ; Fac ; Frc ; Fdc ; Fc ; while~terminate Check if reached destination rho sqrtxaxyay; ifrho terminate true; end Calculate the conservative forces Attractive force Fa Fa zeros; INSERT YOUR CODE HERE Fac Fac Fa; Repulsive force Fr Fr zeros; INSERT YOUR CODE HERE Frc Frc Fr; Damping force Fd Fd zeros; INSERT YOUR CODE HERE Fdc Fdc Fd; Total force F INSERT YOUR CODE HERE Fc Fc F; Velocity and Position vx vy x y through integrating the equations INSERT YOUR CODE HERE traj traj x;y; plot the trajectory end Display the results Plot the trajectory figure; Now the attractive potential contour xmin ; xmax ; ymin ; ymax ; XY meshgridxmin::xmax,ymin::ymax; Z KasqrtXxaYya; Zmax maxmaxZ; Z ZZmax; contourXYZ;hold on; plottrajtrajbo'LineWidth',; plotxayabx'LineWidth',; xlabelxm; ylabelym; axisequal; The obstacle contours for kk :nobs r ::rhokk; tht ::pi; THTR meshgridthtr; Z KrkksqrtRcosTHTRsinTHTrhokk; Zmax maxmaxZ; Z ZZmax; contourxokkRcosTHTyokkRsinTHTZ; end Draw the obstacle boundaries for jj :nobs tht ::pi; xobs xojjrhojjcostht; yobs yojjrhojjsintht; plotxobsyobs,:r'LineWidth',; end Finally, plot the trajectory plottraj:traj:g'LineWidth',; hold off; axis equal; axis tight; Insert code in required space The task in term project is to implement the artificial potential function path planning algorithm for the drone scenario shown in figure TP x Figure TP: Drone path scenario.The obstacles in the path of the drone have the size, coordinates and repulsive gain given in table TP below, Kr Obstacle Position Radius Table TP: Obstacle parameters. Furthermore, the initial drone position is and the location of the desired target point is Your task is to complete the code template provided and to show that a feasible path can be generated using the artificial potential function method. The drone equations of motion can be represented by a simple doubleintegrator model in dimensions xy Assume the vehicle has a mass of kg The Potential functions should take the following form,Furthermore, the initial drone position is and the location of the desired target point is Your task is to complete the code template provided and to show that a feasible path can be generated using the artificial potential function method. The drone equations of motion can be represented by a simple doubleintegrator model in dimensions xy Assume the vehicle has a mass of kg The Potential functions should take the following form, Attractive: Ua Kap? rho Rho omicron Repulsive: U K p PO Pr Pol where Pa x xay ya and Por x Xobsy Yobs When developing the appropriate APF control law, you should also include an additional force proportional to the drone velocity as follows, FxK Vx F yy K Vy Remember to use the variable names specified in the template code for each of the simulation terms. Failure to do so will result in failure of the Matlab Grader tests. Once your code have passed all of the MATLAB Grader tests, you MUST press SUBMIT for marking.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started