Line data Source code
1 : #ifndef CONTROLS_ALLOCATOR_CONFIG_THRUSTER_LAYOUT_H 2 : #define CONTROLS_ALLOCATOR_CONFIG_THRUSTER_LAYOUT_H 3 : 4 : #include <allocator/config/Thruster.h> 5 : 6 : #include <vector> 7 : 8 : /** 9 : * @brief Manages a collection of Thruster objects and builds the allocation matrix 10 : */ 11 1 : class ThrusterLayout { 12 : public: 13 : /** @brief All thrusters registered in this layout */ 14 : std::vector<Thruster> thrusters; 15 : 16 : /** 17 : * @brief Constructs an empty layout 18 : */ 19 1 : ThrusterLayout(); 20 : 21 : /** 22 : * @brief Adds a thruster to the layout 23 : * 24 : * @param thruster [in] Thruster to append 25 : */ 26 1 : void addThruster(const Thruster& thruster); 27 : 28 : /** 29 : * @brief Removes all thrusters from the layout 30 : */ 31 1 : void clear(); 32 : 33 : /** 34 : * @brief Builds the 6xN force-allocation matrix from the current thruster set 35 : * 36 : * Each column i corresponds to the thruster with idx == i. The upper three 37 : * rows are the normalised thrust direction; the lower three rows are the 38 : * cross-product moment arm (position × direction). 39 : * 40 : * @return 6xN allocation matrix T where T * f_thrusters = τ_body 41 : */ 42 1 : MatrixXd buildAllocationMatrix() const; 43 : }; 44 : 45 : #endif // CONTROLS_ALLOCATOR_CONFIG_THRUSTER_LAYOUT_H