$30
EECS 498: Introduction to Algorithmic Robotics
Homework Assignment #1
Rules:
1. All homework must be done individually, but you are encouraged to post questions on Piazza.
2. No late homework will be accepted.
3. You must show all your work to receive credit for your solutions.
4. The goal of this homework is to develop your linear algebra skills while also learning how to use
python to do calculations. You should use python to do the calculations except where you are asked
to perform calculations by hand. You may not use any other language, only python will be accepted.
5. Submit your python code to the Homework 1 Code assignment on Gradescope. Submit a pdf of
your answers to the Homework 1 assignment on Gradescope.
Software
1. (15 points) Install Ubuntu 18.04 and Openrave on your computer. Follow the directions here. Include a screenshot showing that the fastgrasping example runs successfully in your pdf. The
screenshot should be similar to the one in the installation directions.
2. Complete the Numpy tutorial here. You will need to use Numpy to complete parts of this assignment. Some other resources are also available:
• Numpy tutorial from Stanford’s CS231n (link)
• Numpy for matlab users (link)
Vectors
1. (10 points) Given the following vectors:
p =
1
−1
3
, q =
−4
5
7
, r =
5
−2
7
Determine the following by hand (remember to show your work):
a. p + 2q
b. p · r and r · p where “·” denotes the dot product
c. q × r and r × q where “×” denotes the cross product
1
d. ||p||, and ||q|| where || · || denotes the Euclidean norm of a vector
e. distance between the tips of p and q
2. (10 points) Find all k such that p =
−2
1
−k
and q =
2
−3k
−k
are orthogonal by hand.
Matrices
3. (5 points) Partition the following matrix into submatrices (i.e. find W, X, Y, and Z) by hand:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
=
"
W X
Y Z #
where W ∈ R2×1 and Z ∈ R3×3
.
4. (10 points) Perform the following matrix multiplication by hand:
"
2 −3 3
−1 1 2 #
0 2 2
−1 0 −1
0 −3 0
0
1
−4
5. (12 points) Solve the following systems of equations using numpy. Recall that there can be a unique
solution, no solution, or infinitely many solutions.
a)
0 0 −1
4 1 1
−2 2 1
x =
3
1
1
b)
0 −2 6
−4 −2 −2
2 1 1
x =
1
−2
0
c) "
2 −2
−4 3 #
x =
"
3
−2
#
6. (14 points) Given the following matrices:
A =
"
3 2
1 −2
#
, B =
"
−1 −2
4 −2
#
Use numpy to calculate the following.
a. A + 2B
b. AB and BA
2
c. A
T
, transpose of A
d. B
2
e. A
TB
T and (AB)
T
f. det(A), determinant of A
g. B
−1
, inverse of B
Rotation
7. (10 points) A rotation matrix R is defined by the following sequence of basic rotations:
i. A rotation of π/3 about the z-axis
ii. A rotation of π/4 about the new y-axis
iii. A rotation of π about the new z-axis
Compute the rotation matrix R.
8. (20 points) You would like to point a mobile robot so that it is looking at a target point. The camera
of the robot is aligned with x in the robot’s coordinate frame. The robot is assumed to be on flat
ground (z = 0). The robot’s pose in the world frame is:
T
0
r =
√
2
2
√
2
2
0 1.7
−
√
2
2
√
2
2
0 2.1
0 0 1 0
0 0 0 1
a. The target point is at p = [0.1, −1.4, 0]
T
in the world frame. Assuming the robot stays at its
current position, calculate the vector v in the world frame that the camera should align with.
b. Use v to calculate the desired pose of the robot, again assume the robot does not change position.
The robot must remain upright on the ground; i.e. it’s z axis must not change.
c. Prove that the rotation component of the pose meets all conditions for being a valid rotation
matrix.
3