Home / Expert Answers / Mechanical Engineering / please-use-matlab-only-please-use-matlab-only-e4-3-sampling-the-free-configuration-space-for-the-pa591

(Solved): PLEASE USE MATLAB ONLY PLEASE USE MATLAB ONLY E4.3 Sampling the Free Configuration Space for the ...



PLEASE USE MATLAB ONLY

E4.3 Sampling the Free Configuration Space for the 2-Link Robot
In this exercise you will determine the free configuration sp

Write the following functions:
plore Vironment
Input L, L, W, P. (X,Y),
Output: the function plot the two-link manipulator de

PLEASE USE MATLAB ONLY

E4.3 Sampling the Free Configuration Space for the 2-Link Robot In this exercise you will determine the free configuration space for a two-link manipulator in a workspace with a circular obstacle. The configuration of this manipulator is described by two angles, saya and B, and the configuration space is thus a 2-torus. It is not always easy to directly compute the free configuration space for multi-body robots. In this exercise, you are asked to grid the configuration space and test all grid points to determine whether they are safe (ie, collision-free) Assume that: . L. and L, be the length of the first and second link, respectively. . Each link is shaped like a rectangle with semi-circles at both ends, as in the fig The environment contains 1 circular obstacle, with center (xy), and radius r. The angles a and are expressed in radians. . . Each link bas width 2W. Write the following functions: plore Vironment Input L, L, W, P. (X,Y), Output: the function plot the two-link manipulator defined by L. L2, W, Q. B. and the obstacle defined by (x,y) and checkCollision TwoLink Input: L1,L, W, B. (X.y.), Output: the function returns 1 if the two-link manipulator defined by L., L., W., B collides with the obstacle defined by X-.ve) and r. The function returns 0 otherwise. plotSampleConfigurationSpace TwoLink Input. L., L., W. (yd), 1 sampling_method, n Output: the function plots the sampled free configuration space of the two-link manipulator defined by L., L., W.In particular, the function (1) determines n sample points in the configuration space according to the sampling method specified in the parameter sampling_method, (ii) draws a black dot at the sample (a, b) if the first link collides with the obstacle, a red dot at the sample (a, b) if the second link collides with the obstacle, and a blue dot otherwise. Use the sampling methods you developed in Lab 4. motion Planning WoLink Input L, L., W... B. , B. XY), r. sampling_method, n Output: the function computes a collision-free path between the initial configuration o. Bo and the final configuration C. B.. The function first construct a roadmap of the free configuration space, by sampling ni configuration points based on the method specified in sampling method, and by connecting neighboring collision- free points. Assume that the path between two collision-free points is also collision-free. Second, function determines the closest sampled points (tay so and s.) to the initial and final robot configurations. Third, the function uses the BFS algorithm to compute a path on the roadmap between so and s.. Finally, the function plots the environment with the robot and obstacle along the computed path. Besides your Matlab functions, to show that your code works properly, you should turn in a brief document containing the output and plots of your functions for some example cases.


We have an Answer from Expert

View Expert Answer

Expert Answer


% switch flag, case 0 [sys,x0,str,ts]=mdlInitializeSizes(Xi); % Initialization case 1 sys = mdlDerivatives(t,x,u); % Calculate derivatives case 3 sys = mdlOutputs(t,x); % Calculate outputs case { 2, 4, 9 } % Unused flags sys = []; otherwise error(['U
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe