Generate Minimum Snap Trajectory
This example shows how to generate a minimum snap trajectory using the Minimum Snap Polynomial Trajectory block.
Example Model
Open the model.
open_system("minsnap_traj_ex1.slx")
The model contains a Constant block, Waypoints
, that specifies six two-dimensional waypoints to the Waypoints port of the Minimum Jerk Polynomial Trajectory block, and another Constant block specifies time points for each of those waypoints to the TimePoints port. The input to the Time port is a ramp signal, to simulate time progressing.
Simulate and Display Results
Run the simulation. Scope blocks visualize the q port output of positions, the qd port output of velocities, the qdd port output of accelerations, the qddd port output of jerks, and qdddd port output of snaps of the trajectory.
The XY Graph shows the actual 2-D trajectory, which stays inside the defined control points, and reaches the first and last waypoints.
Positions
Velocities
Accelerations
Jerks
Snaps
x- and y-positions