ME 449 Assignment 1
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.
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"
Step-By-Step Assignment Instructions
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.
The Main script and any child scripts will be displayed. The main script contains the simulation's loop code. there is a default main script that contains the basic code the simulation needs to run and usually doesn't need to be edited. 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 ovver threaded since threaded child scripts are more resource-intensive, can waste some proccessing 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 noticce 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 the 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 cchange 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 theXML 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=" Configuration Entry:" controls the text "Configuration Entry" on the "Enter Config and SE(3) Value" table 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.