forked from Archive/PX4-Autopilot
Boats: stop motors when commanding zero speed
This commit is contained in:
parent
d0d113405a
commit
e0e5b38c0e
|
@ -48,9 +48,10 @@ ActuatorEffectivenessCustom::getEffectivenessMatrix(Configuration &configuration
|
|||
return false;
|
||||
}
|
||||
|
||||
// motors
|
||||
// Motors
|
||||
_motors.enablePropellerTorque(false);
|
||||
const bool motors_added_successfully = _motors.addActuators(configuration);
|
||||
_motors_mask = _motors.getMotors();
|
||||
|
||||
// Torque
|
||||
const bool torque_added_successfully = _torque.addActuators(configuration);
|
||||
|
@ -58,3 +59,9 @@ ActuatorEffectivenessCustom::getEffectivenessMatrix(Configuration &configuration
|
|||
return (motors_added_successfully && torque_added_successfully);
|
||||
}
|
||||
|
||||
void ActuatorEffectivenessCustom::updateSetpoint(const matrix::Vector<float, NUM_AXES> &control_sp,
|
||||
int matrix_index, ActuatorVector &actuator_sp, const matrix::Vector<float, NUM_ACTUATORS> &actuator_min,
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &actuator_max)
|
||||
{
|
||||
stopMaskedMotorsWithZeroThrust(_motors_mask, actuator_sp);
|
||||
}
|
||||
|
|
|
@ -45,9 +45,15 @@ public:
|
|||
|
||||
bool getEffectivenessMatrix(Configuration &configuration, EffectivenessUpdateReason external_update) override;
|
||||
|
||||
void updateSetpoint(const matrix::Vector<float, NUM_AXES> &control_sp, int matrix_index,
|
||||
ActuatorVector &actuator_sp, const matrix::Vector<float, NUM_ACTUATORS> &actuator_min,
|
||||
const matrix::Vector<float, NUM_ACTUATORS> &actuator_max) override;
|
||||
|
||||
const char *name() const override { return "Custom"; }
|
||||
|
||||
protected:
|
||||
ActuatorEffectivenessRotors _motors;
|
||||
ActuatorEffectivenessControlSurfaces _torque;
|
||||
|
||||
uint32_t _motors_mask{};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue