Difference between revisions of "ME 449 Assignment 1"

From Mech
Jump to navigationJump to search
Line 1: Line 1:
'''Introduction'''
'''Introduction'''


In the next chapter, we will address the forward kinematics problem for open-chain robots: finding the configuration of the robot's end-effector in ''T(0) SE(3)'' given the vector of joint positions.
In the next chapter, we will address the forward kinematics problem for open-chain robots: finding the configuration of the robot's end-effector <math>T(\theta) \in SE(3)</math> given the vector of joint positions.


The forward kinematics problem is easy to solve using a formula called the "product of exponentials," which uses the matrix exponential of this chapter.
The forward kinematics problem is easy to solve using a formula called the "product of exponentials," which uses the matrix exponential of this chapter.

Revision as of 17:55, 30 September 2020

Introduction

In the next chapter, we will address the forward kinematics problem for open-chain robots: finding the configuration of the robot's end-effector given the vector of joint positions.

The forward kinematics problem is easy to solve using a formula called the "product of exponentials," which uses the matrix exponential of this chapter.

In this rather simple project, you will let the robot simulation software CoppeliaSim solve the forward kinematics for you. The goal of this project is to gain familiarity with CoppeliaSim and to confirm its calculation of the forward kinematics by visual inspection. You will submit a screenshot of the UR5 robot at a specific configuration.


Review Criteria

The assignment consists of the following:

  • A screenshot of the robot at its final configuration.
  • A list of reported joint angles.
  • A list of rotation matrices giving the orientation of each joint relative to the previous joint (Rs1, R12, R23, etc.)
  • Reported value of Rse (Rotation matrix giving the orientation of end-effector frame {e} relative to the world frame {s}).
  • Screenshots of the CoppeliaSim UI modifications you performed.

All reported values should be in a single pdf. This pdf and all screenshots should be submitted in a SINGLE .zip file labeled "lastname_firstname_assignment1.zip"


Part 1: Joint Angle Calculations

The UR5 robot in its home configuration is shown. {s} and numbers represent the world frame and the corresponding joint frames, respectively. When all of its joints are at 0°, the frames located at the joints and the world frame are parallel (i.e., Rij = I; ∀ i, j ∈ {s,1,2,3,4,5,6}).

UR5 Home.PNG

The rotation axes of each joint in their own coordinate frames are as follows:

  • 1 = (0,0,1)T
  • 2 = (0,1,0)T
  • 3 = (0,1,0)T
  • 4 = (0,1,0)T
  • 5 = (0,0,-1)T
  • 6 = (0,1,0)T

At an unkown configuration, the following relations between the joint frames are given:

  • R13 = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}
  • Rs2 = {{0, -1, 0}, {-0.5, 0, -0.866}, {0.866, 0, -0.5}}
  • R15 = {{-0.3536, -0.3536, 0.866}, {-0.7071, 0.7071, 0}, {-0.6124, -0.6124, -0.5}}
  • R12 = {{-0.5, 0, -0.866}, {0, 1, 0}, {0.866, 0, -0.5}}
  • R34 = {{-0.866, 0, -0.5}, {0, 1, 0}, {0.5, 0, -0.866}}
  • Rs6 = {{-0.3536, -0.7071, 0.6124}, {-0.5732, -0.3536, -0.7392}, {0.7392, -0.6124, -0.2803}}
  • R6e = {{-1, 0, 0}, {0, 0, 1}, {0, 1, 0}}

where e corresponds to the end-effector frame and is not shown in the figure.

  • Find the joint angles in this configuration.
    • Hint: A joint angle corresponds to the orientation of one joint frame with respect to the orientation of the previous joint frame.
  • Input the joint angles you found into Scene1_UR5 in CoppeliaSim and take a screenshot of the robot at that configuration.
  • Find Rse and verify your result by comparing it with the given Tse under the "Enter Config and SE(3) Value" tab.


Part 2: CoppeliaSim Simulation and Exploration

Open the CoppeliaSim scene for interactive manipulation of the Universal Robots UR5 robot, a popular 6-joint robot. (See the instructions about CoppeliaSim in the first module of week 1, or go directly to CoppeliaSim Introduction and download Scene 1.)

When you run this scene you will see a window with 2 tabs:"Enter Config and SE(3) Value" and "Joint Angle Sliders". Go to the "Joint Angle Sliders" tab, move the sliders corresponding to the 6 joints and watch how the robot moves.

Click the "Scripts" button on the toolbar on the left side of the screen (shown below) to see the scripts being run by the scene.

CoppeliaSim scripts.PNG

The Main script and any child scripts will be displayed. There is a default main script that contains the basic code the simulation needs to run and usually doesn't need to be edited. The main script contains the simulation's loop code. Each object in the scene has an associated child script. The child script is typically used to control the model and contains functions written in the Lua programming language. Child scripts can be non-threaded or threaded. Non-threaded child scripts contain system callback functions that happen every step in the simulation. Threaded child scripts contain system callback functions that are called once at the beginning of the simulation. Non-threaded child scripts are preferred over threaded since threaded child scripts are more resource-intensive, can waste some processing time, and can be less responsive to the simulation stop command. For more details on non-threaded and threaded child scripts, see Child Scripts.

For more information about the main script and child scripts, see Main and Child Scripts. The simulation must be stopped before you can make any edits to or open a script.

For Scene 1, we will be looking at the "Non-threaded child script (UI_Script)." Double-click this script and another window containing the code will pop up. You might notice some of the functions look similar to functions written in the Modern Robotics Library. For example, so3andp2se3(R,p) in this script resembles RpToTrans(R,p) in the Modern Robotics Library. The code for the Custom UI that appears when the simulation starts is written in XML and starts on line 251. This XML code controls the appearance of the Custom UI, including the layout and content of text boxes, sliders, tab titles, and font size. The XML syntax can be found at Custom UI Plugin XML Syntax. For this specific scene, the different text boxes and sliders are arranged in different groups. Each group has a layout which determines how the objects inside the group will be displayed and label text which determines what text will be displayed and how it will be displayed. Consult the XML syntax for the attributes each element can have.

More information on CoppeliaSim can be found in the CoppeliaSim User Manual. There is also a CoppeliaSim forum. You can take a look at the scripts of the included example scenes and demos to see how their functions and UIs were defined and to get a better idea of how the scripts run the simulation.


Your Task: Modify the Non-threaded child script (UI_Script) to change an aspect of the scene. For example, you can choose to change the Custom UI layout, change the titles and words of the Custom UI, or change font sizes in the Custom UI. Some example changes include:

  • Changing the layout: consult the XML syntax and change <group layout="vbox"> to another type (hbox,form, grid, none). Using line 257, changing <group layout="vbox"> to <group layout="hbox"> changes the orientation of the items in the group containing "Configuration Entry", "Current configuration", and "Messages" on the "Enter Config and SE(3) Value" tab of the Custom UI from vertically arranged to horizontal.
  • Changing the words: Find the text you want to change in the XML code. The text will be surrounded by quotation marks and have and on its sides. For example, line 258 "label text="<big> Configuration Entry:</big>" controls the text "Configuration Entry" on the "Enter Config and SE(3) Value" tab of the Custom UI. Change the words "Configuration Entry" to change the text displayed in that specific section.
  • Changing the font: Using line 258 label text="<big>Configuration Entry:</big>"
    • The font can be changed to small using: label text="<small>Configuration Entry:</small>"
    • The font can be changed to a specific size using: label text="<font size=20>Configuration Entry:</font>", where 20 is the desired font size.

Your submission should be a screenshot of the original scene and then a screenshot that shows what was changed. Additionally, you should include a screenshot of the code you modified. For example, if you change the font size of the text in the Custom UI, you would include a screenshot of the Custom UI before any changes were made, a screenshot of the Custom UI with the font size change, and a screenshot of the XML code where you made the modification.


You should use the screenshot command appropriate for your operating system:

  • Mac: Cmd-Shift-3 and look for the screenshot on your desktop.
  • Windows: Use the PrtScn button (or Windows Key + PrtScn or Alt _ PrtScn, etc.). You can also search for the Snipping Tool.
  • Linux: you can use Screenshot or PrtScrn.