mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
Copter: collective ramp for mode transitions
This commit is contained in:
committed by
Bill Geyer
parent
33d84666de
commit
eabf2aab5e
+1
-1
@@ -16,7 +16,7 @@ void Copter::heli_init()
|
||||
{
|
||||
// pre-load stab col values as mode is initialized as Stabilize, but stabilize_init() function is not run on start-up.
|
||||
input_manager.set_use_stab_col(true);
|
||||
input_manager.set_stab_col_ramp(1.0);
|
||||
input_manager.set_collective_ramp(0);
|
||||
}
|
||||
|
||||
// heli_check_dynamic_flight - updates the dynamic_flight flag based on our horizontal velocity
|
||||
|
||||
+6
-8
@@ -443,15 +443,13 @@ void Copter::exit_mode(Mode *&old_flightmode,
|
||||
motors->set_acro_tail(false);
|
||||
}
|
||||
|
||||
//last collective output
|
||||
input_manager.set_last_coll_output(motors->get_throttle());
|
||||
|
||||
// if we are changing from a mode that did not use manual throttle,
|
||||
// stab col ramp value should be pre-loaded to the correct value to avoid a twitch
|
||||
// heli_stab_col_ramp should really only be active switching between Stabilize and Acro modes
|
||||
if (!old_flightmode->has_manual_throttle()){
|
||||
if (new_flightmode == &mode_stabilize){
|
||||
input_manager.set_stab_col_ramp(1.0);
|
||||
} else if (new_flightmode == &mode_acro){
|
||||
input_manager.set_stab_col_ramp(0.0);
|
||||
}
|
||||
// collective ramp functions should be called to blend the transition
|
||||
if (new_flightmode->has_manual_throttle()) {
|
||||
input_manager.set_collective_ramp(1.0);
|
||||
}
|
||||
|
||||
// Make sure inverted flight is disabled if not supported in the new mode
|
||||
|
||||
Reference in New Issue
Block a user