mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
autopilot naming, function sharing
This commit is contained in:
parent
53d44aa1b1
commit
aa9d3e3ffe
9 changed files with 20 additions and 5 deletions
|
@ -23,6 +23,7 @@ PG_SRC = \
|
|||
pg/msp.c \
|
||||
pg/pg.c \
|
||||
pg/piniobox.c \
|
||||
pg/autopilot.c \
|
||||
pg/pinio.c \
|
||||
pg/pin_pull_up_down.c \
|
||||
pg/rcdevice.c \
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
#include "flight/mixer.h"
|
||||
#include "flight/pid.h"
|
||||
#include "flight/position.h"
|
||||
#include "flight/autopilot.h"
|
||||
#include "flight/rpm_filter.h"
|
||||
#include "flight/servos.h"
|
||||
#include "flight/imu.h"
|
||||
|
|
|
@ -110,6 +110,7 @@ bool cliMode = false;
|
|||
#include "flight/mixer.h"
|
||||
#include "flight/pid.h"
|
||||
#include "flight/position.h"
|
||||
#include "flight/autopilot.h"
|
||||
#include "flight/servos.h"
|
||||
|
||||
#include "io/asyncfatfs/asyncfatfs.h"
|
||||
|
|
|
@ -64,6 +64,8 @@
|
|||
#include "flight/mixer.h"
|
||||
#include "flight/pid.h"
|
||||
#include "flight/position.h"
|
||||
#include "flight/autopilot.h"
|
||||
#include "flight/alt_hold.h"
|
||||
#include "flight/rpm_filter.h"
|
||||
#include "flight/servos.h"
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "flight/autopilot.h"
|
||||
#include "flight/gps_rescue.h"
|
||||
#include "flight/position.h"
|
||||
#include "flight/autopilot.h"
|
||||
|
||||
static uint16_t gpsRescueConfig_minStartDistM; //meters
|
||||
static uint8_t gpsRescueConfig_altitudeMode;
|
||||
|
@ -115,10 +116,10 @@ const OSD_Entry cms_menuGpsRescuePidEntries[] =
|
|||
{
|
||||
{"--- GPS RESCUE PID---", OME_Label, NULL, NULL},
|
||||
|
||||
{ "ALTITUDE P", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_P, 0, 200, 1 } },
|
||||
{ "ALTITUDE I", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_I, 0, 200, 1 } },
|
||||
{ "ALTITUDE D", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_D, 0, 200, 1 } },
|
||||
{ "ALTITUDE F", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_F, 0, 200, 1 } },
|
||||
{ "ALTITUDE P", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_P, 0, 255, 1 } },
|
||||
{ "ALTITUDE I", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_I, 0, 255, 1 } },
|
||||
{ "ALTITUDE D", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_D, 0, 255, 1 } },
|
||||
{ "ALTITUDE F", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &autopilotConfig_altitude_F, 0, 255, 1 } },
|
||||
|
||||
{ "YAW P", OME_UINT8 | REBOOT_REQUIRED, NULL, &(OSD_UINT8_t){ &gpsRescueConfig_yawP, 0, 200, 1 } },
|
||||
|
||||
|
|
|
@ -21,13 +21,16 @@
|
|||
#ifdef USE_ALT_HOLD_MODE
|
||||
|
||||
#include "build/debug.h"
|
||||
|
||||
#include "common/maths.h"
|
||||
#include "config/config.h"
|
||||
|
||||
#include "fc/rc.h"
|
||||
#include "fc/runtime_config.h"
|
||||
#include "flight/autopilot.h"
|
||||
#include "flight/failsafe.h"
|
||||
#include "flight/position.h"
|
||||
|
||||
#include "rx/rx.h"
|
||||
|
||||
#include "alt_hold.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "platform.h"
|
||||
#include "build/debug.h"
|
||||
#include "common/maths.h"
|
||||
|
||||
#include "flight/imu.h"
|
||||
#include "flight/pid.h"
|
||||
#include "flight/position.h"
|
||||
|
@ -48,6 +47,11 @@ void autopilotInit(const autopilotConfig_t *config)
|
|||
altitudePidCoeffs.Kf = config->altitude_F * ALTITUDE_F_SCALE;
|
||||
}
|
||||
|
||||
const pidCoefficient_t *getAltitudePidCoeffs(void)
|
||||
{
|
||||
return &altitudePidCoeffs;
|
||||
}
|
||||
|
||||
void resetAltitudeControl (void) {
|
||||
altitudeI = 0.0f;
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "flight/mixer_init.h"
|
||||
#include "flight/mixer_tricopter.h"
|
||||
#include "flight/pid.h"
|
||||
#include "flight/autopilot.h"
|
||||
#include "flight/rpm_filter.h"
|
||||
|
||||
#include "io/gps.h"
|
||||
|
|
|
@ -478,6 +478,7 @@ althold_unittest_SRC := \
|
|||
$(USER_DIR)/flight/alt_hold.c \
|
||||
$(USER_DIR)/flight/autopilot.c \
|
||||
$(USER_DIR)/common/maths.c \
|
||||
$(USER_DIR)/flight/autopilot.c \
|
||||
$(USER_DIR)/pg/rx.c
|
||||
|
||||
althold_unittest_DEFINES := \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue