1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-22 15:55:40 +03:00

Landing: configurable dive angle

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-05-31 13:54:57 +02:00
parent 2869d885f0
commit 280e1895af
4 changed files with 9 additions and 2 deletions

View file

@ -859,6 +859,10 @@ static const clivalue_t valueTable[] = {
{ "nav_fw_pitch2thr", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 100 }, PG_NAV_CONFIG, offsetof(navConfig_t, fw.pitch_to_throttle) },
{ "nav_fw_loiter_radius", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, 10000 }, PG_NAV_CONFIG, offsetof(navConfig_t, fw.loiter_radius) },
#ifdef FIXED_WING_LANDING
{ "nav_fw_land_dive_angle", VAR_INT8 | MASTER_VALUE, .config.minmax = { -20, 20 }, PG_NAV_CONFIG, offsetof(navConfig_t, fw.land_dive_angle) },
#endif
{ "nav_fw_launch_velocity", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 100, 10000 }, PG_NAV_CONFIG, offsetof(navConfig_t, fw.launch_velocity_thresh) },
{ "nav_fw_launch_accel", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 1000, 20000 }, PG_NAV_CONFIG, offsetof(navConfig_t, fw.launch_accel_thresh) },
{ "nav_fw_launch_max_angle", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 5, 180 }, PG_NAV_CONFIG, offsetof(navConfig_t, fw.launch_max_angle) },

View file

@ -118,6 +118,9 @@ PG_RESET_TEMPLATE(navConfig_t, navConfig,
.pitch_to_throttle = 10, // pwm units per degree of pitch (10pwm units ~ 1% throttle)
.loiter_radius = 5000, // 50m
//Fixed wing landing
.land_dive_angle = 2, // 2 degrees dive by default
// Fixed wing launch
.launch_velocity_thresh = 300, // 3 m/s
.launch_accel_thresh = 1.9f * 981, // cm/s/s (1.9*G)

View file

@ -142,7 +142,7 @@ typedef struct navConfig_s {
uint16_t max_throttle; // Maximum allowed throttle in auto mode
uint8_t pitch_to_throttle; // Pitch angle (in deg) to throttle gain (in 1/1000's of throttle) (*10)
uint16_t loiter_radius; // Loiter radius when executing PH on a fixed wing
int8_t land_dive_angle;
uint16_t launch_velocity_thresh; // Velocity threshold for swing launch detection
uint16_t launch_accel_thresh; // Acceleration threshold for launch detection (cm/s/s)
uint16_t launch_time_thresh; // Time threshold for launch detection (ms)

View file

@ -468,7 +468,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
* Stabilize PITCH angle into shallow dive (2 deg hardcoded ATM)
* PITCH angle is measured: >0 - dive, <0 - climb)
*/
rcCommand[PITCH] = pidAngleToRcCommand(DEGREES_TO_DECIDEGREES(2), pidProfile()->max_angle_inclination[FD_PITCH]);
rcCommand[PITCH] = pidAngleToRcCommand(DEGREES_TO_DECIDEGREES(navConfig()->fw.land_dive_angle), pidProfile()->max_angle_inclination[FD_PITCH]);
}
#endif
}