|
controls
3.0.0
|
Quadratic-programming thrust allocator for full 6DOF underwater vehicles. More...
#include <ThrustAllocation6DOFQPSolver.h>
Public Member Functions | |
| ThrustAllocation6DOFQPSolver ()=default | |
| void | build (const ThrusterLayout &layout) override |
| Builds QP matrices and initialises the solver from a thruster layout. More... | |
| VectorXd | allocate (const Vector6d &tau) override |
| Solves the 6DOF QP and returns per-thruster force magnitudes. More... | |
| Vector6d | getBodyForce (const VectorXd &thrusterForces) override |
| Reconstructs the achieved 6DOF body force from per-thruster forces. More... | |
| void | setQ (double val, uint8_t axis) override |
| Sets the slack-variable penalty weight for a given body axis. More... | |
| void | updateLimits (float min_force, float max_force) override |
| Updates the per-thruster force bounds for the QP inequality constraints. More... | |
Public Member Functions inherited from ThrustAllocationSolverInterface | |
| virtual | ~ThrustAllocationSolverInterface ()=default |
Protected Member Functions | |
| void | buildQPMatrices (const MatrixXd &T_full) |
| Builds the equality and inequality QP matrices from the allocation matrix. More... | |
| void | setBineq (float min_force, float max_force) |
| Updates the inequality RHS vector with new per-thruster force bounds. More... | |
Protected Attributes | |
| int | numThrusters |
| Number of thrusters in the current layout. More... | |
| std::vector< int > | thrustersIdxMapping |
| Maps QP variable index i to the global thruster idx. More... | |
| ThrusterLayout | layout |
| Copy of the layout passed to build() More... | |
| std::vector< Thruster > | sorted_thrusters |
| Thrusters sorted by idx for deterministic column ordering. More... | |
| MatrixXd | Aeq |
| 6x(N+6) equality-constraint matrix [T_full | I_6] More... | |
| MatrixXd | Aineq |
| 2Nx(N+6) inequality-constraint matrix encoding per-thruster bounds More... | |
| VectorXd | Bineq |
| 2N-element inequality right-hand side vector More... | |
| VectorXd | C |
| Linear cost vector (zero for pure quadratic minimisation) More... | |
| MatrixXd | Q |
| (N+6)x(N+6) quadratic cost matrix (thruster effort + slack penalties) More... | |
| Eigen::QuadProgDense | qp |
| Dense QP solver instance. More... | |
Quadratic-programming thrust allocator for full 6DOF underwater vehicles.
Solves a dense QP with N+6 variables (N thruster forces + 6 slack variables), 6 equality constraints (full body force matching), and 2N inequality constraints (per-thruster force bounds). Slack variables absorb infeasibility when the requested wrench exceeds the achievable thruster envelope.
|
default |
|
overridevirtual |
Solves the 6DOF QP and returns per-thruster force magnitudes.
| tau | [in] Desired 6DOF body force/torque vector in N and Nm |
Implements ThrustAllocationSolverInterface.
|
overridevirtual |
Builds QP matrices and initialises the solver from a thruster layout.
| layout | [in] Thruster layout describing positions and force directions |
Implements ThrustAllocationSolverInterface.
|
protected |
Builds the equality and inequality QP matrices from the allocation matrix.
| T_full | [in] Full 6xN allocation matrix |
|
overridevirtual |
Reconstructs the achieved 6DOF body force from per-thruster forces.
| thrusterForces | [in] Nx1 vector of per-thruster forces in Newtons |
Implements ThrustAllocationSolverInterface.
|
protected |
Updates the inequality RHS vector with new per-thruster force bounds.
| min_force | [in] Minimum thruster force in Newtons |
| max_force | [in] Maximum thruster force in Newtons |
|
overridevirtual |
Sets the slack-variable penalty weight for a given body axis.
| val | [in] Exponent for the weight (weight = 10^val) |
| axis | [in] Body axis index: 0=X, 1=Y, 2=Z, 3=Roll, 4=Pitch, 5=Yaw |
Implements ThrustAllocationSolverInterface.
|
overridevirtual |
Updates the per-thruster force bounds for the QP inequality constraints.
| min_force | [in] Minimum thruster force in Newtons |
| max_force | [in] Maximum thruster force in Newtons |
Implements ThrustAllocationSolverInterface.
|
protected |
6x(N+6) equality-constraint matrix [T_full | I_6]
|
protected |
2Nx(N+6) inequality-constraint matrix encoding per-thruster bounds
|
protected |
2N-element inequality right-hand side vector
|
protected |
Linear cost vector (zero for pure quadratic minimisation)
|
protected |
Copy of the layout passed to build()
|
protected |
Number of thrusters in the current layout.
|
protected |
(N+6)x(N+6) quadratic cost matrix (thruster effort + slack penalties)
|
protected |
Dense QP solver instance.
|
protected |
Thrusters sorted by idx for deterministic column ordering.
|
protected |
Maps QP variable index i to the global thruster idx.