Joint Torques from a Tip Force
Implement tip_force_to_torques(l1, l2, q1, q2, fx, fy) returning the array [tau1, tau2].
Examples
A 1 N load hanging off the stretched arm: the base carries twice the elbow's moment
- Input
- tip_force_to_torques(1, 1, 0, 0, 0, -1)
- Output
- [-2, -1]
Pushing along the arm's own length: no torque at either joint
- Input
- tip_force_to_torques(1, 1, 0, 0, -1, 0)
- Output
- [0, 0]
The same arm pointing up, pushed sideways: now the force has full leverage
- Input
- tip_force_to_torques(1, 1, 1.5707963267948966, 0, 1, 0)
- Output
- [-2, -1]
Hints
Hint 1
Use a matrix product rather than nested loops, and check which operand transposes.
Hint 2
Reach for J transpose rather than J.
Requirements
Return (2,) array [tau1, tau2] = J^T f
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 tip_force_to_torques(l1, l2, q1, q2, fx, fy):
"""
Static joint torques that balance a force applied at the tip.
Args:
l1, l2: link lengths
q1, q2: joint angles in radians
fx, fy: force applied at the tip, in base coordinates
Returns:
(2,) array [tau1, tau2] = J^T f
"""
# YOUR CODE HERE
pass