Path Module
Build geometric paths (q(s)) from waypoints, callbacks, symbolic formulas, CasADi, or Jet3 formulas.
COPP solves optimal path-parameterization problems. A geometric path is written as
where \(q\) is robot configuration and \(s\) is a scalar path coordinate. The solver does not change the geometric path. It computes a time law
so the robot traverses the path while respecting velocity, acceleration, torque, jerk, and user-supplied constraints. In short, COPP turns a geometry-space path into a feasible and optimized time schedule.
The MATLAB package is named copp. Public code should call APIs through that package namespace.
Path ModuleBuild geometric paths (q(s)) from waypoints, callbacks, symbolic formulas, CasADi, or Jet3 formulas.
Robot and ConstraintsStore station grids, sampled derivatives, physical limits, raw inequalities, and inverse dynamics.
TOPP2 and COPP2 SolversUse reachability and SOCP solvers for second-order path-parameterization problems.
TOPP3 and COPP3 SolversUse LP and SOCP solvers for third-order models.
InterpolationConvert path-domain profiles into time grids and sample (s(t)).
Errors and DiagnosticsUnderstand MATLAB exceptions, CoppError, solver statuses, verbosity, and last-error snapshots.
API ReferencePublic classes, functions, solver namespaces, options, results, and profile helpers.
clarabelClarabel solver settings and option adapters.
diagDiagnostics, error objects, and verbosity helpers.
interpolationConvert solver profiles between station and time domains.
objectiveObjective descriptors used by COPP solvers.
solverSecond- and third-order solver namespaces.
Solvers return compact path-speed profiles rather than time-sampled robot trajectories. In second-order solvers the main output is \(a\), the squared path speed at station nodes. Third-order solvers return copp.Profile3rd, which stores the node profiles needed by the third-order interpolation helpers.
Use the interpolation functions to convert solver output into time-domain data:
TOPP means time-optimal path parameterization. A TOPP solver seeks the shortest feasible traversal time under a selected constraint model.
COPP means convex-objective path parameterization. COPP solvers keep the same path-domain constraints, but optimize convex objective terms such as time, linear penalties, thermal energy, or total variation of torque.
The MATLAB binding exposes both second-order and third-order families:
The MATLAB API mirrors the Rust and Python structure while using MATLAB idioms:
MATLAB public station indices are 1-based. Matrices use MATLAB's natural column-major convention: a \(\mathrm{dim} \times N\) matrix stores one station/sample per column.
The MATLAB binding is a workflow facade, not a one-to-one C ABI mirror. It prioritizes the public Path, Robot, solver, objective, and interpolation workflows. Raw native pointers, owned C buffers, status-code plumbing, and low-level debug/introspection calls are intentionally hidden unless they make a user-facing workflow clearer.
The binding deliberately uses one convention across all MATLAB entry points:
A quick mental check: if a matrix is about robot coordinates, rows are axes and columns are stations. If a matrix is about raw inequalities, rows are inequality rows and columns are stations.
This example solves a compact TOPP2-RA problem. The path is \(q(s)=s\), sampled on seven stations. The robot starts and ends at rest, with unit velocity and acceleration bounds.
n = 7; s = linspace(0.0, 1.0, n).'; robot = copp.Robot(1, Capacity=n); cleanup = onCleanup(@() robot.release()); robot.append_s(s); % q, dq, and ddq are dim x N matrices. Here dim=1 and N=n. robot.set_q_2nd(s.', ones(1, n), zeros(1, n)); robot.add_velocity_limits(1, -1); robot.add_acceleration_limits(1, -1); problem = copp.solver.topp2_ra.Problem( ... robot, ... idx_s_interval=[1, n], ... a_boundary=[0, 0]); a = copp.solver.topp2_ra.solve(problem); [t_final, t_s] = copp.interpolation.s_to_t_topp2(s, a); fprintf("a shape: %d x %d, t_s shape: %d x %d\n", ... size(a, 1), size(a, 2), size(t_s, 1), size(t_s, 2)); summary = table(s, a, t_s, 'VariableNames', {'s', 'a', 't_s'}); disp(summary) fprintf("Final traversal time: %.6f seconds\n", t_final);
A useful learning order is: