Cubic Joint Trajectory
~12 mincode completion
Implement cubic_trajectory(q0, qf, T, t) returning the array [q, qdot] at time .
Examples
At t = 0 the joint is at q0 and at rest
- Input
- cubic_trajectory(1, 3, 2, 0)
- Output
- [1, 0]
At t = T the joint is at qf and at rest
- Input
- cubic_trajectory(1, 3, 2, 2)
- Output
- [3, 0]
At the midpoint: halfway there, peak velocity 1.5 * delta / T
- Input
- cubic_trajectory(0, 2, 4, 2)
- Output
- [1, 0.75]
Hints
Hint 1
Convert the input with before doing elementwise work.
Hint 2
Watch for this: used linear interpolation.
Requirements
: duration
: time in [0, T]
Return array [q, qdot]
Constraints
Allowed library: NumPy only
Time limit: 200 ms, Memory: 64 MB
Try similar problems(4)
EasyEasyEasyEasy
Roll, Pitch, Yaw to a Rotation Matrix
Pro
Industrial Robotics: Kinematics and Control · ~12 min
Invert a Homogeneous Transform
Pro
Industrial Robotics: Kinematics and Control · ~10 min
Jacobian of a 2-Link Arm
Pro
Industrial Robotics: Kinematics and Control · ~14 min
One PID Step
Pro
Industrial Robotics: Kinematics and Control · ~12 min
Where this shows up
~12 min
••••••••••••
6 employers weight this skill
4 autonomy companies, 2 defense companies. Top match scores 93.
Python
import numpy as np
def cubic_trajectory(q0, qf, T, t):
"""
Position and velocity on a rest-to-rest cubic.
Args:
q0, qf: start and end joint positions
T: duration
t: time in [0, T]
Returns:
array [q, qdot]
"""
# YOUR CODE HERE
pass