COPP C ABI
C interface for COPP trajectory optimization
Loading...
Searching...
No Matches
CoppObjective Struct Reference

Borrowed objective descriptor for COPP solvers. More...

#include <formulation.h>

Data Fields

enum CoppObjectiveKind kind
 Objective kind.
double weight
 Objective weight.
struct CoppSliceF64 alpha
 Linear objective coefficient for variable a.
struct CoppSliceF64 beta
 Linear objective coefficient for variable b.
struct CoppSliceF64 normalize
 Torque objective normalization vector.

Detailed Description

Borrowed objective descriptor for COPP solvers.

For Time, only weight is used. For Linear, alpha and beta are interpreted by each solver family: COPP2 uses node-based alpha and interval-based beta, while COPP3 uses node-based alpha and node-based beta. For ThermalEnergy and TotalVariationTorque, normalize must have length equal to the robot dimension. Torque is evaluated through the robot's stored inverse-dynamics callback when provided, otherwise by the default point model (tau = ddq).

Example

The example below combines a time objective with a thermal-energy objective for a three-axis robot.

struct CoppSliceF64 empty = {NULL, 0};
double normalize[] = {1.0, 1.0, 1.0};
struct CoppObjective objectives[2] = {
{COPP_OBJECTIVE_KIND_TIME, 1.0, empty, empty, empty},
{
0.1,
empty,
empty,
(struct CoppSliceF64){normalize, 3},
},
};
@ COPP_OBJECTIVE_KIND_TIME
Time objective: weight * integral dt.
Definition formulation.h:35
@ COPP_OBJECTIVE_KIND_THERMAL_ENERGY
Thermal-energy objective.
Definition formulation.h:48
struct CoppSliceF64 normalize
Torque objective normalization vector.
Borrowed immutable f64 slice passed from C to COPP.
Definition core.h:781

Definition at line 86 of file formulation.h.

Field Documentation

◆ kind

enum CoppObjectiveKind CoppObjective::kind

Objective kind.

Definition at line 90 of file formulation.h.

◆ weight

double CoppObjective::weight

Objective weight.

Definition at line 94 of file formulation.h.

◆ alpha

struct CoppSliceF64 CoppObjective::alpha

Linear objective coefficient for variable a.

Definition at line 98 of file formulation.h.

◆ beta

struct CoppSliceF64 CoppObjective::beta

Linear objective coefficient for variable b.

Definition at line 102 of file formulation.h.

◆ normalize

struct CoppSliceF64 CoppObjective::normalize

Torque objective normalization vector.

Definition at line 106 of file formulation.h.


The documentation for this struct was generated from the following file: