18#ifndef __SC_PULSEWIDTHLP__
19#define __SC_PULSEWIDTHLP__
25#include <MatrixLib/MatrixLib.h>
42 ml_matrix thruster_positions;
44 ml_matrix thruster_directions;
46 ml_matrix thruster_coefficients;
54 ml_matrix force_demand;
56 ml_matrix torque_demand;
58 ml_matrix force_matrix;
60 ml_matrix torque_matrix;
62 ml_matrix slack_matrix;
64 ml_matrix center_of_mass;
66 double force_error_weight;
68 double torque_error_weight;
84 void SetThrusterData(
int n, ml_matrix positions, ml_matrix directions, ml_matrix coeffs );
Multi-Thruster Pulsewidth Solution using Linear Program Formulation.
Definition: sc_pulsewidth_lp.h:38
int nThrusters
Number of thrusters.
Definition: sc_pulsewidth_lp.h:75
bool SolveMinPW(void)
Solve for the minimum pulsewidths that achieve force and torque demands.
Definition: sc_pulsewidth_lp.cc:61
void SetSlackScale(double scale)
Set the slack variable scale.
Definition: sc_pulsewidth_lp.cc:212
void SetCenterOfMass(ml_matrix cm)
Set the center of mass.
Definition: sc_pulsewidth_lp.cc:224
void Initialize(void)
Initialize.
Definition: sc_pulsewidth_lp.cc:23
void SetThrusterCoefficients(ml_matrix coeffs)
Set the thruster coefficients.
Definition: sc_pulsewidth_lp.cc:199
ml_matrix pulsewidth
Pulsewidth solution.
Definition: sc_pulsewidth_lp.h:72
PulseWidthLP(void)
Constructor.
Definition: sc_pulsewidth_lp.cc:18
ml_matrix GetForce(void)
Get the achieved force.
Definition: sc_pulsewidth_lp.cc:230
void SetTorqueDemand(ml_matrix torque)
Set the torque demand.
Definition: sc_pulsewidth_lp.cc:181
void SetSlackWeight(double weight)
Set the slack variable weight.
ml_matrix GetForceMatrix(void)
Get the force matrix.
Definition: sc_pulsewidth_lp.cc:262
ml_matrix GetTorque(void)
Get the achieved torque.
Definition: sc_pulsewidth_lp.cc:240
void SetForceDemand(ml_matrix force)
Set the force demand.
Definition: sc_pulsewidth_lp.cc:175
ml_matrix GetForceDemand(void)
Get the force demand.
Definition: sc_pulsewidth_lp.cc:250
void SetTankPressure(double pressure)
Set the tank pressure.
Definition: sc_pulsewidth_lp.cc:218
void SetThrusterPositions(ml_matrix positions)
Set the thruster positions.
Definition: sc_pulsewidth_lp.cc:187
ml_matrix GetTorqueMatrix(void)
Get the torque matrix.
Definition: sc_pulsewidth_lp.cc:268
ml_matrix GetTorqueDemand(void)
Get the torque demand.
Definition: sc_pulsewidth_lp.cc:256
void UpdateForceTorqueMatrix(void)
Update the force matrix and torque matrix.
Definition: sc_pulsewidth_lp.cc:160
void SetThrusterDirections(ml_matrix directions)
Set the thruster directions.
Definition: sc_pulsewidth_lp.cc:193
void SetThrusterData(int n, ml_matrix positions, ml_matrix directions, ml_matrix coeffs)
Set the thruster data.
Definition: sc_pulsewidth_lp.cc:48
bool SolveMaxForce(void)
Solve for the pulsewidths that meets torque demand and maximizes force magnitude in desired direction...
Definition: sc_pulsewidth_lp.cc:97
void SetErrorWeights(double fW, double tW)
Set the error weights for force and torque.
Definition: sc_pulsewidth_lp.cc:205
Physical and mathematical constants.