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

Files

file  bindings/c/include/copp/robot.h
 Robot handles, path sampling, derivative input, constraints, and limits.

Typedefs

typedef struct CoppRobot CoppRobot
 Opaque C handle for a library-owned robot and constraint buffer.
typedef enum CoppStatus(* CoppInverseDynamicsFn) (void *user_data, size_t dim, const double *q, const double *dq, const double *ddq, double *tau)
 C callback for inverse dynamics.

Functions

enum CoppStatus copp_robot_create (size_t dim, size_t capacity, struct CoppRobot **out_robot)
 Create a library-owned robot handle for C callers.
enum CoppStatus copp_robot_set_inverse_dynamics (struct CoppRobot *robot, CoppInverseDynamicsFn inverse_dynamics, void *inverse_dynamics_user_data)
 Store an inverse-dynamics callback in a robot handle.
enum CoppStatus copp_robot_clear_inverse_dynamics (struct CoppRobot *robot)
 Clear the inverse-dynamics callback stored in a robot handle.
enum CoppStatus copp_robot_append_s (struct CoppRobot *robot, struct CoppSliceF64 s)
 Append strictly increasing station samples to a robot.
enum CoppStatus copp_robot_amax_substitute (struct CoppRobot *robot, struct CoppSliceF64 amax, size_t idx_s)
 Overwrite first-order bounds from a profile.
enum CoppStatus copp_robot_dim (const struct CoppRobot *robot, size_t *out_dim)
 Return the robot/path dimension stored in a robot handle.
enum CoppStatus copp_robot_len (const struct CoppRobot *robot, size_t *out_len)
 Return the current number of logical station samples stored in a robot.
enum CoppStatus copp_robot_capacity (const struct CoppRobot *robot, size_t *out_capacity)
 Return the allocated station capacity of the robot constraint buffer.
enum CoppStatus copp_robot_is_empty (const struct CoppRobot *robot, bool *out_is_empty)
 Report whether the robot constraint buffer currently has no stations.
enum CoppStatus copp_robot_idx_s_start (const struct CoppRobot *robot, size_t *out_idx_s_start)
 Return the first global station index currently stored in the robot.
enum CoppStatus copp_robot_idx_s_end (const struct CoppRobot *robot, size_t *out_idx_s_end)
 Return the exclusive global station end index currently stored in the robot.
enum CoppStatus copp_robot_constraint_rows (const struct CoppRobot *robot, size_t *out_amax_rows, size_t *out_acc_rows, size_t *out_jerk_rows)
 Return the allocated row counts for first-, second-, and third-order constraints.
enum CoppStatus copp_robot_get_s (const struct CoppRobot *robot, size_t idx_s, double *out_s)
 Read one station value s[idx_s] from the robot constraint buffer.
enum CoppStatus copp_robot_get_amax (const struct CoppRobot *robot, size_t idx_s, double *out_amax)
 Read one first-order upper bound amax[idx_s] from the robot.
enum CoppStatus copp_robot_s_vec (const struct CoppRobot *robot, size_t idx_s_from, size_t idx_s_to, struct CoppVecF64 *out_s)
 Export station values over [idx_s_from, idx_s_to).
enum CoppStatus copp_robot_amax_vec (const struct CoppRobot *robot, size_t idx_s_from, size_t idx_s_to, struct CoppVecF64 *out_amax)
 Export first-order upper bounds over [idx_s_from, idx_s_to).
enum CoppStatus copp_robot_acc_constraints_at (const struct CoppRobot *robot, size_t idx_s, struct CoppMatrixF64 *out_acc_a, struct CoppMatrixF64 *out_acc_b, struct CoppMatrixF64 *out_acc_max)
 Export second-order constraint rows at one station.
enum CoppStatus copp_robot_jerk_constraints_at (const struct CoppRobot *robot, size_t idx_s, struct CoppMatrixF64 *out_jerk_a, struct CoppMatrixF64 *out_jerk_b, struct CoppMatrixF64 *out_jerk_c, struct CoppMatrixF64 *out_jerk_d, struct CoppMatrixF64 *out_jerk_max)
 Export nonlinear third-order constraint rows at one station.
enum CoppStatus copp_robot_jerk_linear_constraints_at (const struct CoppRobot *robot, size_t idx_s, struct CoppMatrixF64 *out_jerk_a_linear, struct CoppMatrixF64 *out_jerk_b, struct CoppMatrixF64 *out_jerk_c, struct CoppMatrixF64 *out_jerk_max_linear)
 Export linearized third-order constraint rows at one station.
enum CoppStatus copp_robot_clear_constraints (struct CoppRobot *robot, bool keep_idx_s)
 Clear all logical constraints stored in the robot.
enum CoppStatus copp_robot_pop_front_n (struct CoppRobot *robot, size_t n_cols)
 Remove n_cols logical stations from the front of the robot buffer.
enum CoppStatus copp_robot_pop_back_n (struct CoppRobot *robot, size_t n_cols)
 Remove n_cols logical stations from the back of the robot buffer.
enum CoppStatus copp_robot_pop_front_until (struct CoppRobot *robot, size_t idx_s_cut)
 Remove front stations so the kept window starts at idx_s_cut or later.
enum CoppStatus copp_robot_pop_back_until (struct CoppRobot *robot, size_t idx_s_cut)
 Remove back stations so the kept window ends before idx_s_cut.
enum CoppStatus copp_robot_sample_path_2nd (struct CoppRobot *robot, const struct CoppPath *path, size_t idx_s_from, size_t idx_s_to)
 Sample a path over an existing robot station interval and store second-order derivatives.
enum CoppStatus copp_robot_sample_path_3rd (struct CoppRobot *robot, const struct CoppPath *path, size_t idx_s_from, size_t idx_s_to)
 Sample a path over an existing robot station interval and store third-order derivatives.
enum CoppStatus copp_robot_set_q_2nd (struct CoppRobot *robot, size_t idx_s, struct CoppMatrixViewF64 q, struct CoppMatrixViewF64 dq, struct CoppMatrixViewF64 ddq)
 Write second-order path derivatives into an existing robot station interval.
enum CoppStatus copp_robot_set_q_3rd (struct CoppRobot *robot, size_t idx_s, struct CoppMatrixViewF64 q, struct CoppMatrixViewF64 dq, struct CoppMatrixViewF64 ddq, struct CoppMatrixViewF64 dddq)
 Write third-order path derivatives into an existing robot station interval.
enum CoppStatus copp_add_raw_constraint_1st (struct CoppRobot *robot, size_t idx_s, struct CoppMatrixViewF64 amax)
 Add raw first-order constraints over an existing robot station interval.
enum CoppStatus copp_add_raw_constraint_2nd (struct CoppRobot *robot, size_t idx_s, struct CoppMatrixViewF64 acc_a, struct CoppMatrixViewF64 acc_b, struct CoppMatrixViewF64 acc_max)
 Add raw second-order inequality rows over a station interval.
enum CoppStatus copp_add_raw_constraint_3rd (struct CoppRobot *robot, size_t idx_s, struct CoppMatrixViewF64 jerk_a, struct CoppMatrixViewF64 jerk_b, struct CoppMatrixViewF64 jerk_c, struct CoppMatrixViewF64 jerk_d, struct CoppMatrixViewF64 jerk_max)
 Add raw third-order nonlinear inequality rows over a station interval.
enum CoppStatus copp_add_axial_velocity_limits (struct CoppRobot *robot, size_t start_idx_s, size_t len, struct CoppSliceF64 velocity_max, struct CoppSliceF64 velocity_min)
 Add broadcast axial velocity limits over an existing robot station interval.
enum CoppStatus copp_add_axial_velocity_limits_matrix (struct CoppRobot *robot, size_t start_idx_s, struct CoppMatrixViewF64 velocity_max, struct CoppMatrixViewF64 velocity_min)
 Add station-varying axial velocity limits over an existing robot interval.
enum CoppStatus copp_add_axial_acceleration_limits (struct CoppRobot *robot, size_t start_idx_s, size_t len, struct CoppSliceF64 acceleration_max, struct CoppSliceF64 acceleration_min)
 Add broadcast axial acceleration limits over an existing robot station interval.
enum CoppStatus copp_add_axial_acceleration_limits_matrix (struct CoppRobot *robot, size_t start_idx_s, struct CoppMatrixViewF64 acceleration_max, struct CoppMatrixViewF64 acceleration_min)
 Add station-varying axial acceleration limits over an existing robot interval.
enum CoppStatus copp_add_axial_torque_limits (struct CoppRobot *robot, size_t start_idx_s, size_t len, struct CoppSliceF64 torque_max, struct CoppSliceF64 torque_min)
 Add broadcast axial torque limits over an existing robot station interval.
enum CoppStatus copp_add_axial_torque_limits_matrix (struct CoppRobot *robot, size_t start_idx_s, struct CoppMatrixViewF64 torque_max, struct CoppMatrixViewF64 torque_min)
 Add station-varying axial torque limits over an existing robot interval.
enum CoppStatus copp_add_axial_jerk_limits (struct CoppRobot *robot, size_t start_idx_s, size_t len, struct CoppSliceF64 jerk_max, struct CoppSliceF64 jerk_min)
 Add broadcast axial jerk limits over an existing robot station interval.
enum CoppStatus copp_add_axial_jerk_limits_matrix (struct CoppRobot *robot, size_t start_idx_s, struct CoppMatrixViewF64 jerk_max, struct CoppMatrixViewF64 jerk_min)
 Add station-varying axial jerk limits over an existing robot interval.
void copp_robot_free (struct CoppRobot *robot)
 Release a robot handle created by copp_robot_create.

Detailed Description

Typedef Documentation

◆ CoppRobot

typedef struct CoppRobot CoppRobot

Opaque C handle for a library-owned robot and constraint buffer.

Create with copp_robot_create and release exactly once with copp_robot_free. C callers must not inspect or allocate this type directly.

Definition at line 35 of file robot.h.

◆ CoppInverseDynamicsFn

typedef enum CoppStatus(* CoppInverseDynamicsFn) (void *user_data, size_t dim, const double *q, const double *dq, const double *ddq, double *tau)

C callback for inverse dynamics.

The callback receives dim-element vectors q, dq, ddq, and must write dim torque/force values into tau before returning COPP_STATUS_OK. The tau buffer may contain old values on entry, so callbacks should overwrite every entry directly. On failure, return a non-OK status; outer COPP APIs report it as a robot dynamics error.

Definition at line 35 of file robot.h.

Function Documentation

◆ copp_robot_create()

enum CoppStatus copp_robot_create ( size_t dim,
size_t capacity,
struct CoppRobot ** out_robot )

Create a library-owned robot handle for C callers.

On success, *out_robot receives a non-null handle that must be released with copp_robot_free.

Warning
Safety out_robot must be valid for one CoppRobot* write. C callers can pass the address of an ordinary pointer variable; heap allocation is not required for the output pointer itself.

◆ copp_robot_set_inverse_dynamics()

enum CoppStatus copp_robot_set_inverse_dynamics ( struct CoppRobot * robot,
CoppInverseDynamicsFn inverse_dynamics,
void * inverse_dynamics_user_data )

Store an inverse-dynamics callback in a robot handle.

Passing a null inverse_dynamics pointer clears the callback and restores default point dynamics (tau = ddq). When non-null, the callback and inverse_dynamics_user_data must remain valid until replaced, cleared, or the robot is freed.

Example

The example below installs point dynamics explicitly as the robot's inverse-dynamics callback.

static enum CoppStatus point_dynamics(
void *user_data,
size_t dim,
const double *q,
const double *dq,
const double *ddq,
double *tau)
{
for (size_t i = 0; i < dim; ++i) {
tau[i] = ddq[i];
}
}
check(copp_robot_set_inverse_dynamics(robot, point_dynamics, NULL));
CoppStatus
C ABI status code returned by COPP FFI functions.
Definition core.h:34
@ COPP_STATUS_OK
Operation completed successfully.
Definition core.h:38
enum CoppStatus copp_robot_set_inverse_dynamics(struct CoppRobot *robot, CoppInverseDynamicsFn inverse_dynamics, void *inverse_dynamics_user_data)
Store an inverse-dynamics callback in a robot handle.
Warning
Safety robot must be a non-null handle returned by copp_robot_create. inverse_dynamics, when non-null, must not unwind and must write a dim-element tau vector when returning COPP_STATUS_OK.

◆ copp_robot_clear_inverse_dynamics()

enum CoppStatus copp_robot_clear_inverse_dynamics ( struct CoppRobot * robot)

Clear the inverse-dynamics callback stored in a robot handle.

After this call, torque-related operations use default point dynamics (tau = ddq).

Warning
Safety robot must be a non-null handle returned by copp_robot_create.

◆ copp_robot_append_s()

enum CoppStatus copp_robot_append_s ( struct CoppRobot * robot,
struct CoppSliceF64 s )

Append strictly increasing station samples to a robot.

Empty input is accepted as a no-op. Non-empty input must be strictly increasing and must start after the current last stored station.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. s.data must be valid for s.len reads when s.len is non-zero.

◆ copp_robot_amax_substitute()

enum CoppStatus copp_robot_amax_substitute ( struct CoppRobot * robot,
struct CoppSliceF64 amax,
size_t idx_s )

Overwrite first-order bounds from a profile.

amax must contain one value per station to update. The values replace the robot's stored first-order bound over [idx_s, idx_s + amax.len). This is useful before TOPP3 solvers when a TOPP2 profile is used as a tighter linearization/reachability seed.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. amax.data must be valid for amax.len reads when amax.len is non-zero.

◆ copp_robot_dim()

enum CoppStatus copp_robot_dim ( const struct CoppRobot * robot,
size_t * out_dim )

Return the robot/path dimension stored in a robot handle.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_dim must be valid for one size_t write.

◆ copp_robot_len()

enum CoppStatus copp_robot_len ( const struct CoppRobot * robot,
size_t * out_len )

Return the current number of logical station samples stored in a robot.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_len must be valid for one size_t write.

◆ copp_robot_capacity()

enum CoppStatus copp_robot_capacity ( const struct CoppRobot * robot,
size_t * out_capacity )

Return the allocated station capacity of the robot constraint buffer.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_capacity must be valid for one size_t write.

◆ copp_robot_is_empty()

enum CoppStatus copp_robot_is_empty ( const struct CoppRobot * robot,
bool * out_is_empty )

Report whether the robot constraint buffer currently has no stations.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_is_empty must be valid for one bool write.

◆ copp_robot_idx_s_start()

enum CoppStatus copp_robot_idx_s_start ( const struct CoppRobot * robot,
size_t * out_idx_s_start )

Return the first global station index currently stored in the robot.

The active station window is [idx_s_start, idx_s_end).

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_idx_s_start must be valid for one size_t write.

◆ copp_robot_idx_s_end()

enum CoppStatus copp_robot_idx_s_end ( const struct CoppRobot * robot,
size_t * out_idx_s_end )

Return the exclusive global station end index currently stored in the robot.

The active station window is [idx_s_start, idx_s_end).

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_idx_s_end must be valid for one size_t write.

◆ copp_robot_constraint_rows()

enum CoppStatus copp_robot_constraint_rows ( const struct CoppRobot * robot,
size_t * out_amax_rows,
size_t * out_acc_rows,
size_t * out_jerk_rows )

Return the allocated row counts for first-, second-, and third-order constraints.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Every output pointer must be valid for one size_t write.

◆ copp_robot_get_s()

enum CoppStatus copp_robot_get_s ( const struct CoppRobot * robot,
size_t idx_s,
double * out_s )

Read one station value s[idx_s] from the robot constraint buffer.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_s must be valid for one double write.

◆ copp_robot_get_amax()

enum CoppStatus copp_robot_get_amax ( const struct CoppRobot * robot,
size_t idx_s,
double * out_amax )

Read one first-order upper bound amax[idx_s] from the robot.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_amax must be valid for one double write.

◆ copp_robot_s_vec()

enum CoppStatus copp_robot_s_vec ( const struct CoppRobot * robot,
size_t idx_s_from,
size_t idx_s_to,
struct CoppVecF64 * out_s )

Export station values over [idx_s_from, idx_s_to).

On success, out_s owns a COPP-allocated vector and must be released with copp_vec_f64_free.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_s must be valid for one CoppVecF64 write.

◆ copp_robot_amax_vec()

enum CoppStatus copp_robot_amax_vec ( const struct CoppRobot * robot,
size_t idx_s_from,
size_t idx_s_to,
struct CoppVecF64 * out_amax )

Export first-order upper bounds over [idx_s_from, idx_s_to).

On success, out_amax owns a COPP-allocated vector and must be released with copp_vec_f64_free.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. out_amax must be valid for one CoppVecF64 write.

◆ copp_robot_acc_constraints_at()

enum CoppStatus copp_robot_acc_constraints_at ( const struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixF64 * out_acc_a,
struct CoppMatrixF64 * out_acc_b,
struct CoppMatrixF64 * out_acc_max )

Export second-order constraint rows at one station.

On success, the three output matrices are valid_rows x 1 column-major matrices and must each be released with copp_matrix_f64_free.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Every output pointer must be valid for one CoppMatrixF64 write.

◆ copp_robot_jerk_constraints_at()

enum CoppStatus copp_robot_jerk_constraints_at ( const struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixF64 * out_jerk_a,
struct CoppMatrixF64 * out_jerk_b,
struct CoppMatrixF64 * out_jerk_c,
struct CoppMatrixF64 * out_jerk_d,
struct CoppMatrixF64 * out_jerk_max )

Export nonlinear third-order constraint rows at one station.

On success, the five output matrices are valid_rows x 1 column-major matrices and must each be released with copp_matrix_f64_free.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Every output pointer must be valid for one CoppMatrixF64 write.

◆ copp_robot_jerk_linear_constraints_at()

enum CoppStatus copp_robot_jerk_linear_constraints_at ( const struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixF64 * out_jerk_a_linear,
struct CoppMatrixF64 * out_jerk_b,
struct CoppMatrixF64 * out_jerk_c,
struct CoppMatrixF64 * out_jerk_max_linear )

Export linearized third-order constraint rows at one station.

The robot must already have been used to build a TOPP3/COPP3 problem with a linearization interval covering idx_s. On success, the four output matrices are valid_rows x 1 column-major matrices and must each be released with copp_matrix_f64_free.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Every output pointer must be valid for one CoppMatrixF64 write.

◆ copp_robot_clear_constraints()

enum CoppStatus copp_robot_clear_constraints ( struct CoppRobot * robot,
bool keep_idx_s )

Clear all logical constraints stored in the robot.

When keep_idx_s is true, the current global station origin is preserved; otherwise the origin is reset to zero.

Warning
Safety robot must be a non-null handle returned by copp_robot_create.

◆ copp_robot_pop_front_n()

enum CoppStatus copp_robot_pop_front_n ( struct CoppRobot * robot,
size_t n_cols )

Remove n_cols logical stations from the front of the robot buffer.

Warning
Safety robot must be a non-null handle returned by copp_robot_create.

◆ copp_robot_pop_back_n()

enum CoppStatus copp_robot_pop_back_n ( struct CoppRobot * robot,
size_t n_cols )

Remove n_cols logical stations from the back of the robot buffer.

Warning
Safety robot must be a non-null handle returned by copp_robot_create.

◆ copp_robot_pop_front_until()

enum CoppStatus copp_robot_pop_front_until ( struct CoppRobot * robot,
size_t idx_s_cut )

Remove front stations so the kept window starts at idx_s_cut or later.

Warning
Safety robot must be a non-null handle returned by copp_robot_create.

◆ copp_robot_pop_back_until()

enum CoppStatus copp_robot_pop_back_until ( struct CoppRobot * robot,
size_t idx_s_cut )

Remove back stations so the kept window ends before idx_s_cut.

Warning
Safety robot must be a non-null handle returned by copp_robot_create.

◆ copp_robot_sample_path_2nd()

enum CoppStatus copp_robot_sample_path_2nd ( struct CoppRobot * robot,
const struct CoppPath * path,
size_t idx_s_from,
size_t idx_s_to )

Sample a path over an existing robot station interval and store second-order derivatives.

The interval is [idx_s_from, idx_s_to). The station values must already have been appended to the robot.

Example

The example below appends a station grid and samples second-order path derivatives into the robot constraint storage.

double s[] = {0.0, 0.5, 1.0};
struct CoppRobot *robot = NULL;
check(copp_robot_create(dim, 3, &robot));
check(copp_robot_append_s(robot, (struct CoppSliceF64){s, 3}));
check(copp_robot_sample_path_2nd(robot, path, 0, 3));
struct CoppRobot CoppRobot
Opaque C handle for a library-owned robot and constraint buffer.
Definition robot.h:35
enum CoppStatus copp_robot_append_s(struct CoppRobot *robot, struct CoppSliceF64 s)
Append strictly increasing station samples to a robot.
enum CoppStatus copp_robot_create(size_t dim, size_t capacity, struct CoppRobot **out_robot)
Create a library-owned robot handle for C callers.
enum CoppStatus copp_robot_sample_path_2nd(struct CoppRobot *robot, const struct CoppPath *path, size_t idx_s_from, size_t idx_s_to)
Sample a path over an existing robot station interval and store second-order derivatives.
Borrowed immutable f64 slice passed from C to COPP.
Definition core.h:781
Warning
Safety robot and path must be non-null handles created by COPP and must remain valid for the duration of this call.

◆ copp_robot_sample_path_3rd()

enum CoppStatus copp_robot_sample_path_3rd ( struct CoppRobot * robot,
const struct CoppPath * path,
size_t idx_s_from,
size_t idx_s_to )

Sample a path over an existing robot station interval and store third-order derivatives.

The interval is [idx_s_from, idx_s_to). The station values must already have been appended to the robot.

Example

The example below samples third-order path derivatives over the current robot station grid.

check(copp_robot_append_s(robot, (struct CoppSliceF64){s, n}));
check(copp_robot_sample_path_3rd(robot, path, 0, n));
enum CoppStatus copp_robot_sample_path_3rd(struct CoppRobot *robot, const struct CoppPath *path, size_t idx_s_from, size_t idx_s_to)
Sample a path over an existing robot station interval and store third-order derivatives.
Warning
Safety robot and path must be non-null handles created by COPP and must remain valid for the duration of this call.

◆ copp_robot_set_q_2nd()

enum CoppStatus copp_robot_set_q_2nd ( struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixViewF64 q,
struct CoppMatrixViewF64 dq,
struct CoppMatrixViewF64 ddq )

Write second-order path derivatives into an existing robot station interval.

The matrices must have shape dim x N, where dim is the robot dimension and N is the number of station samples to update. Contiguous column-major input is the fast path; other valid CoppMatrixViewF64 layouts are copied once into column-major temporary storage.

This function clears any existing third-derivative data over the same interval. Use copp_robot_set_q_3rd when third-order derivative data is needed.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_robot_set_q_3rd()

enum CoppStatus copp_robot_set_q_3rd ( struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixViewF64 q,
struct CoppMatrixViewF64 dq,
struct CoppMatrixViewF64 ddq,
struct CoppMatrixViewF64 dddq )

Write third-order path derivatives into an existing robot station interval.

The matrices must have shape dim x N, where dim is the robot dimension and N is the number of station samples to update. Contiguous column-major input is the fast path; other valid CoppMatrixViewF64 layouts are copied once into column-major temporary storage.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_add_raw_constraint_1st()

enum CoppStatus copp_add_raw_constraint_1st ( struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixViewF64 amax )

Add raw first-order constraints over an existing robot station interval.

amax must be a matrix view with shape R x N. For each station column, COPP reduces all R rows to their minimum and tightens the stored first-order bound: a <= min_r amax[r, station]. Contiguous column-major input is the fast path; other valid layouts are copied once into column-major temporary storage.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_add_raw_constraint_2nd()

enum CoppStatus copp_add_raw_constraint_2nd ( struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixViewF64 acc_a,
struct CoppMatrixViewF64 acc_b,
struct CoppMatrixViewF64 acc_max )

Add raw second-order inequality rows over a station interval.

All matrices must have the same shape R x N. Each row stores one inequality: acc_a * a + acc_b * b <= acc_max. Lower bounds should be provided by negating the row on the C side. Contiguous column-major input is the fast path; other valid layouts are copied once into column-major temporary storage.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_add_raw_constraint_3rd()

enum CoppStatus copp_add_raw_constraint_3rd ( struct CoppRobot * robot,
size_t idx_s,
struct CoppMatrixViewF64 jerk_a,
struct CoppMatrixViewF64 jerk_b,
struct CoppMatrixViewF64 jerk_c,
struct CoppMatrixViewF64 jerk_d,
struct CoppMatrixViewF64 jerk_max )

Add raw third-order nonlinear inequality rows over a station interval.

All matrices must have the same shape R x N. Each row stores one inequality: sqrt(a) * (jerk_a*a + jerk_b*b + jerk_c*c + jerk_d) <= jerk_max. Lower bounds should be provided by negating the row on the C side. Contiguous column-major input is the fast path; other valid layouts are copied once into column-major temporary storage.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_add_axial_velocity_limits()

enum CoppStatus copp_add_axial_velocity_limits ( struct CoppRobot * robot,
size_t start_idx_s,
size_t len,
struct CoppSliceF64 velocity_max,
struct CoppSliceF64 velocity_min )

Add broadcast axial velocity limits over an existing robot station interval.

velocity_max and velocity_min must both have length equal to the robot dimension. The same per-axis limits are applied to every station in [start_idx_s, start_idx_s + len). len == 0 is accepted as a no-op.

Example

The example below applies the same per-axis velocity box to every station in an interval.

double vmax[] = {1.0, 1.0, 1.0};
double vmin[] = {-1.0, -1.0, -1.0};
robot,
0,
n,
(struct CoppSliceF64){vmax, 3},
(struct CoppSliceF64){vmin, 3}));
enum CoppStatus copp_add_axial_velocity_limits(struct CoppRobot *robot, size_t start_idx_s, size_t len, struct CoppSliceF64 velocity_max, struct CoppSliceF64 velocity_min)
Add broadcast axial velocity limits over an existing robot station interval.
Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty slices must point to valid contiguous double values.

◆ copp_add_axial_velocity_limits_matrix()

enum CoppStatus copp_add_axial_velocity_limits_matrix ( struct CoppRobot * robot,
size_t start_idx_s,
struct CoppMatrixViewF64 velocity_max,
struct CoppMatrixViewF64 velocity_min )

Add station-varying axial velocity limits over an existing robot interval.

velocity_max and velocity_min must be matrix views with shape dim x N. Column j is applied to station start_idx_s + j. N == 0 is accepted as a no-op when both matrices have shape dim x 0. Contiguous column-major input is the fast path; other valid layouts are copied once into column-major temporary storage.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_add_axial_acceleration_limits()

enum CoppStatus copp_add_axial_acceleration_limits ( struct CoppRobot * robot,
size_t start_idx_s,
size_t len,
struct CoppSliceF64 acceleration_max,
struct CoppSliceF64 acceleration_min )

Add broadcast axial acceleration limits over an existing robot station interval.

acceleration_max and acceleration_min must both have length equal to the robot dimension. The same per-axis limits are applied to every station in [start_idx_s, start_idx_s + len). len == 0 is accepted as a no-op.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty slices must point to valid contiguous double values.

◆ copp_add_axial_acceleration_limits_matrix()

enum CoppStatus copp_add_axial_acceleration_limits_matrix ( struct CoppRobot * robot,
size_t start_idx_s,
struct CoppMatrixViewF64 acceleration_max,
struct CoppMatrixViewF64 acceleration_min )

Add station-varying axial acceleration limits over an existing robot interval.

acceleration_max and acceleration_min must be matrix views with shape dim x N. Column j is applied to station start_idx_s + j. N == 0 is accepted as a no-op when both matrices have shape dim x 0. Contiguous column-major input is the fast path; other valid layouts are copied once into column-major temporary storage.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_add_axial_torque_limits()

enum CoppStatus copp_add_axial_torque_limits ( struct CoppRobot * robot,
size_t start_idx_s,
size_t len,
struct CoppSliceF64 torque_max,
struct CoppSliceF64 torque_min )

Add broadcast axial torque limits over an existing robot station interval.

torque_max and torque_min must both have length equal to the robot dimension. The same per-axis limits are applied to every station in [start_idx_s, start_idx_s + len). len == 0 is accepted as a no-op.

The robot must already contain second-order path derivative data over the same interval, for example via copp_robot_set_q_2nd or copp_robot_sample_path_2nd.

If the robot has no stored inverse-dynamics callback, point dynamics (tau = ddq) is used.

Example

The example below applies broadcast torque limits over an interval that already has second-order path derivative data.

double tau_max[] = {40.0, 40.0, 40.0};
double tau_min[] = {-40.0, -40.0, -40.0};
robot,
0,
n,
(struct CoppSliceF64){tau_max, 3},
(struct CoppSliceF64){tau_min, 3}));
enum CoppStatus copp_add_axial_torque_limits(struct CoppRobot *robot, size_t start_idx_s, size_t len, struct CoppSliceF64 torque_max, struct CoppSliceF64 torque_min)
Add broadcast axial torque limits over an existing robot station interval.
Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty slices must point to valid contiguous double values. If a callback was set with copp_robot_set_inverse_dynamics, it must remain valid for this call.

◆ copp_add_axial_torque_limits_matrix()

enum CoppStatus copp_add_axial_torque_limits_matrix ( struct CoppRobot * robot,
size_t start_idx_s,
struct CoppMatrixViewF64 torque_max,
struct CoppMatrixViewF64 torque_min )

Add station-varying axial torque limits over an existing robot interval.

torque_max and torque_min must be matrix views with shape dim x N. Column j is applied to station start_idx_s + j. N == 0 is accepted as a no-op when both matrices have shape dim x 0. Contiguous column-major input is the fast path; other valid layouts are copied once into column-major temporary storage.

The robot must already contain second-order path derivative data over the same interval, for example via copp_robot_set_q_2nd or copp_robot_sample_path_2nd.

If the robot has no stored inverse-dynamics callback, point dynamics (tau = ddq) is used.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts. If a callback was set with copp_robot_set_inverse_dynamics, it must remain valid for this call.

◆ copp_add_axial_jerk_limits()

enum CoppStatus copp_add_axial_jerk_limits ( struct CoppRobot * robot,
size_t start_idx_s,
size_t len,
struct CoppSliceF64 jerk_max,
struct CoppSliceF64 jerk_min )

Add broadcast axial jerk limits over an existing robot station interval.

jerk_max and jerk_min must both have length equal to the robot dimension. The same per-axis limits are applied to every station in [start_idx_s, start_idx_s + len). len == 0 is accepted as a no-op.

The robot must already contain third-order path derivative data over the same interval, for example via copp_robot_set_q_3rd or copp_robot_sample_path_3rd.

Example

The example below applies broadcast jerk limits after third-order path derivative data has been stored.

double jmax[] = {5.0, 5.0, 5.0};
double jmin[] = {-5.0, -5.0, -5.0};
robot,
0,
n,
(struct CoppSliceF64){jmax, 3},
(struct CoppSliceF64){jmin, 3}));
enum CoppStatus copp_add_axial_jerk_limits(struct CoppRobot *robot, size_t start_idx_s, size_t len, struct CoppSliceF64 jerk_max, struct CoppSliceF64 jerk_min)
Add broadcast axial jerk limits over an existing robot station interval.
Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty slices must point to valid contiguous double values.

◆ copp_add_axial_jerk_limits_matrix()

enum CoppStatus copp_add_axial_jerk_limits_matrix ( struct CoppRobot * robot,
size_t start_idx_s,
struct CoppMatrixViewF64 jerk_max,
struct CoppMatrixViewF64 jerk_min )

Add station-varying axial jerk limits over an existing robot interval.

jerk_max and jerk_min must be matrix views with shape dim x N. Column j is applied to station start_idx_s + j. N == 0 is accepted as a no-op when both matrices have shape dim x 0. Contiguous column-major input is the fast path; other valid layouts are copied once into column-major temporary storage.

The robot must already contain third-order path derivative data over the same interval, for example via copp_robot_set_q_3rd or copp_robot_sample_path_3rd.

Warning
Safety robot must be a non-null handle returned by copp_robot_create. Non-empty matrices must point to valid double arrays for their declared layouts.

◆ copp_robot_free()

void copp_robot_free ( struct CoppRobot * robot)

Release a robot handle created by copp_robot_create.

Passing null is allowed and has no effect.

Warning
Safety robot must either be null or a handle returned by copp_robot_create that has not already been freed.