COPP C ABI
C interface for COPP trajectory optimization
Loading...
Searching...
No Matches
examples Directory Reference

Files

 
copp2_socp.c
 
copp3_socp.c
 
example_common.h
 
reach_set2.c
 
topp2_ra.c
 
topp3_lp.c
 
topp3_socp.c

Detailed Description

COPP C Examples

These examples mirror the open-source algorithm examples in the repository where the C ABI currently exposes the same solver. They use the same analytic Lissajous path, N = 1001 station grid, symmetric axis limits [-1, 1], solver objectives, and TOPP3/COPP3 setup flow.

The examples use callback-backed paths so their output can match the native parametric-path examples exactly. C users do not need automatic differentiation for ordinary usage: if your path is available as waypoints, use copp_path_from_waypoints instead. COPP will build a spline path and the same copp_robot_sample_path_2nd / copp_robot_sample_path_3rd calls used in these examples will sample the required derivatives from that spline.

Minimal waypoint construction:

double waypoints[dim * num_waypoints]; /* column-major: row + col * dim */
struct CoppPathOptions path_options;
struct CoppPath *path = NULL;
copp_path_default_options(0.0, 1.0, &path_options);
/* path_options.order defaults to 5; override it if your application needs a different odd spline order. */
COPP_MATRIX_VIEW_F64_COLUMN_MAJOR(waypoints, dim, num_waypoints),
path_options,
&path);
#define COPP_MATRIX_VIEW_F64_COLUMN_MAJOR(data_, rows_, cols_)
Build a contiguous column-major matrix view.
Definition core.h:757
struct CoppPath CoppPath
Opaque C handle for a library-owned Path.
Definition path.h:34
enum CoppStatus copp_path_from_waypoints(struct CoppMatrixViewF64 waypoints, struct CoppPathOptions options, struct CoppPath **out_path)
Build a waypoint spline path.
enum CoppStatus copp_path_default_options(double s_min, double s_max, struct CoppPathOptions *out_options)
Write default waypoint spline options into out_options.
Options for waypoint spline path construction.
Definition path.h:68
C example Demonstrates
topp2_ra.c TOPP2 reachability analysis and a(s) -> t(s) -> s(t) interpolation
reach_set2.c Second-order reachable interval construction
copp2_socp.c COPP2 SOCP with Clarabel options
topp3_lp.c TOPP3 LP with Clarabel options
topp3_socp.c TOPP3 SOCP with Clarabel options
copp3_socp.c COPP3 SOCP with time plus thermal-energy objectives

Algorithms not listed in the open-source availability table in the COPP repository README are not documented here as public C examples.