ArduCopter: respect yaw orientation on LAND
This commit is contained in:
parent
6939a9fa91
commit
c2811ea144
@ -541,6 +541,9 @@ void Copter::Mode::land_run_horizontal_control()
|
|||||||
|
|
||||||
// get pilot's desired yaw rate
|
// get pilot's desired yaw rate
|
||||||
target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in());
|
target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in());
|
||||||
|
if (!is_zero(target_yaw_rate)) {
|
||||||
|
auto_yaw.set_mode(AUTO_YAW_HOLD);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PRECISION_LANDING == ENABLED
|
#if PRECISION_LANDING == ENABLED
|
||||||
@ -590,9 +593,14 @@ void Copter::Mode::land_run_horizontal_control()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// call attitude controller
|
// call attitude controller
|
||||||
attitude_control->input_euler_angle_roll_pitch_euler_rate_yaw(nav_roll, nav_pitch, target_yaw_rate);
|
if (auto_yaw.mode() == AUTO_YAW_HOLD) {
|
||||||
|
// roll & pitch from waypoint controller, yaw rate from pilot
|
||||||
|
attitude_control->input_euler_angle_roll_pitch_euler_rate_yaw(nav_roll, nav_pitch, target_yaw_rate);
|
||||||
|
} else {
|
||||||
|
// roll, pitch from waypoint controller, yaw heading from auto_heading()
|
||||||
|
attitude_control->input_euler_angle_roll_pitch_yaw(nav_roll, nav_pitch, auto_yaw.yaw(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float Copter::Mode::throttle_hover() const
|
float Copter::Mode::throttle_hover() const
|
||||||
|
Loading…
Reference in New Issue
Block a user