COPP C ABI
C interface for COPP trajectory optimization
Loading...
Searching...
No Matches
core.h File Reference

Core status, memory, matrix, and shared solver option types. More...

#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  CoppClarabelLinearSolverInfo
 Linear solver metadata reported by Clarabel. More...
struct  CoppClarabelSettings
 Advanced raw Clarabel solver settings. More...
struct  CoppClarabelOptions
 Shared Clarabel options for COPP SOCP solvers. More...
struct  CoppMatrixViewF64
 Borrowed immutable f64 matrix passed from C to COPP. More...
struct  CoppSliceF64
 Borrowed immutable f64 slice passed from C to COPP. More...
struct  CoppSliceMutF64
 Borrowed mutable f64 slice passed from C to COPP. More...
struct  CoppVecF64
 Library-owned f64 vector returned to C. More...
struct  CoppVecUsize
 Library-owned usize vector returned to C. More...
struct  CoppMatrixF64
 Library-owned column-major f64 matrix returned to C. More...

Macros

#define COPP_MATRIX_VIEW_F64_COLUMN_MAJOR(data_, rows_, cols_)
 Build a contiguous column-major matrix view.
#define COPP_MATRIX_VIEW_F64_ROW_MAJOR(data_, rows_, cols_)
 Build a contiguous row-major matrix view.

Enumerations

enum  CoppStatus {
  COPP_STATUS_OK = 0 , COPP_STATUS_NULL_POINTER = 1 , COPP_STATUS_INVALID_LENGTH = 2 , COPP_STATUS_INVALID_SHAPE = 3 ,
  COPP_STATUS_INVALID_ARGUMENT = 4 , COPP_STATUS_PANIC = 5 , COPP_STATUS_ALLOCATION_FAILED = 6 , COPP_STATUS_IO_ERROR = 100 ,
  COPP_STATUS_CONSTRAINT_NON_INCREASING_S = 200 , COPP_STATUS_CONSTRAINT_NO_MATCH_DIMENSIONS = 201 , COPP_STATUS_CONSTRAINT_NO_MATCH_ORDER = 202 , COPP_STATUS_CONSTRAINT_INVALID_SIGNED_BOUNDS = 203 ,
  COPP_STATUS_CONSTRAINT_OUT_OF_S_BOUNDS = 204 , COPP_STATUS_CONSTRAINT_NON_POSITIVE_A = 205 , COPP_STATUS_CONSTRAINT_NON_POSITIVE_LINEARIZATION_FLOOR = 206 , COPP_STATUS_CONSTRAINT_NO_GIVEN_Q_INFO = 207 ,
  COPP_STATUS_CONSTRAINT_LINEAR_JERK_NOT_AVAILABLE = 208 , COPP_STATUS_CONSTRAINT_NO_DYNAMIC = 209 , COPP_STATUS_CONSTRAINT_INFEASIBLE_REFERENCE = 210 , COPP_STATUS_CONSTRAINT_EMPTY_INTERVAL = 211 ,
  COPP_STATUS_PATH_INVALID_DIMENSION = 300 , COPP_STATUS_PATH_INVALID_RANGE = 301 , COPP_STATUS_PATH_INVALID_ORDER = 302 , COPP_STATUS_PATH_DIMENSION_MISMATCH = 303 ,
  COPP_STATUS_PATH_NOT_ENOUGH_WAYPOINTS = 304 , COPP_STATUS_PATH_OUT_OF_RANGE_S = 305 , COPP_STATUS_PATH_UNSUPPORTED_BOUNDARY = 306 , COPP_STATUS_PATH_SINGULAR_SYSTEM = 307 ,
  COPP_STATUS_PATH_UNSUPPORTED_DERIVATIVE_ORDER = 308 , COPP_STATUS_SOLVER_INFEASIBLE = 400 , COPP_STATUS_SOLVER_UNBOUNDED = 401 , COPP_STATUS_SOLVER_INVALID_INPUT = 402 ,
  COPP_STATUS_SOLVER_INVALID_OPTIONS = 403 , COPP_STATUS_CLARABEL_SOLVER_ERROR = 404 , COPP_STATUS_CLARABEL_SOLVER_STATUS = 405 , COPP_STATUS_SOLVER_OTHER = 499 ,
  COPP_STATUS_ROBOT_DYNAMICS_ERROR = 500
}
 C ABI status code returned by COPP FFI functions. More...
enum  CoppVerbosity { COPP_VERBOSITY_SILENT = 0 , COPP_VERBOSITY_SUMMARY = 1 , COPP_VERBOSITY_DEBUG = 2 , COPP_VERBOSITY_TRACE = 3 }
 C ABI verbosity level for solver diagnostics. More...
enum  CoppClarabelDirectSolveMethod {
  COPP_CLARABEL_DIRECT_SOLVE_METHOD_AUTO = 0 , COPP_CLARABEL_DIRECT_SOLVE_METHOD_QDLDL = 1 , COPP_CLARABEL_DIRECT_SOLVE_METHOD_FAER = 2 , COPP_CLARABEL_DIRECT_SOLVE_METHOD_MKL = 3 ,
  COPP_CLARABEL_DIRECT_SOLVE_METHOD_PANUA = 4
}
 Direct linear solver method forwarded to Clarabel. More...
enum  CoppClarabelSolverStatus {
  COPP_CLARABEL_SOLVER_STATUS_UNSOLVED = 0 , COPP_CLARABEL_SOLVER_STATUS_SOLVED = 1 , COPP_CLARABEL_SOLVER_STATUS_PRIMAL_INFEASIBLE = 2 , COPP_CLARABEL_SOLVER_STATUS_DUAL_INFEASIBLE = 3 ,
  COPP_CLARABEL_SOLVER_STATUS_ALMOST_SOLVED = 4 , COPP_CLARABEL_SOLVER_STATUS_ALMOST_PRIMAL_INFEASIBLE = 5 , COPP_CLARABEL_SOLVER_STATUS_ALMOST_DUAL_INFEASIBLE = 6 , COPP_CLARABEL_SOLVER_STATUS_MAX_ITERATIONS = 7 ,
  COPP_CLARABEL_SOLVER_STATUS_MAX_TIME = 8 , COPP_CLARABEL_SOLVER_STATUS_NUMERICAL_ERROR = 9 , COPP_CLARABEL_SOLVER_STATUS_INSUFFICIENT_PROGRESS = 10 , COPP_CLARABEL_SOLVER_STATUS_CALLBACK_TERMINATED = 11
}
 Clarabel solver status returned by SOCP expert results. More...
enum  CoppMatrixLayout { COPP_MATRIX_LAYOUT_COLUMN_MAJOR = 0 , COPP_MATRIX_LAYOUT_ROW_MAJOR = 1 }
 Matrix memory layout used by CoppMatrixViewF64. More...

Functions

const char * copp_status_message (enum CoppStatus status)
 Return a short static message for a COPP status code.
enum CoppStatus copp_last_error_code (void)
 Return the status code associated with the current thread's last error.
const char * copp_last_error_message (void)
 Return the current thread's last detailed error message as UTF-8.
size_t copp_last_error_message_len (void)
 Return the length in bytes of the current thread's last UTF-8 error message.
enum CoppStatus copp_last_error_message_copy (char *buffer, size_t capacity, size_t *out_len)
 Copy the current thread's last UTF-8 error message into a caller buffer.
void copp_clear_last_error (void)
 Clear the current thread's last detailed error message.
enum CoppStatus copp_set_last_error_message (enum CoppStatus status, const char *message)
 Set the current thread's last detailed error message from a C string.
enum CoppStatus copp_set_last_error_message_n (enum CoppStatus status, const char *message, size_t len)
 Set the current thread's last detailed error message from a byte slice.
const char * copp_version (void)
 Return the COPP library version.
enum CoppStatus copp_clarabel_default_options (struct CoppClarabelOptions *out_options)
 Write default shared Clarabel options into out_options.
void copp_vec_f64_free (struct CoppVecF64 vec)
 Release a library-owned f64 vector returned by COPP.
void copp_vec_usize_free (struct CoppVecUsize vec)
 Release a library-owned usize vector returned by COPP.
void copp_matrix_f64_free (struct CoppMatrixF64 matrix)
 Release a library-owned f64 matrix returned by COPP.
enum CoppStatus copp_clarabel_solution_to_profile_2nd (size_t s_len, struct CoppSliceF64 x, struct CoppVecF64 *out_a)
 Extract a second-order COPP profile from a Clarabel primal solution.
enum CoppStatus copp_clarabel_solution_to_profile_3rd (struct CoppSliceF64 s, struct CoppSliceF64 x, size_t num_stationary_start, size_t num_stationary_end, struct CoppProfile3rd *out_profile)
 Extract a third-order COPP profile from a Clarabel primal solution.

Detailed Description

Core status, memory, matrix, and shared solver option types.