mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 17:23:34 +08:00
delete MOT_ORDERING
This commit is contained in:
@@ -150,8 +150,6 @@ void MixingOutput::updateParams()
|
||||
{
|
||||
ModuleParams::updateParams();
|
||||
|
||||
_param_mot_ordering.set(0); // not used with dynamic mixing
|
||||
|
||||
bool function_changed = false;
|
||||
|
||||
for (unsigned i = 0; i < _max_num_outputs; i++) {
|
||||
@@ -429,10 +427,10 @@ unsigned MixingOutput::motorTest()
|
||||
|
||||
if (idx < MAX_ACTUATORS) {
|
||||
if (test_motor.value < 0.f) {
|
||||
_current_output_value[reorderedMotorIndex(idx)] = _disarmed_value[idx];
|
||||
_current_output_value[idx] = _disarmed_value[idx];
|
||||
|
||||
} else {
|
||||
_current_output_value[reorderedMotorIndex(idx)] =
|
||||
_current_output_value[idx] =
|
||||
math::constrain<uint16_t>(_min_value[idx] + (uint16_t)((_max_value[idx] - _min_value[idx]) * test_motor.value),
|
||||
_min_value[idx], _max_value[idx]);
|
||||
}
|
||||
@@ -767,20 +765,3 @@ MixingOutput::actualFailsafeValue(int index) const
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
int MixingOutput::reorderedMotorIndex(int index) const
|
||||
{
|
||||
if ((MotorOrdering)_param_mot_ordering.get() == MotorOrdering::Betaflight) {
|
||||
switch (index) {
|
||||
case 0: return 1;
|
||||
|
||||
case 1: return 2;
|
||||
|
||||
case 2: return 3;
|
||||
|
||||
case 3: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
@@ -186,13 +186,6 @@ public:
|
||||
*/
|
||||
uint16_t actualFailsafeValue(int index) const;
|
||||
|
||||
/**
|
||||
* Get the motor index that maps from PX4 convention to the configured one
|
||||
* @param index motor index in [0, num_motors-1]
|
||||
* @return reordered motor index. When out of range, the input index is returned
|
||||
*/
|
||||
int reorderedMotorIndex(int index) const;
|
||||
|
||||
void setIgnoreLockdown(bool ignore_lockdown) { _ignore_lockdown = ignore_lockdown; }
|
||||
|
||||
/**
|
||||
@@ -244,11 +237,6 @@ private:
|
||||
param_t failsafe{PARAM_INVALID};
|
||||
};
|
||||
|
||||
enum class MotorOrdering : int32_t {
|
||||
PX4 = 0,
|
||||
Betaflight = 1
|
||||
};
|
||||
|
||||
void lock() { do {} while (px4_sem_wait(&_lock) != 0); }
|
||||
void unlock() { px4_sem_post(&_lock); }
|
||||
|
||||
@@ -319,7 +307,6 @@ private:
|
||||
(ParamInt<px4::params::MC_AIRMODE>) _param_mc_airmode, ///< multicopter air-mode
|
||||
(ParamFloat<px4::params::MOT_SLEW_MAX>) _param_mot_slew_max,
|
||||
(ParamFloat<px4::params::THR_MDL_FAC>) _param_thr_mdl_fac, ///< thrust to motor control signal modelling factor
|
||||
(ParamInt<px4::params::MOT_ORDERING>) _param_mot_ordering,
|
||||
(ParamBool<px4::params::SYS_CTRL_ALLOC>) _param_sys_ctrl_alloc
|
||||
|
||||
)
|
||||
|
||||
@@ -16,20 +16,3 @@
|
||||
* @group Mixer Output
|
||||
*/
|
||||
PARAM_DEFINE_INT32(MC_AIRMODE, 0);
|
||||
|
||||
/**
|
||||
* Motor Ordering
|
||||
*
|
||||
* Determines the motor ordering. This can be used for example in combination with
|
||||
* a 4-in-1 ESC that assumes a motor ordering which is different from PX4.
|
||||
*
|
||||
* ONLY supported for Quads.
|
||||
*
|
||||
* When changing this, make sure to test the motor response without props first.
|
||||
*
|
||||
* @value 0 PX4
|
||||
* @value 1 Betaflight / Cleanflight
|
||||
*
|
||||
* @group Mixer Output
|
||||
*/
|
||||
PARAM_DEFINE_INT32(MOT_ORDERING, 0);
|
||||
|
||||
Reference in New Issue
Block a user