Struct Constraints

Inheritance Relationships

Derived Types

Struct Documentation

struct Constraints

Subclassed by roboplan::PositionLimit, roboplan::VelocityLimit

Public Functions

virtual ~Constraints() = default
virtual int getNumConstraints(const Scene &scene) const = 0

Get the number of constraint rows this constraint will produce.

Parameters:

scene – The scene containing robot state and model

Returns:

Number of constraint rows

virtual tl::expected<void, std::string> computeQpConstraints(const Scene &scene, Eigen::Ref<Eigen::MatrixXd> constraint_matrix, Eigen::Ref<Eigen::VectorXd> lower_bounds, Eigen::Ref<Eigen::VectorXd> upper_bounds) const = 0

Compute QP constraint matrices using pre-allocated workspace views.

The constraint_matrix, lower_bounds, and upper_bounds parameters are Eigen::Ref views into pre-allocated workspace memory. The views are already sized to match getNumConstraints() rows, so implementations should fill the entire view.

Parameters:
  • scene – The scene containing robot state and model

  • constraint_matrix – Output constraint matrix G (pre-sized view: num_constraints × num_variables)

  • lower_bounds – Output lower bounds vector (pre-sized view: num_constraints)

  • upper_bounds – Output upper bounds vector (pre-sized view: num_constraints)

Returns:

void on success, error message on failure