1 #ifndef CONTROLS_ALLOCATOR_SOLVER_THRUST_ALLOCATION_6DOF_QP_SOLVER_H
2 #define CONTROLS_ALLOCATOR_SOLVER_THRUST_ALLOCATION_6DOF_QP_SOLVER_H
6 #include <eigen-quadprog/QuadProg.h>
42 Eigen::QuadProgDense
qp_;
57 void set_bineq(
float min_force,
float max_force);
93 void set_q(
double val, uint8_t axis)
override;
101 void update_limits(
float min_force,
float max_force)
override;
Eigen::Matrix< double, 6, 1 > Vector6d
Definition: Types.h:29
Quadratic-programming thrust allocator for full 6DOF underwater vehicles.
Definition: ThrustAllocation6DOFQPSolver.h:18
Vector6d get_body_force(const VectorXd &thruster_forces) override
Reconstructs the achieved 6DOF body force from per-thruster forces.
Definition: ThrustAllocation6DOFQPSolver.cpp:81
void update_limits(float min_force, float max_force) override
Updates the per-thruster force bounds for the QP inequality constraints.
Definition: ThrustAllocation6DOFQPSolver.cpp:85
ThrustAllocation6DOFQPSolver()=default
int num_thrusters_
Number of thrusters in the current layout.
Definition: ThrustAllocation6DOFQPSolver.h:21
MatrixXd Aeq_
6x(N+6) equality-constraint matrix [T_full | I_6]
Definition: ThrustAllocation6DOFQPSolver.h:27
VectorXd Bineq_
2N-element inequality right-hand side vector
Definition: ThrustAllocation6DOFQPSolver.h:33
MatrixXd T_full_
Full 6xN allocation matrix retained for get_body_force()
Definition: ThrustAllocation6DOFQPSolver.h:24
void build_qp_matrices(const MatrixXd &T_full)
Builds the equality and inequality QP matrices from the allocation matrix.
Definition: ThrustAllocation6DOFQPSolver.cpp:34
void set_bineq(float min_force, float max_force)
Updates the inequality RHS vector with new per-thruster force bounds.
Definition: ThrustAllocation6DOFQPSolver.cpp:54
MatrixXd Aineq_
2Nx(N+6) inequality-constraint matrix encoding per-thruster bounds
Definition: ThrustAllocation6DOFQPSolver.h:30
MatrixXd Q_
(N+6)x(N+6) quadratic cost matrix (thruster effort + slack penalties)
Definition: ThrustAllocation6DOFQPSolver.h:39
void build(const ThrusterLayout &layout) override
Builds QP matrices and initialises the solver from a thruster layout.
Definition: ThrustAllocation6DOFQPSolver.cpp:8
void set_q(double val, uint8_t axis) override
Sets the slack-variable penalty weight for a given body axis.
Definition: ThrustAllocation6DOFQPSolver.cpp:89
VectorXd C_
Linear cost vector (zero for pure quadratic minimisation)
Definition: ThrustAllocation6DOFQPSolver.h:36
Eigen::QuadProgDense qp_
Dense QP solver instance.
Definition: ThrustAllocation6DOFQPSolver.h:42
VectorXd allocate(const Vector6d &tau) override
Solves the 6DOF QP and returns per-thruster force magnitudes.
Definition: ThrustAllocation6DOFQPSolver.cpp:63
Abstract interface for quadratic-programming thrust allocation solvers.
Definition: ThrustAllocationSolverInterface.h:15
Manages a collection of Thruster objects and builds the allocation matrix.
Definition: ThrusterLayout.h:11