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 hw04.py. The file must contain the compute_rot_t function, such that it can be imported (by the automatic evaluation) as
hw04.py
import hw04 res = hw04.compute_rot_t(*args)
Upload a zip archive hw04.zip (via the course ware) containing:
hw04.zip
hw04.json
Creating hw04.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("hw04.json", "w") as outfile: json.dump(solution, outfile)