Copter: implement suggested changes

This commit is contained in:
bnsgeyer 2024-05-13 12:16:57 -04:00 committed by Bill Geyer
parent c2e99dc50e
commit bbaf557457
2 changed files with 15 additions and 8 deletions

View File

@ -3,7 +3,7 @@
#include "Copter.h" #include "Copter.h"
#include <AP_Math/chirp.h> #include <AP_Math/chirp.h>
#include <AP_ExternalControl/AP_ExternalControl_config.h> // TODO why is this needed if Copter.h includes this #include <AP_ExternalControl/AP_ExternalControl_config.h> // TODO why is this needed if Copter.h includes this
#include <AP_Math/control.h>
class Parameters; class Parameters;
class ParametersG2; class ParametersG2;

View File

@ -1,4 +1,5 @@
#include "Copter.h" #include "Copter.h"
#include <AP_Math/control.h>
#if MODE_SYSTEMID_ENABLED == ENABLED #if MODE_SYSTEMID_ENABLED == ENABLED
@ -129,8 +130,7 @@ bool ModeSystemId::init(bool ignore_checks)
} }
Vector3f curr_pos; Vector3f curr_pos;
curr_pos = inertial_nav.get_position_neu_cm(); curr_pos = inertial_nav.get_position_neu_cm();
target_pos.x = curr_pos.x; target_pos = curr_pos.xy();
target_pos.y = curr_pos.y;
} }
att_bf_feedforward = attitude_control->get_bf_feedforward(); att_bf_feedforward = attitude_control->get_bf_feedforward();
@ -428,10 +428,17 @@ bool ModeSystemId::is_poscontrol_axis_type() const
{ {
bool ret = false; bool ret = false;
if ((AxisType)axis.get() == AxisType::DISTURB_POS_LAT || (AxisType)axis.get() == AxisType::DISTURB_POS_LONG switch ((AxisType)axis.get()) {
|| (AxisType)axis.get() == AxisType::DISTURB_VEL_LAT || (AxisType)axis.get() == AxisType::DISTURB_VEL_LONG case AxisType::DISTURB_POS_LAT:
|| (AxisType)axis.get() == AxisType::INPUT_LOITER_LAT || (AxisType)axis.get() == AxisType::INPUT_LOITER_LONG) { case AxisType::DISTURB_POS_LONG:
case AxisType::DISTURB_VEL_LAT:
case AxisType::DISTURB_VEL_LONG:
case AxisType::INPUT_LOITER_LAT:
case AxisType::INPUT_LOITER_LONG:
ret = true; ret = true;
break;
default:
break;
} }
return ret; return ret;