Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In MATLAB, help is greatly appreciated. Use the vector and rotation functions you created above to find the endpoints of the links in a planar

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedIn MATLAB, help is greatly appreciated.

Use the vector and rotation functions you created above to find the endpoints of the links in a planar arm. In addition to standard Matlab functions, your code may assume that you have access to the functions you created in previous assignments (some of these you will call directly in this assignment, some will only be called by other functions that you call). Remember that for these functions, the grading script will use the instructor's copy of the functions: vector_set_rotate vector_set_cumulative_sum planar_rotation_set R_planar rotation_set_cumulative_product 4 5 6 1 function [link_ends,... R_joints,... R_links,... link_vectors_in_world, ... link_end_set,... link_end_set_with_base] = planar_robot_arm_endpoints(link_vectors, joint_angles) 7 % Take a set of link vectors and joint angles, and return a matrix whose 8 % columns are the endpoints of all of the links (including the point that 9 % is the first end of the first link, which should be placed at the 10 % origin). 11 % 12 % Inputs: 13 % 14 % link_vectors: a 1xn cell array, each element of which is a 2x1 vector 15 % describing the vector from the base of the corresponding link to 16 % its end 17 % joint_angles: a nx1 vector, each element of which is the joint angle 18 % preceeding the corresponding link 19 % 20 % Outputs: 27 % 20 % Outputs: 21 % 22 % link_ends: a 3x(n+1) matrix, whose first column is the location 23 % of the base of the first link (which should be at the origin), and 24 % whose remaining columns are the endpoints of the links 25 % 26 % Additional outputs (These are intermediate variables. Having the option to return them as outputs lets our automatic code checker tell you 28 % where problems are in your code): 29 % 30 % R_joints: The rotation matrices associated with the joints 31 % R_links: The rotation matrices for the link orientations 32 % link_vectors_in_world: The link vectors in their current orientations 33 % link_end_set: The endpoints of the links after taking the cumulative 34 % sum of link vectors 35 36 37 38 39 %%%%%%%% % First, generate a cell array named 'R_joints' that contains a set of % rotation matrices corresponding to the joint angles 40 41 42 43 44 45 % Second, generate a cell array named 'R_links' that contains the % orientations of the link frames by taking the cumulative products of % the joint rotation matrices 46 47 48 49 50 51 52 %%%%%%%% % Third, generate a cell array named 'link_vectors_in_world' that % contains the link vectors rotated by the rotation matrices for the % links 53 54 55 56 57 % Fourth, generate a cell array named 'link_end_set' that contains the % endpoints of each link, found by taking the cumulative sum of the % link vectors 58 59 60 61 %%%%%%%% 707076/070707070 62 63 % Fifth, add a cell containing a zero vector (for the origin point at % the base of the first link) to the beginning oflink_end_set, saving % the result in a cell array named 'link_end_set_with_base 64 65 66 67 79/9/7/9/ 70/0/0/0/0/0/0/0 68 % Sixth, convert the set of link vectors to a simple matrix using the % 'cell2mat' command, saving the result in a matrix named 'link_ends' | 69 70 71 72 73 end Code to call your function C Reset 1 link_vectors = {(1;0],[1;0]}; 2 joint_angles = [pi/4; -pi/2]; 4 [link_ends,... R_joints,... 6 R_links,... link_vectors_in_world, ... link_end_set,... link_end_set_with_base] = planar_robot_arm_endpoints(link_vectors, joint_angles) 8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions