mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 15:40:31 +08:00
control_allocator: make effective source name a class member
This commit is contained in:
@@ -103,6 +103,11 @@ public:
|
||||
*/
|
||||
virtual int numActuators() const = 0;
|
||||
|
||||
/**
|
||||
* Display name
|
||||
*/
|
||||
virtual const char *name() const = 0;
|
||||
|
||||
protected:
|
||||
matrix::Vector<float, NUM_ACTUATORS> _trim; ///< Actuator trim
|
||||
FlightPhase _flight_phase{FlightPhase::HOVER_FLIGHT}; ///< Current flight phase
|
||||
|
||||
+2
@@ -79,6 +79,8 @@ public:
|
||||
bool getEffectivenessMatrix(matrix::Matrix<float, NUM_AXES, NUM_ACTUATORS> &matrix, bool force) override;
|
||||
|
||||
int numActuators() const override { return _num_actuators; }
|
||||
|
||||
const char *name() const override { return "Multirotor"; }
|
||||
private:
|
||||
bool _updated{true};
|
||||
int _num_actuators{0};
|
||||
|
||||
+2
@@ -59,6 +59,8 @@ public:
|
||||
void setFlightPhase(const FlightPhase &flight_phase) override;
|
||||
|
||||
int numActuators() const override { return 7; }
|
||||
|
||||
const char *name() const override { return "Standard VTOL"; }
|
||||
protected:
|
||||
bool _updated{true};
|
||||
};
|
||||
|
||||
+2
@@ -59,6 +59,8 @@ public:
|
||||
void setFlightPhase(const FlightPhase &flight_phase) override;
|
||||
|
||||
int numActuators() const override { return 10; }
|
||||
|
||||
const char *name() const override { return "VTOL Tiltrotor"; }
|
||||
protected:
|
||||
bool _updated{true};
|
||||
};
|
||||
|
||||
@@ -442,22 +442,8 @@ int ControlAllocator::print_status()
|
||||
}
|
||||
|
||||
// Print current airframe
|
||||
switch ((EffectivenessSource)_param_ca_airframe.get()) {
|
||||
case EffectivenessSource::NONE:
|
||||
PX4_INFO("EffectivenessSource: None");
|
||||
break;
|
||||
|
||||
case EffectivenessSource::MULTIROTOR:
|
||||
PX4_INFO("EffectivenessSource: MC parameters");
|
||||
break;
|
||||
|
||||
case EffectivenessSource::STANDARD_VTOL:
|
||||
PX4_INFO("EffectivenessSource: Standard VTOL");
|
||||
break;
|
||||
|
||||
case EffectivenessSource::TILTROTOR_VTOL:
|
||||
PX4_INFO("EffectivenessSource: Tiltrotor VTOL");
|
||||
break;
|
||||
if (_actuator_effectiveness != nullptr) {
|
||||
PX4_INFO("Effectiveness Source: %s", _actuator_effectiveness->name());
|
||||
}
|
||||
|
||||
// Print current effectiveness matrix
|
||||
|
||||
Reference in New Issue
Block a user