Search
You can find the description of the task here.
For task 1:
# approximate rotation R = np.array([[0.8047, -0.5059, -0.3106], [0.3106, 0.8047, -0.5059], [0.5059, 0.3106, 0.8047]])
# less approximate rotation u, s, vh = np.linalg.svd(R) R = u.dot(vh)
# translation t, or OO' in beta o_o_pr_beta = np.array([[-1], [0.5], [1]])
For task 2:
Create a function compute_rot_t(R_1, t_1, R_2, t_2, R_3, t_3) which takes as inputs three transformations as mentioned in the task description and outputs object pose after the motion.
compute_rot_t(R_1, t_1, R_2, t_2, R_3, t_3)
Input/Output specifications for compute_rot_t:
compute_rot_t
R_1, R_2, R_3
np.ndarray
t_1, t_2, t_3
“r”
“t”
Implement the solution in a single file hw02.py. The file must contain the compute_rot_t function, such that it can be imported (by the automatic evaluation) as
hw02.py
import hw02 res = hw02.compute_rot_t(*args)
Upload a zip archive hw02.zip (via the course ware) containing:
hw02.zip
hw02.json
Creating hw02.json:
Create an empty dictionary in Python:
solution = {}
The key for this dictionary will be “x_pr_beta”, translation, a list of three float values.
“x_pr_beta”
import json with open("hw02.json", "w") as outfile: json.dump(solution, outfile)