COPP C ABI
C interface for COPP trajectory optimization
Loading...
Searching...
No Matches
path.h
Go to the documentation of this file.
1#ifndef COPP_PATH_H
2#define COPP_PATH_H
3
4/*
5 * Generated by bindings/c/scripts/generate_headers.ps1.
6 * Do not edit by hand; update src/ffi/c and regenerate.
7 */
8
14
15#include <stddef.h>
16#include "copp/core.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
26
34typedef struct CoppPath CoppPath;
35
49
59
98
105typedef enum CoppStatus (*CoppPathEvaluate2ndFn)(void *user_data,
106 size_t dim,
107 size_t n,
108 const double *s,
109 double *q,
110 double *dq,
111 double *ddq);
112
119typedef enum CoppStatus (*CoppPathEvaluate3rdFn)(void *user_data,
120 size_t dim,
121 size_t n,
122 const double *s,
123 double *q,
124 double *dq,
125 double *ddq,
126 double *dddq);
127
138 double s_max,
139 struct CoppPathOptions *out_options);
140
162 struct CoppPathOptions options,
163 struct CoppPath **out_path);
164
187 double s_min,
188 double s_max,
189 CoppPathEvaluate2ndFn evaluate_2nd,
190 void *user_data,
191 struct CoppPath **out_path);
192
215 double s_min,
216 double s_max,
217 CoppPathEvaluate2ndFn evaluate_2nd,
218 CoppPathEvaluate3rdFn evaluate_3rd,
219 void *user_data,
220 struct CoppPath **out_path);
221
229enum CoppStatus copp_path_dim(const struct CoppPath *path, size_t *out_dim);
230
238enum CoppStatus copp_path_s_range(const struct CoppPath *path,
239 double *out_s_min,
240 double *out_s_max);
241
254 struct CoppSliceF64 s,
255 struct CoppMatrixF64 *out_q,
256 struct CoppMatrixF64 *out_dq,
257 struct CoppMatrixF64 *out_ddq);
258
271 struct CoppSliceF64 s,
272 struct CoppMatrixF64 *out_q,
273 struct CoppMatrixF64 *out_dq,
274 struct CoppMatrixF64 *out_ddq,
275 struct CoppMatrixF64 *out_dddq);
276
286void copp_path_free(struct CoppPath *path);
287
289
290#ifdef __cplusplus
291}
292#endif
293
294#endif /* COPP_PATH_H */
Core status, memory, matrix, and shared solver option types.
CoppStatus
C ABI status code returned by COPP FFI functions.
Definition core.h:34
struct CoppPath CoppPath
Opaque C handle for a library-owned Path.
Definition path.h:34
enum CoppStatus copp_path_evaluate_up_to_3rd(const struct CoppPath *path, struct CoppSliceF64 s, struct CoppMatrixF64 *out_q, struct CoppMatrixF64 *out_dq, struct CoppMatrixF64 *out_ddq, struct CoppMatrixF64 *out_dddq)
Evaluate q, dq, ddq, and dddq at the supplied path parameters.
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_dim(const struct CoppPath *path, size_t *out_dim)
Return the path dimension.
enum CoppStatus(* CoppPathEvaluate2ndFn)(void *user_data, size_t dim, size_t n, const double *s, double *q, double *dq, double *ddq)
C callback for evaluating q, dq, and ddq.
Definition path.h:105
CoppPathOutOfRangeMode
C ABI path out-of-range behavior.
Definition path.h:39
enum CoppStatus copp_path_s_range(const struct CoppPath *path, double *out_s_min, double *out_s_max)
Return the valid path parameter range.
enum CoppStatus copp_path_from_evaluator_2nd(size_t dim, double s_min, double s_max, CoppPathEvaluate2ndFn evaluate_2nd, void *user_data, struct CoppPath **out_path)
Build a path from a C callback that provides derivatives up to 2nd order.
enum CoppStatus(* CoppPathEvaluate3rdFn)(void *user_data, size_t dim, size_t n, const double *s, double *q, double *dq, double *ddq, double *dddq)
C callback for evaluating q, dq, ddq, and dddq.
Definition path.h:119
void copp_path_free(struct CoppPath *path)
Release a path handle created by this module.
enum CoppStatus copp_path_evaluate_up_to_2nd(const struct CoppPath *path, struct CoppSliceF64 s, struct CoppMatrixF64 *out_q, struct CoppMatrixF64 *out_dq, struct CoppMatrixF64 *out_ddq)
Evaluate q, dq, and ddq at the supplied path parameters.
enum CoppStatus copp_path_from_evaluator_3rd(size_t dim, double s_min, double s_max, CoppPathEvaluate2ndFn evaluate_2nd, CoppPathEvaluate3rdFn evaluate_3rd, void *user_data, struct CoppPath **out_path)
Build a path from C callbacks that provide derivatives up to 3rd order.
CoppPathParametrization
C ABI waypoint-spline parametrization.
Definition path.h:53
enum CoppStatus copp_path_default_options(double s_min, double s_max, struct CoppPathOptions *out_options)
Write default waypoint spline options into out_options.
@ COPP_PATH_OUT_OF_RANGE_MODE_CLAMP
Clamp query parameters into [s_min, s_max].
Definition path.h:47
@ COPP_PATH_OUT_OF_RANGE_MODE_ERROR
Return an error when a query parameter is outside [s_min, s_max].
Definition path.h:43
@ COPP_PATH_PARAMETRIZATION_UNIFORM
Uniform parameter spacing between waypoints.
Definition path.h:57
Library-owned column-major f64 matrix returned to C.
Definition core.h:785
Borrowed immutable f64 matrix passed from C to COPP.
Definition core.h:647
Options for waypoint spline path construction.
Definition path.h:68
size_t order
Spline order.
Definition path.h:72
enum CoppPathParametrization parametrization
Waypoint parametrization mode.
Definition path.h:88
struct CoppMatrixViewF64 end_state
Boundary derivatives at s_max, or empty for zero boundary derivatives.
Definition path.h:96
enum CoppPathOutOfRangeMode out_of_range_mode
Behavior for out-of-range path evaluation.
Definition path.h:84
struct CoppMatrixViewF64 start_state
Boundary derivatives at s_min, or empty for zero boundary derivatives.
Definition path.h:92
double s_min
Lower bound of the path parameter range.
Definition path.h:76
double s_max
Upper bound of the path parameter range.
Definition path.h:80
Borrowed immutable f64 slice passed from C to COPP.
Definition core.h:708