Problems · Problem 3 · Kinematics · Easy
Polynomial trajectories
Solve for the quintic that meets position, velocity and acceleration at both ends, then chain quintics through waypoints.
Builds on Linear systems: calibrate a camera, from the free Foundations.
Write and run this problem in the simulator with ProWhat it computes
A trajectory says where each joint should be at every instant. Controllers need smooth setpoints: a jump in velocity or acceleration asks the motors for infinite torque. A quintic polynomial per joint is the standard tool, because it has enough coefficients to fix position, velocity and acceleration at both ends of a move.
Six conditions, six unknowns
Ask for to equal at and at . Each condition is linear in the , so together they form a system :
np.linalg.solve(M, b) handles every joint at once: if is (one column per joint), so is .
Through waypoints
To pass through waypoints without stopping, give each interior waypoint a velocity and use it as of one segment and of the next. Position and velocity then stay continuous. The program uses the average of the neighbouring segments' slopes.
See it in context
Trajectory Generation, steps 1–5, builds cubic, quintic and via-point trajectories one at a time.
Your task
Implement quintic_coeffs(q0, v0, a0, q1, v1, a1, T) and quintic_eval(c, t), which returns (q, qd, qdd).
The program streams four waypoints through them at 100 Hz and plots the commanded velocities.