Copter: init roll/pitch input filters
This commit is contained in:
parent
34b62fc078
commit
b259510095
@ -7,6 +7,9 @@
|
||||
// althold_init - initialise althold controller
|
||||
static bool althold_init(bool ignore_checks)
|
||||
{
|
||||
// initialise filters on roll/pitch input
|
||||
reset_roll_pitch_in_filters(g.rc_1.control_in, g.rc_2.control_in);
|
||||
|
||||
// initialise altitude target to stopping point
|
||||
pos_control.set_target_to_stopping_point_z();
|
||||
return true;
|
||||
|
@ -192,6 +192,9 @@ static bool autotune_init(bool ignore_checks)
|
||||
return false;
|
||||
}
|
||||
|
||||
// initialise filters on roll/pitch input
|
||||
reset_roll_pitch_in_filters(g.rc_1.control_in, g.rc_2.control_in);
|
||||
|
||||
// initialise altitude target to stopping point
|
||||
pos_control.set_target_to_stopping_point_z();
|
||||
return true;
|
||||
|
@ -12,6 +12,8 @@
|
||||
static bool drift_init(bool ignore_checks)
|
||||
{
|
||||
if (GPS_ok() || ignore_checks) {
|
||||
// initialise filters on roll/pitch input
|
||||
reset_roll_pitch_in_filters(g.rc_1.control_in, g.rc_2.control_in);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
|
@ -15,6 +15,10 @@ static bool land_init(bool ignore_checks)
|
||||
wp_nav.get_loiter_stopping_point_xy(stopping_point);
|
||||
wp_nav.set_loiter_target(stopping_point);
|
||||
}
|
||||
|
||||
// initialise filters on roll/pitch input
|
||||
reset_roll_pitch_in_filters(g.rc_1.control_in, g.rc_2.control_in);
|
||||
|
||||
// initialise altitude target to stopping point
|
||||
pos_control.set_target_to_stopping_point_z();
|
||||
return true;
|
||||
|
@ -9,6 +9,8 @@ static bool ofloiter_init(bool ignore_checks)
|
||||
{
|
||||
#if OPTFLOW == ENABLED
|
||||
if (g.optflow_enabled || ignore_checks) {
|
||||
// initialise filters on roll/pitch input
|
||||
reset_roll_pitch_in_filters(g.rc_1.control_in, g.rc_2.control_in);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
|
@ -7,6 +7,9 @@
|
||||
// stabilize_init - initialise stabilize controller
|
||||
static bool stabilize_init(bool ignore_checks)
|
||||
{
|
||||
// initialise filters on roll/pitch input
|
||||
reset_roll_pitch_in_filters(g.rc_1.control_in, g.rc_2.control_in);
|
||||
|
||||
// set target altitude to zero for reporting
|
||||
// To-Do: make pos controller aware when it's active/inactive so it can always report the altitude error?
|
||||
pos_control.set_alt_target(0);
|
||||
|
Loading…
Reference in New Issue
Block a user