EECS C106A - Midterm 1 2018 Solutions PDF

Title EECS C106A - Midterm 1 2018 Solutions
Author Jack Chung
Course Introduction to Robotics
Institution University of California, Berkeley
Pages 18
File Size 411.6 KB
File Type PDF
Total Downloads 25
Total Views 137

Summary

Introduction to Robotics (EECS C106A) Fall 2018 - Midterm 1...


Description

EECS C106A: Introduction to Robotics Fall 2018 ◦◦◦

Midterm 1 Solutions

Name: SID: Lab Section/TA:

You have 90 minutes to complete this exam. Please do not flip or open this exam until the timer starts.

This exam consists of 9 questions. Tentative point values are given below for each question.

Question:

1

2

3

4

5

6

7

8

9

Total

Points:

18

4

6

4

4

8

4

13

6

67

For full credit, please (a) show all work and (b) write your SID on every page, including the cheat sheet and Appendix.

Tear the Appendix off as soon as you begin, and turn it in separately from your test. A cheat sheet can be found in the Appendix. No other notes or calculators are allowed.

EECS C106A Midterm 1 - Fall 2018

SID:

Question 1: Inverse Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 points Consider the robotic manipulator in Figure 1 of the Appendix. You are given the desired configuration of the end effector with respect to frame W as: 

 gd,D =  

 xD yD   zD  0 1

RD

0

0

The matrix representing the mapping from initial to desired configuration in frame A can be written in the following form: ˆ

ˆ

ˆ

ˆ

g1 = eξ1 θ1 eξ2 θ2 eξ3 θ3 eξ4 θ4 (a) Define the transformation g1 using the initial configuration, gD (0), and final configuration, gd,D , of the end effector. Solution:

ˆ

ˆ

ˆ

(2)

ˆ

gd,D = eξ1 θ1 eξ2 θ2 eξ3 θ3 eξ4 θ4 gD (0) = g1 gD (0) −1 (0) g1 = gd,D gD

(b) Assume that there exist points pW , pB , pC , and pD coinciding with the origins of frames W, B, C, and D respectively. For each of these points, determine whether or not it can be considered an invariant point. If the point can be considered invariant, list the relevant degrees of freedom.

(4)

Solution: pW : invariant, θ1 pB : invariant, θ1 , θ2 pC : invariant, θ2 , θ3 pD : invariant, θ3

(c) Assume that we are given the value of θ4 . Formulate the solution to θ1 as a PadenKahan subproblem. Show the steps taken to reach your solution in addition to definitions for terms like p, q, r, and δ . Solution:

ˆ

ˆ

ˆ

ˆ

Known : θ4 ⇒ g2 := g1 e−ξ4 θ4 = eξ1 θ1 e ξ2 θ2 eξ3 θ3 Choose point pC , invariant to θ2 , θ3

Page 2

(6)

EECS C106A Midterm 1 - Fall 2018 ˆ

ˆ

SID:

ˆ

ˆ

⇒ g2 pC = e ξ1 θ1 eξ2 θ2 eξ3 θ3 pC = eξ1 θ1 pC

p = pC , q = g2 pC , r = [0, 0, ∗]T , PK1 Other solutions do exist! Most notably by using PK3. (d) Formulate a solution to the remaining joints θ2 and θ3 using Paden-Kahan subproblems. Show the steps taken to reach your solution in addition to definitions for terms like p, q, r, and δ . Solution:

ˆ

ˆ

ˆ

Known : θ1 , θ4 ⇒ g3 := e− ξ1 θ1 g2 = eξ2 θ2 eξ3 θ3 Choose point pE , NOT on the ξ2 , ξ3 axes ˆ

ˆ

⇒ g3 pE = eξ2 θ2 eξ3 θ3 pE p = pE , q = g3 pE , r = pC , PK2

Again, other solutions exist.

Page 3

(6)

EECS C106A Midterm 1 - Fall 2018

SID:

Question 2: A Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 points " √ # − 22 −x √ R= x − 2 2

(a) Assume that R is a valid rotation matrix. Solve for x:

(2)

Solution: There are many ways to solve this, including by inspection. One option is to explicitly solve for solutions of x that satisfy orthonormality: I = TTT " √ # #" √ 2 − 22 −x x − 2 √ √ = −x − 22 x − 22   2 1 x +2 0 = 0 x2 + 12 1 x2 = 2√ 2 x=± 2 Both solutions results in a +1 determinant, and are thus valid. (b) Suppose R describes a rotation by an angle θ. Solve for θ :

(2)

Solution: θ=±

3π 4

Question 3: Transformation Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 points (a) Select all operations that are always commutative. AB = BA  Multiple rotation matrices, about orthogonal axes √ Multiple rotation matrices, about parallel axes √ Multiple homogeneous transforms, where all R = I  Multiple homogeneous transforms, where all R = RX ( π4 )  Multiple exponential mappings, with parallel revolute joints √ Multiple exponential mappings, with parallel prismatic joints

(3)

(b) Select all operations that are always associative. (AB )C = A(BC ) √ Multiple rotation matrices, about orthogonal axes √ Multiple rotation matrices, about parallel axes √ Multiple homogeneous transforms, where all R = I

(3)

Page 4

EECS C106A Midterm 1 - Fall 2018

SID:

√ Multiple homogeneous transforms, where all R = RX (4π) √ Multiple exponential mappings, with parallel revolute joints √ Multiple exponential mappings, with parallel prismatic joints

Page 5

EECS C106A Midterm 1 - Fall 2018

SID:

Question 4: Another Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 points  0 0 −1   T = 0 1 0

1 0 0 (a) What conditions must hold for T to be a valid rotation matrix?

(2)

Solution: det(T) = +1 T−1 = TT (b) Assume T is a valid rotation matrix. If we wanted to compute T using Rodrigues’ Formula, what could ω and θ be? Solution:

  0  ω = 1 0 

θ = −90◦ = −

(2)

π 2

or 

0  ω = −1 0

θ = 90◦ =

π 2

Question 5: Multiple Rotation Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 points Given the rotation matrices RGH , RLJ , RGJ , and RLK . (a) Write an expression for RJ H .

(2)

Solution: T RJH = R−1 GJ RGH = R GJ RGH

(b) Write an expression for RKH .

(2)

Solution: T T −1 RKH = R−1 LK RLJ RGJ RGH = R LK RLJ R GJ RGH

Page 6

EECS C106A Midterm 1 - Fall 2018

SID:

Question 6: Homogeneous Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 points Consider independent frames W, A, and B, which are initially overlapping. The following events occur, in order: 1. Frame A is translated along W’s +Z axis by 5 2. Frame A is rotated about its own +X axis by +2π 3. Frame B is rotated about A’s +X axis by −2π

4. Frame B is translated along W’s +X axis by −1

(a) Write the rigid body transform gW A in homogeneous form. Solution: A is rotated by  T W is 0 0 5 .

π 2

(2)

about the X axis with respect to W, and its origin in frame

gW A



 0  RX ( π ) 0 2  =  5 0 0 0 1

(b) Write the rigid body transform gW B in homogeneous form.

(2)

Solution: B is rotated by − 2π about the X axis with respect to W, and its origin in  T frame W is −1 −5 5 .   −1  RX (− π ) −5 2  gW B =   5 0 0 0 1 (c) Write the rigid body transform gBW in homogeneous form. Solution: W is rotated by  T B is 1 5 5 .

π 2

(2)

about the X axis with respect to B, and its origin in frame

gBW

 1  RX ( π ) 5 2  =  5 0 0 0 1 

(d) What are RBA and pB A ?

(2)

Page 7

EECS C106A Midterm 1 - Fall 2018

SID:

Solution: gBA can either be computed directly by inspection, or as a product of our earlier answers: gBA = gB W gW A 

 1 π  RX ( π)  5 2   RX ( 2 ) =  5  0 0 0 1 0 0 0   1  RX (π) 0  =  5 0 0 0 1

 0 0  5 1

Question 7: Velocities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 points (a) Consider an axis in 3D space parallel to a vector ω. We pick a point p that lies on the axis, and an arbitrary point q . If q is rotated about the axis at an angular velocity of +π rad/ sec, what is the instantaneous linear velocity of q? Express in terms of ω, p, and q .

(2)

Solution: Use the fact that linear velocities can be computed with a cross product, and scale it by +π rad/ sec. Note that ω must be normalized. v=π∗

ω × (q − p) kωk

(b) Consider a screw motion, which consists of the following two operations occurring simultaneously: 1. A rotation about the unit axis ω by θ 2. A translation about the same axis ω by θ Let q be a point on the axis ω . What twist ξ describes this motion, in terms of ω, θ, and q ? Solution: This is equivalent to the sum of the linear and angular twists.   ω   0 −ω × q  ξtrans =  ξrot = 0 q 0

Page 8

(2)

EECS C106A Midterm 1 - Fall 2018

ξ = ξtrans + ξrot =

SID:

 −ω × q + ω  ω

Page 9

EECS C106A Midterm 1 - Fall 2018

SID:

Question 8: Forward Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 points Consider the robotics manipulator in Figure 1 of the Appendix. (a) What are ξˆ2 and ξˆ4 ?

(2)

Solution:   ω2 = 0 1 0   q2 = 0 ∗ 10   −ω2 × q2 ξ2 = ω2  = −10 0 0  0 0 1  0 0 0 ξˆ2 =   −1 0 0 0 0 0   v ξ4 = ~ 0  = 0 0  0 0 0 0 ξˆ4 =  0 0 0 0

T 0 1 0  −10 0   0  0

 −1 0 0 0  0 0 0 0  0 −1 0 0

(b) What is the robot’s initial configuration, gW D (0)?

(2)

Solution:  1 0 gW D (0) =  0 0

0 1 0 0

 0 0 0 12   1 5 0 1

(c) What is the robot’s final configuration after its joints are moved to θ1 , θ2 , θ3 , and θ4 ? Leave unsimplified, in terms of the angles, twists, and gW D (0).

Page 10

(1)

EECS C106A Midterm 1 - Fall 2018

SID:

Solution: ˆ

ˆ

ˆ

ˆ

gW D (θ1 , θ2 , θ3 , θ4 ) = eξ1 θ1 eξ2 θ2 eξ3 θ3 eξ4 θ4 gW D (0)

(d) The robot was programmed with ROS. You want to run a single command in your terminal to print out the current joint positions, which are being published to the topic. What command should you run?

(2)

Solution: rostopic echo /joint states (e) You run the command, and see that:

(6) π 2 θ2 = 0 θ3 = 0

θ1 =

θ4 = 2 What is gW D (θ1 , θ2 , θ3 , θ4 )? Solve using exponential mappings, and provide a numerical answer. Show all work for full credit. Solution: ˆ

ˆ

ˆ

ˆ

ˆ

ˆ

gW D (θ1 , θ2 , θ3 , θ4 ) = eξ1 θ1 eξ2 θ2 eξ3 θ3 eξ4 θ4 gW D (0) = e ξ1 θ1 eξ4 θ4 gW D (0)   0   RZ ( π ) 0 2  =   0  0 0 0 0 1   0 1  0  RZ ( π ) 0  2 =  0 0 0 0 0 0 1   −12  RZ ( π ) 0  2  =  3  0 0 0 1

Page 11

I3 0 0 0 1 0 0

0 0 1 0

 1 0 0 0  −2  0 0 1  0 12  3 1

0 1 0 0

 0 0 0 12   1 5 0 1

EECS C106A Midterm 1 - Fall 2018

SID:

Question 9: Programming with ROS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 points (a) Name two mechanics for communicating between ROS nodes. When should we use each one?

(3)

Solution: 1. Topics: continuous streams of data, many-to-one 2. Services: request-response communication, one-to-one or 1. Publishers: for broadcasting data to ROS topics 2. Subscribers/Listeners: for receiving data from ROS topics (b) Describe at least one function of the package.xml file.

(1)

Solution: Possible answers include: • • • •

Declaring Declaring Declaring Declaring

package dependencies build dependencies runtime dependencies package metadata (name, description, author, etc)

(c) Consider the following Python script. It tries to print Baxter’s joint states, which are published to the topic: #!/usr/bin/env python

String callback(data): data __name__ == "__main__": rospy.init_node("fk_map", anonymous=True) rospy.Subscriber("robot/joint_states", String, callback) rospy.spin() Assume the code is syntactically correct. Will it print the published data? Explain.

Page 12

(1)

EECS C106A Midterm 1 - Fall 2018

SID:

Solution: No. String is the wrong message type for the robot/joint states topic. (d) Consider the following code snippet from Lab 3. The script is given a list of desired joint angles and commands Baxter to move to them. Done = False Done: # Send a list of target joint angles to the right arm set_joint_angles(right, desired_angles) # Get the current joint angles from the right arm measured_angles = get_joint_angles(right) Done = True i range(0,len(desired_angles)): desired_angles[i] != measured_angles[i]: Done = False

Assume that the code has no syntactical errors and runs without throwing any exceptions. All called functions operate correctly. Do you expect the code to terminate in normal operation? Explain. Solution: No, it will not. Due to imperfect physical systems, measured angles will never exactly equal the desired angles. Note: this isn’t a floating point precision problem. It refers to the fact that real-world systems will have noise and error, and thus the controller will never converge exactly.

Page 13

(1)

EECS C106A Midterm 1 - Fall 2018

Page 14

SID:

EECS C106A Midterm 1 - Fall 2018

1

SID:

Appendix: 4 DoF Manipulator

Consider the four degree of freedom robotic manipulator shown in Figure 1. The manipulator has three revolute joints and one prismatic joint.

Figure 1: 4-DOF Robotic Manipulator

Page 15

EECS C106A Midterm 1 - Fall 2018

2

Appendix: Cheat Sheet

2.1 sin

SID:

Trigonometry  π 4

=

√ π 2 , cos 4 2

=

√ 2 2

Pythagoras’s theorem h2 = x2 + y 2 for a right angled triangle where h is the hypotenuse and x and y are the lengths of the two remaining sides. Sine, Cosine Relation (cos(θ ))2 + (sin(θ ))2 = 1 Law of Cosines c2 = a2 + b2 − 2ab cos(θC ) where a, b, c are the lengths of the triangle and θA , θB and θC are the angles of their opposing corner.

2.2

Linear Algebra

For orthogonal matrices A−1 = AT   Orthogonality A matrix v1 , ..., vn is said to be orthogonal if:  1 if i = j T vi vj = 0 otherwise

2.3

Special Operators

Hat

Wedge

2.4

Rotations

 ˆ   ω1 0 −ω3 ω2 ω ˆ = ω2  =  ω3 0 −ω1  ω3 −ω2 ω1 0  d  ˆ v ˆξ = v = ω ω 0 0   1 0 0 Rx (θ) = 0 cos (θ) − sin (θ ) = e xˆ θ 0 sin (θ) cos (θ) 

 cos (θ) 0 sin (θ ) 0 1 0  = e yˆ θ Ry (θ) =  − sin (θ) 0 cos (θ)   cos (θ) − sin (θ) 0 Rz (θ) = sin (θ) cos (θ) 0 = e zˆ θ 0 0 1 Page 16

EECS C106A Midterm 1 - Fall 2018 2.5

Rodrigues’ Formula ˆ R(ω, θ) = ewθ = I3 +

2.6

ω ˆ2 ω ˆ (1 − cos (kωk θ)) sin (kωk θ) + kωk kω k2

Rigid Body Motion gAB

2.7

SID:

  RAB pAB = 0 1

g −1 AB

  −1 −1 pAB RAB −RAB = 0 1

Exponential Notation ˆ

gAB (θ1 ) = eξ1 θ1 gAB (0) ˆ

ˆ

gST (θ1 , . . . , θn ) = eξ1 θ1 . . . eξn θn gST (0) 2.7.1

Special Cases

Pure Rotation

  −ω × q ξ= ω

Pure Translation

  v ξ= 0

Pure Rotations, Screws (Rotation and Translation)  ωˆ θ    ˆ ˆ e I3 − eωθ (ω × v) + ωω T vθ ξθ e = 0 1 Pure Translation ˆ ξθ

e

2.8

  I3 vθ = 0 1

Paden-Kahan

Subproblem 1: Rotation about a single axis b

e ξθ p = q Subproblem 2: Rotation about two subsequent axes b

b

e ξ1 θ1 eξ2 θ2 p = q Subproblem 3: Rotation to a distance  b   ξθ  e p − q  = δ Page 17

EECS C106A Midterm 1 - Fall 2018

Page 18

SID:...


Similar Free PDFs