Build a Homogeneous Transform
~8 mincode completion
Implement homogeneous_transform(R, t) returning the 4x4 matrix.
Examples
Identity rotation with a translation of [1, 2, 3]
- Input
- homogeneous_transform([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [1, 2, 3])
- Output
- [[1, 0, 0, 1], [0, 1, 0, 2], [0, 0, 1, 3], [0, 0, 0, 1]]
A 90-degree turn about z with no translation
- Input
- homogeneous_transform([[0, -1, 0], [1, 0, 0], [0, 0, 1]], [0, 0, 0])
- Output
- [[0, -1, 0, 0], [1, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
Hints
Hint 1
Convert the input with before doing elementwise work.
Hint 2
A common slip here: put the translation in the last row instead of the last column.
Requirements
R: (3, 3) rotation matrix: (3,) translation
Return (4, 4) array [[R, t], [0, 0, 0, 1]]
Constraints
Allowed library: NumPy only
Time limit: 200 ms, Memory: 64 MB
Try similar problems(4)
IntroEasyEasyEasy
Forward Kinematics of a 2-Link Arm
Pro
Industrial Robotics: Kinematics and Control · ~10 min
Roll, Pitch, Yaw to a Rotation Matrix
Pro
Industrial Robotics: Kinematics and Control · ~12 min
Cubic Joint Trajectory
Pro
Industrial Robotics: Kinematics and Control · ~12 min
Invert a Homogeneous Transform
Pro
Industrial Robotics: Kinematics and Control · ~10 min
Where this shows up
~8 min
••••••••••••
6 employers weight this skill
4 autonomy companies, 2 defense companies. Top match scores 93.
Python
import numpy as np
def homogeneous_transform(R, t):
"""
4x4 homogeneous transform from a rotation and a translation.
Args:
R: (3, 3) rotation matrix
t: (3,) translation
Returns:
(4, 4) array [[R, t], [0, 0, 0, 1]]
"""
# YOUR CODE HERE
pass