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

Files

file  bindings/c/include/copp/copp3.h
 COPP3-SOCP solver APIs.

Data Structures

struct  Copp3SocpResult
 Compact COPP3-SOCP expert result returned to C. More...

Functions

enum CoppStatus copp3_socp (struct Copp3Problem problem, struct CoppClarabelOptions options, struct CoppProfile3rd *out_profile)
 Solve a COPP3-SOCP problem.
enum CoppStatus copp3_socp_expert (struct Copp3Problem problem, struct CoppClarabelOptions options, struct Copp3SocpResult *out_result)
 Solve a COPP3-SOCP problem and always return Clarabel diagnostics.
void copp3_socp_result_free (struct Copp3SocpResult result)
 Release memory owned by a Copp3SocpResult.

Detailed Description

Function Documentation

◆ copp3_socp()

enum CoppStatus copp3_socp ( struct Copp3Problem problem,
struct CoppClarabelOptions options,
struct CoppProfile3rd * out_profile )

Solve a COPP3-SOCP problem.

This C ABI builds an internal COPP3 problem from the borrowed Copp3Problem, forwards options to the Clarabel backend, and returns only the accepted third-order profile.

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

On success, out_profile owns COPP-allocated a and b vectors and must be released with copp_profile_3rd_free.

Warning
Safety problem.robot must be a non-null mutable 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 non-zero. If the robot has a stored inverse-dynamics callback, it must remain valid for this call. The solver builds the internal problem by linearizing third-order constraints, which mutates the robot's internal constraint cache. out_profile must be valid for one CoppProfile3rd write.

◆ copp3_socp_expert()

enum CoppStatus copp3_socp_expert ( struct Copp3Problem problem,
struct CoppClarabelOptions options,
struct Copp3SocpResult * out_result )

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

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

Warning
Safety Same safety requirements as copp3_socp. out_result must be valid for one Copp3SocpResult write and must later be released with copp3_socp_result_free.

◆ copp3_socp_result_free()

void copp3_socp_result_free ( struct Copp3SocpResult result)

Release memory owned by a Copp3SocpResult.

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