Make a plot of a planar a 3-link arm, with each link drawn as an individual line. The arm links should be 1, 1, and 0.5 units long. Each should be along the x axis of the local frame, and the joint angles between the link frames should be and 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 planar_robot_arm_endpoints rotation_set_cumulative_product . . R_planar • . create_axes . build_links • place_links . . draw_links If your code is correct, the output should resemble the figure below. Note that your parameters (joint_angles, link_vector or link_color) may differ from those in the example ** 44 42 planar_robot_arm_links . as ** 12 14 14

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

MATLAB plss help !!!

**Educational Content on Plotting a Planar 3-Link Arm**

**Objective:**
Create a plot of a planar 3-link arm using individual lines for each link. The link lengths should be 1, 1, and 0.5 units, respectively. Each link aligns along the x-axis of the local frame, and the joint angles between link frames are specified as \( \frac{2}{3}\pi \), \( -\frac{1}{2}\pi \), and \( \frac{1}{4}\pi \).

**Instructions:**
Your task is to use certain MATLAB functions—some predefined and others from previous assignments—to construct the arm. Be aware that the grading script will use the instructor's copy of these functions. The necessary functions include:

- `vector_set_rotate`
- `vector_set_cumulative_sum`
- `planar_rotation_set`
- `planar_robot_arm_endpoints`
- `R_planar`
- `rotation_set_cumulative_product`
- `create_axes`
- `build_links`
- `place_links`
- `planar_robot_arm_links`
- `draw_links`

**Expected Output:**
Your code should produce a diagram similar to the example provided. Depending on your parameters (like joint angles, link vector, or link color), your graph may vary. 

**Graph Explanation:**
The plotted example displays a three-segment line representing the articulated arm. The x-axis ranges from 0 to 1.8 units, and the y-axis spans approximately from -0.6 to 0.6 units. The line segments are joined at angles corresponding to the specified joint angles, demonstrating the arm's structure as computed from your code logic.

By ensuring the accuracy of these calculations and the use of the functions, the plotted graph will depict a correct representation of the arm configuration.
Transcribed Image Text:**Educational Content on Plotting a Planar 3-Link Arm** **Objective:** Create a plot of a planar 3-link arm using individual lines for each link. The link lengths should be 1, 1, and 0.5 units, respectively. Each link aligns along the x-axis of the local frame, and the joint angles between link frames are specified as \( \frac{2}{3}\pi \), \( -\frac{1}{2}\pi \), and \( \frac{1}{4}\pi \). **Instructions:** Your task is to use certain MATLAB functions—some predefined and others from previous assignments—to construct the arm. Be aware that the grading script will use the instructor's copy of these functions. The necessary functions include: - `vector_set_rotate` - `vector_set_cumulative_sum` - `planar_rotation_set` - `planar_robot_arm_endpoints` - `R_planar` - `rotation_set_cumulative_product` - `create_axes` - `build_links` - `place_links` - `planar_robot_arm_links` - `draw_links` **Expected Output:** Your code should produce a diagram similar to the example provided. Depending on your parameters (like joint angles, link vector, or link color), your graph may vary. **Graph Explanation:** The plotted example displays a three-segment line representing the articulated arm. The x-axis ranges from 0 to 1.8 units, and the y-axis spans approximately from -0.6 to 0.6 units. The line segments are joined at angles corresponding to the specified joint angles, demonstrating the arm's structure as computed from your code logic. By ensuring the accuracy of these calculations and the use of the functions, the plotted graph will depict a correct representation of the arm configuration.
## Function

```matlab
function [link_vectors,...
    joint_angles,...
    link_colors,...
    link_set,...
    ax,...
    1] = ME317_Assignment_draw_planar_arm_individual_links
% Draw the arm as a set of lines, one per link and each of a different color

%%%%%%%%%%%%%%%%%%%
% Specify link vectors as a 1x3 cell array of 2x1 vectors, named 
% 'link_vectors'

link_vectors = cell(1,3);
link_vectors{1} = [1;0];
link_vectors{2} = [1;0];
link_vectors{3} = [0.5;0];
%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%
% Specify joint angles as a 3x1 vector, named 'joint_angles'

joint_angles = [2*pi/5; -pi/2; pi/4];
%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%
% Specify colors of lines as a 1x3 cell array named 'link_colors'. Each
% entry can be either a standard matlab color string (e.g., *k* or *r*)
% or a 1x3 vector of the RGB values for the color (range from 0 to 1)

link_colors = {'k', 'b', 'k'};
%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%
% Generate a cell array named 'link_set' containing start-and-end
% x points for the links, named link_set

[link_set,...
    R_joints,...
    R_links,...
    link_set_local,...
    link_vectors_in_world,...
    links_in_world_0,...
    links_end_set,...
    link_end_set_with_base] = planar_robot_arm_links(link_vectors,joint_angles);
%%%%%%%%%%%%%%%%%%%

% Create figure and axes for the plot, and store the handle in a
% variable 'named 'ax'

[ax, ~] = create_axes(69402);
%%%%%%%%%%%%%%%%%%%

% Use 'draw_links' to draw the link_set, saving the output as a
% variable 'l'

l = planar_draw_links(link_set, link_colors, ax);
end
```

### Code to Call Your Function

```matlab
[link_vectors,...
    joint_angles,...
    link_colors,...
    link_set,...
    ax,...
    l] = ME317_Assignment_draw_planar_arm_individual_links;
```

### Explanation

The function `ME317_Assignment_draw_planar_arm_individual_links` is a MATLAB script for visual
Transcribed Image Text:## Function ```matlab function [link_vectors,... joint_angles,... link_colors,... link_set,... ax,... 1] = ME317_Assignment_draw_planar_arm_individual_links % Draw the arm as a set of lines, one per link and each of a different color %%%%%%%%%%%%%%%%%%% % Specify link vectors as a 1x3 cell array of 2x1 vectors, named % 'link_vectors' link_vectors = cell(1,3); link_vectors{1} = [1;0]; link_vectors{2} = [1;0]; link_vectors{3} = [0.5;0]; %%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%% % Specify joint angles as a 3x1 vector, named 'joint_angles' joint_angles = [2*pi/5; -pi/2; pi/4]; %%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%% % Specify colors of lines as a 1x3 cell array named 'link_colors'. Each % entry can be either a standard matlab color string (e.g., *k* or *r*) % or a 1x3 vector of the RGB values for the color (range from 0 to 1) link_colors = {'k', 'b', 'k'}; %%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%% % Generate a cell array named 'link_set' containing start-and-end % x points for the links, named link_set [link_set,... R_joints,... R_links,... link_set_local,... link_vectors_in_world,... links_in_world_0,... links_end_set,... link_end_set_with_base] = planar_robot_arm_links(link_vectors,joint_angles); %%%%%%%%%%%%%%%%%%% % Create figure and axes for the plot, and store the handle in a % variable 'named 'ax' [ax, ~] = create_axes(69402); %%%%%%%%%%%%%%%%%%% % Use 'draw_links' to draw the link_set, saving the output as a % variable 'l' l = planar_draw_links(link_set, link_colors, ax); end ``` ### Code to Call Your Function ```matlab [link_vectors,... joint_angles,... link_colors,... link_set,... ax,... l] = ME317_Assignment_draw_planar_arm_individual_links; ``` ### Explanation The function `ME317_Assignment_draw_planar_arm_individual_links` is a MATLAB script for visual
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Probability Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education