COPP C ABI
C interface for COPP trajectory optimization
Loading...
Searching...
No Matches
Copp_copp2

Files

file  bindings/c/include/copp/copp2.h
 COPP2-SOCP solver APIs.

Data Structures

struct  Copp2SocpResult
 Compact COPP2-SOCP expert result returned to C. More...

Functions

enum CoppStatus copp2_socp (struct Copp2Problem problem, struct CoppClarabelOptions options, struct CoppVecF64 *out_a)
 Solve a COPP2-SOCP problem.
enum CoppStatus copp2_socp_expert (struct Copp2Problem problem, struct CoppClarabelOptions options, struct Copp2SocpResult *out_result)
 Solve a COPP2-SOCP problem and always return Clarabel diagnostics.
void copp2_socp_result_free (struct Copp2SocpResult result)
 Release memory owned by a Copp2SocpResult.

Detailed Description

Function Documentation

◆ copp2_socp()

enum CoppStatus copp2_socp ( struct Copp2Problem problem,
struct CoppClarabelOptions options,
struct CoppVecF64 * out_a )

Solve a COPP2-SOCP problem.

This C ABI builds an internal COPP2 problem from the borrowed Copp2Problem, forwards options to the Clarabel backend, and returns only the optimized a(s) = (ds/dt)^2 profile.

Supported objective kinds are Time, Linear, ThermalEnergy, and TotalVariationTorque. The torque objectives use the robot's stored inverse-dynamics callback when provided, otherwise point dynamics (tau = ddq) is used.

On success, out_a owns a COPP-allocated vector over the closed station interval and must be released with copp_vec_f64_free.

Warning
Safety problem.robot must be a non-null handle returned by copp_robot_create and must remain valid for the duration of this call. problem.objectives must be valid for problem.num_objectives reads when problem.num_objectives is non-zero. If the robot has a stored inverse-dynamics callback, it must remain valid for this call. The robot must not be freed or mutated concurrently during the solve. out_a must be valid for one CoppVecF64 write.

◆ copp2_socp_expert()

enum CoppStatus copp2_socp_expert ( struct Copp2Problem problem,
struct CoppClarabelOptions options,
struct Copp2SocpResult * out_result )

Solve a COPP2-SOCP problem and always return Clarabel diagnostics.

This expert entry mirrors copp2_socp_expert: true runtime failures still return a non-OK CoppStatus, but non-accepted Clarabel statuses are reported inside out_result with has_a == false and the function returns COPP_STATUS_OK.

Warning
Safety Same safety requirements as copp2_socp. out_result must be valid for one Copp2SocpResult write and must later be released with copp2_socp_result_free.

◆ copp2_socp_result_free()

void copp2_socp_result_free ( struct Copp2SocpResult result)

Release memory owned by a Copp2SocpResult.

Passing an already-freed result is invalid. Prefer freeing the full result with this function instead of freeing result.a manually.