1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

Merge remote-tracking branch 'origin/master' into dzikuvx-drop-MSP_PID_ADVANCED

This commit is contained in:
Pawel Spychalski (DzikuVx) 2024-04-09 16:23:56 +02:00
commit a9b9a5c736
5 changed files with 32 additions and 92 deletions

View file

@ -54,7 +54,7 @@ This means that practically 4 landing directions can be saved.
> [!CAUTION]
> The Configuator automatically determines the ground altitude based on databases on the Internet, which may be inaccurate. Please always compare with the measured GPS altitude at the landing site to avoid crashes.
### Global paramters
### Global parameters
All settings are available via “Advanced Tuning” in the Configurator.
@ -104,7 +104,7 @@ If the altitude of the waypoint and the "Approach Altitude" are different, the a
## Logic Conditions
The current landing state can be retrieved via ID 41 in "Flight" (FW Land State). This allows additional actions to be executed according to the landing phases, e.g. deplyoment of the landing flaps.
The current landing state can be retrieved via ID 41 in "Flight" (FW Land State). This allows additional actions to be executed according to the landing phases, e.g. deployment of the landing flaps.
| Returned value | State |
| --- | --- |

View file

@ -140,18 +140,6 @@ static const char * const boardIdentifier = TARGET_BOARD_IDENTIFIER;
// from mixer.c
extern int16_t motor_disarmed[MAX_SUPPORTED_MOTORS];
static const char pidnames[] =
"ROLL;"
"PITCH;"
"YAW;"
"ALT;"
"Pos;"
"PosR;"
"NavR;"
"LEVEL;"
"MAG;"
"VEL;";
typedef enum {
MSP_SDCARD_STATE_NOT_PRESENT = 0,
MSP_SDCARD_STATE_FATAL = 1,
@ -708,12 +696,6 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
#endif
break;
case MSP_PIDNAMES:
for (const char *c = pidnames; *c; c++) {
sbufWriteU8(dst, *c);
}
break;
case MSP_MODE_RANGES:
for (int i = 0; i < MAX_MODE_ACTIVATION_CONDITION_COUNT; i++) {
const modeActivationCondition_t *mac = modeActivationConditions(i);
@ -1218,24 +1200,6 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
sbufWriteU8(dst, 0);
break;
case MSP_FILTER_CONFIG :
sbufWriteU8(dst, gyroConfig()->gyro_main_lpf_hz);
sbufWriteU16(dst, pidProfile()->dterm_lpf_hz);
sbufWriteU16(dst, pidProfile()->yaw_lpf_hz);
sbufWriteU16(dst, 0); //Was gyroConfig()->gyro_notch_hz
sbufWriteU16(dst, 1); //Was gyroConfig()->gyro_notch_cutoff
sbufWriteU16(dst, 0); //BF: pidProfile()->dterm_notch_hz
sbufWriteU16(dst, 1); //pidProfile()->dterm_notch_cutoff
sbufWriteU16(dst, 0); //BF: masterConfig.gyro_soft_notch_hz_2
sbufWriteU16(dst, 1); //BF: masterConfig.gyro_soft_notch_cutoff_2
sbufWriteU16(dst, accelerometerConfig()->acc_notch_hz);
sbufWriteU16(dst, accelerometerConfig()->acc_notch_cutoff);
sbufWriteU16(dst, 0); //Was gyroConfig()->gyro_stage2_lowpass_hz
break;
case MSP_INAV_PID:
sbufWriteU8(dst, 0); //Legacy, no longer in use async processing value
sbufWriteU16(dst, 0); //Legacy, no longer in use async processing value
@ -2181,47 +2145,6 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
return MSP_RESULT_ERROR;
break;
case MSP_SET_FILTER_CONFIG :
if (dataSize >= 5) {
gyroConfigMutable()->gyro_main_lpf_hz = sbufReadU8(src);
pidProfileMutable()->dterm_lpf_hz = constrain(sbufReadU16(src), 0, 500);
pidProfileMutable()->yaw_lpf_hz = constrain(sbufReadU16(src), 0, 255);
if (dataSize >= 9) {
sbufReadU16(src); //Was gyroConfigMutable()->gyro_notch_hz
sbufReadU16(src); //Was gyroConfigMutable()->gyro_notch_cutoff
} else {
return MSP_RESULT_ERROR;
}
if (dataSize >= 13) {
sbufReadU16(src);
sbufReadU16(src);
pidInitFilters();
} else {
return MSP_RESULT_ERROR;
}
if (dataSize >= 17) {
sbufReadU16(src); // Was gyroConfigMutable()->gyro_soft_notch_hz_2
sbufReadU16(src); // Was gyroConfigMutable()->gyro_soft_notch_cutoff_2
} else {
return MSP_RESULT_ERROR;
}
if (dataSize >= 21) {
accelerometerConfigMutable()->acc_notch_hz = constrain(sbufReadU16(src), 0, 255);
accelerometerConfigMutable()->acc_notch_cutoff = constrain(sbufReadU16(src), 1, 255);
} else {
return MSP_RESULT_ERROR;
}
if (dataSize >= 22) {
sbufReadU16(src); //Was gyro_stage2_lowpass_hz
} else {
return MSP_RESULT_ERROR;
}
} else
return MSP_RESULT_ERROR;
break;
case MSP_SET_INAV_PID:
if (dataSize == 15) {
sbufReadU8(src); //Legacy, no longer in use async processing value

View file

@ -213,7 +213,7 @@ void initActiveBoxIds(void)
ADD_ACTIVE_BOX(BOXFPVANGLEMIX);
}
bool navReadyAltControl = sensors(SENSOR_BARO);
bool navReadyAltControl = getHwBarometerStatus() != HW_SENSOR_NONE;
#ifdef USE_GPS
navReadyAltControl = navReadyAltControl || (feature(FEATURE_GPS) && (STATE(AIRPLANE) || positionEstimationConfig()->use_gps_no_baro));

View file

@ -196,9 +196,6 @@
#define MSP_ADVANCED_CONFIG 90
#define MSP_SET_ADVANCED_CONFIG 91
#define MSP_FILTER_CONFIG 92
#define MSP_SET_FILTER_CONFIG 93
#define MSP_SENSOR_CONFIG 96
#define MSP_SET_SENSOR_CONFIG 97
@ -238,7 +235,6 @@
#define MSP_MISC 114 //out message powermeter trig
#define MSP_MOTOR_PINS 115 //out message which pins are in use for motors & servos, for GUI
#define MSP_BOXNAMES 116 //out message the aux switch names
#define MSP_PIDNAMES 117 //out message the PID names
#define MSP_WP 118 //out message get a WP, WP# is in the payload, returns (WP#, lat, lon, alt, flags) WP#0-home, WP#16-poshold
#define MSP_BOXIDS 119 //out message get the permanent IDs associated to BOXes
#define MSP_NAV_STATUS 121 //out message Returns navigation status

View file

@ -91,7 +91,10 @@
#if !defined(BMP085_I2C_BUS)
#define BMP085_I2C_BUS BARO_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_bmp085, DEVHW_BMP085, BMP085_I2C_BUS, 0x77, NONE, DEVFLAGS_NONE, 0);
#if !defined(BMP085_I2C_ADDR)
#define BMP085_I2C_ADDR (0x77)
#endif
BUSDEV_REGISTER_I2C(busdev_bmp085, DEVHW_BMP085, BMP085_I2C_BUS, BMP085_I2C_ADDR, NONE, DEVFLAGS_NONE, 0);
#endif
#if defined(USE_BARO_BMP280)
@ -115,7 +118,10 @@
#if !defined(BMP388_I2C_BUS)
#define BMP388_I2C_BUS BARO_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_bmp388, DEVHW_BMP388, BMP388_I2C_BUS, 0x76, NONE, DEVFLAGS_NONE, 0);
#if !defined(BMP388_I2C_ADDR)
#define BMP388_I2C_ADDR (0x76)
#endif
BUSDEV_REGISTER_I2C(busdev_bmp388, DEVHW_BMP388, BMP388_I2C_BUS, BMP388_I2C_ADDR, NONE, DEVFLAGS_NONE, 0);
#endif
#endif
@ -126,7 +132,10 @@
#if !defined(SPL06_I2C_BUS)
#define SPL06_I2C_BUS BARO_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_spl06, DEVHW_SPL06, SPL06_I2C_BUS, 0x76, NONE, DEVFLAGS_NONE, 0);
#if !defined(SPL06_I2C_ADDR)
#define SPL06_I2C_ADDR (0x76)
#endif
BUSDEV_REGISTER_I2C(busdev_spl06, DEVHW_SPL06, SPL06_I2C_BUS, SPL06_I2C_ADDR, NONE, DEVFLAGS_NONE, 0);
#endif
#endif
@ -140,7 +149,10 @@
#if !defined(MS5607_I2C_BUS)
#define MS5607_I2C_BUS BARO_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_ms5607, DEVHW_MS5607, MS5607_I2C_BUS, 0x77, NONE, DEVFLAGS_USE_RAW_REGISTERS, 0);
#if !defined(MS5607_I2C_ADDR)
#define MS5607_I2C_ADDR (0x77)
#endif
BUSDEV_REGISTER_I2C(busdev_ms5607, DEVHW_MS5607, MS5607_I2C_BUS, MS5607_I2C_ADDR, NONE, DEVFLAGS_USE_RAW_REGISTERS, 0);
#endif
#if defined(USE_BARO_MS5611)
@ -150,7 +162,10 @@
#if !defined(MS5611_I2C_BUS)
#define MS5611_I2C_BUS BARO_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_ms5611, DEVHW_MS5611, MS5611_I2C_BUS, 0x77, NONE, DEVFLAGS_USE_RAW_REGISTERS, 0);
#if !defined(MS5611_I2C_ADDR)
#define MS5611_I2C_ADDR (0x77)
#endif
BUSDEV_REGISTER_I2C(busdev_ms5611, DEVHW_MS5611, MS5611_I2C_BUS, MS5611_I2C_ADDR, NONE, DEVFLAGS_USE_RAW_REGISTERS, 0);
#endif
#endif
@ -161,7 +176,10 @@
#if !defined(DPS310_I2C_BUS)
#define DPS310_I2C_BUS BARO_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_dps310, DEVHW_DPS310, DPS310_I2C_BUS, 0x76, NONE, DEVFLAGS_NONE, 0);
#if !defined(DPS310_I2C_ADDR)
#define DPS310_I2C_ADDR (0x76)
#endif
BUSDEV_REGISTER_I2C(busdev_dps310, DEVHW_DPS310, DPS310_I2C_BUS, DPS310_I2C_ADDR, NONE, DEVFLAGS_NONE, 0);
#endif
#endif
@ -172,7 +190,10 @@
#if !defined(B2SMPB_I2C_BUS)
#define B2SMPB_I2C_BUS BARO_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_b2smpb, DEVHW_B2SMPB, B2SMPB_I2C_BUS, 0x70, NONE, DEVFLAGS_NONE, 0);
#if !defined(B2SMPB_I2C_ADDR)
#define B2SMPB_I2C_ADDR (0x70)
#endif
BUSDEV_REGISTER_I2C(busdev_b2smpb, DEVHW_B2SMPB, B2SMPB_I2C_BUS, B2SMPB_I2C_ADDR, NONE, DEVFLAGS_NONE, 0);
#endif
#endif