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. | |
| 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.
The example below solves COPP2-SOCP with Clarabel options and releases the optimized a(s) profile.
| 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 follows the advanced-diagnostics convention: 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.
The example below distinguishes C ABI failures from non-accepted Clarabel solves and then frees all expert buffers.
| 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.