Denavit-Hartenberg Link Transform
Implement dh_transform(theta, d, a, alpha) returning the 4x4 matrix.
Examples
All four parameters zero is the identity
- Input
- dh_transform(0, 0, 0, 0)
- Output
- [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
theta = pi/2 with a unit link: rotate, then the link points along the new x
- Input
- dh_transform(1.5707963267948966, 0, 1, 0)
- Output
- [[0, -1, 0, 0], [1, 0, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]
d alone is a translation along z
- Input
- dh_transform(0, 2, 0, 0)
- Output
- [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 2], [0, 0, 0, 1]]
Hints
Hint 1
Convert the input with before doing elementwise work.
Hint 2
Watch for this: applied alpha before theta.
Requirements
theta: joint angle about z (radians)d: offset along za: link length along xalpha: twist about x (radians)Return (4, 4) homogeneous transform
Constraints
Allowed library: NumPy only
Time limit: 200 ms, Memory: 64 MB
Try similar problems(4)
Industrial Robotics: Kinematics and Control · ~16 min
Industrial Robotics: Kinematics and Control · ~14 min
Industrial Robotics: Kinematics and Control · ~16 min
Industrial Robotics: Kinematics and Control · ~18 min
Where this shows up
6 employers weight this skill
4 autonomy companies, 2 defense companies. Top match scores 92.
import numpy as np
def dh_transform(theta, d, a, alpha):
"""
Standard Denavit-Hartenberg link transform.
Args:
theta: joint angle about z (radians)
d: offset along z
a: link length along x
alpha: twist about x (radians)
Returns:
(4, 4) homogeneous transform
"""
# YOUR CODE HERE
pass