Skip to content

Commit d753835

Browse files
Merge pull request #6304 from iNavFlight/revert-6299-revert-5988-dragnea_autolaunch_refactor
Unrevert "Autolaunch - Added a smooth end launch feature and code refactor"
2 parents 2543427 + c1c5ed1 commit d753835

File tree

7 files changed

+354
-148
lines changed

7 files changed

+354
-148
lines changed

docs/Cli.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,4 @@ For targets that have a flash data chip, typically used for blackbox logs, the f
147147
| `flash_write <address> <data>` | Writes `data` to `address` |
148148

149149
## CLI Variable Reference
150-
151150
See [Settings.md](Settings.md).

src/main/cms/cms_menu_navigation.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static const OSD_Entry cmsx_menuFWLaunchEntries[] =
134134
OSD_SETTING_ENTRY("IDLE THROTTLE", SETTING_NAV_FW_LAUNCH_IDLE_THR),
135135
OSD_SETTING_ENTRY("MOTOR SPINUP TIME", SETTING_NAV_FW_LAUNCH_SPINUP_TIME),
136136
OSD_SETTING_ENTRY("TIMEOUT", SETTING_NAV_FW_LAUNCH_TIMEOUT),
137+
OSD_SETTING_ENTRY("END TRANSITION TIME", SETTING_NAV_FW_LAUNCH_END_TIME),
137138
OSD_SETTING_ENTRY("MAX ALTITUDE", SETTING_NAV_FW_LAUNCH_MAX_ALTITUDE),
138139
OSD_SETTING_ENTRY("CLIMB ANGLE", SETTING_NAV_FW_LAUNCH_CLIMB_ANGLE),
139140
OSD_SETTING_ENTRY("MAX BANK ANGLE", SETTING_NAV_FW_LAUNCH_MAX_ANGLE),

src/main/fc/settings.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,6 +2371,12 @@ groups:
23712371
field: fw.launch_motor_spinup_time
23722372
min: 0
23732373
max: 1000
2374+
- name: nav_fw_launch_end_time
2375+
description: "Time for the transition of throttle and pitch angle, between the launch state and the subsequent flight mode [ms]"
2376+
default_value: "2000"
2377+
field: fw.launch_end_time
2378+
min: 0
2379+
max: 5000
23742380
- name: nav_fw_launch_min_time
23752381
description: "Allow launch mode to execute at least this time (ms) and ignore stick movements [0-60000]."
23762382
default_value: "0"

src/main/io/osd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,6 +3327,10 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
33273327
}
33283328
} else if (STATE(FIXED_WING_LEGACY) && (navGetCurrentStateFlags() & NAV_CTL_LAUNCH)) {
33293329
messages[messageCount++] = OSD_MESSAGE_STR(OSD_MSG_AUTOLAUNCH);
3330+
const char *launchStateMessage = fixedWingLaunchStateMessage();
3331+
if (launchStateMessage) {
3332+
messages[messageCount++] = launchStateMessage;
3333+
}
33303334
} else {
33313335
if (FLIGHT_MODE(NAV_ALTHOLD_MODE) && !navigationRequiresAngleMode()) {
33323336
// ALTHOLD might be enabled alongside ANGLE/HORIZON/ACRO

src/main/navigation/navigation.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ PG_RESET_TEMPLATE(navConfig_t, navConfig,
171171
.launch_idle_throttle = 1000, // Motor idle or MOTOR_STOP
172172
.launch_motor_timer = 500, // ms
173173
.launch_motor_spinup_time = 100, // ms, time to gredually increase throttle from idle to launch
174+
.launch_end_time = 3000, // ms, time to gradually decrease/increase throttle and decrease pitch angle from launch to the current flight mode
174175
.launch_min_time = 0, // ms, min time in launch mode
175176
.launch_timeout = 5000, // ms, timeout for launch procedure
176177
.launch_max_altitude = 0, // cm, altitude where to consider launch ended

src/main/navigation/navigation.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ typedef struct navConfig_s {
239239
uint16_t launch_throttle; // Launch throttle
240240
uint16_t launch_motor_timer; // Time to wait before setting launch_throttle (ms)
241241
uint16_t launch_motor_spinup_time; // Time to speed-up motors from idle to launch_throttle (ESC desync prevention)
242-
uint16_t launch_min_time; // Minimum time in launch mode to prevent possible bump of the sticks from leaving launch mode early
242+
uint16_t launch_end_time; // Time to make the transition from launch angle to leveled and throttle transition from launch throttle to the stick position
243+
uint16_t launch_min_time; // Minimum time in launch mode to prevent possible bump of the sticks from leaving launch mode early
243244
uint16_t launch_timeout; // Launch timeout to disable launch mode and swith to normal flight (ms)
244245
uint16_t launch_max_altitude; // cm, altitude where to consider launch ended
245246
uint8_t launch_climb_angle; // Target climb angle for launch (deg)
@@ -524,6 +525,7 @@ bool navigationRTHAllowsLanding(void);
524525
bool isNavLaunchEnabled(void);
525526
bool isFixedWingLaunchDetected(void);
526527
bool isFixedWingLaunchFinishedOrAborted(void);
528+
const char * fixedWingLaunchStateMessage(void);
527529

528530
float calculateAverageSpeed(void);
529531

0 commit comments

Comments
 (0)