Copter: bug fix to look_ahead_yaw

Fix received from David Dewey
Was incorrectly using the direction instead of heading when deciding
whether to point forward or not.  Reduced YAW_LOOK_AHEAD_MIN_SPEED to
1m/s because bug meant it was nearly always pointing forward and 10m/s
(the old value) seemed too high
This commit is contained in:
Randy Mackay 2013-08-01 14:12:55 +09:00
parent c30cfa21c5
commit 9672742b42
2 changed files with 2 additions and 2 deletions

View File

@ -762,7 +762,7 @@ static void get_look_at_yaw()
static void get_look_ahead_yaw(int16_t pilot_yaw) static void get_look_ahead_yaw(int16_t pilot_yaw)
{ {
// Commanded Yaw to automatically look ahead. // Commanded Yaw to automatically look ahead.
if (g_gps->fix && g_gps->ground_course_cd > YAW_LOOK_AHEAD_MIN_SPEED) { if (g_gps->fix && g_gps->ground_speed_cm > YAW_LOOK_AHEAD_MIN_SPEED) {
nav_yaw = get_yaw_slew(nav_yaw, g_gps->ground_course_cd, AUTO_YAW_SLEW_RATE); nav_yaw = get_yaw_slew(nav_yaw, g_gps->ground_course_cd, AUTO_YAW_SLEW_RATE);
get_stabilize_yaw(wrap_360_cd(nav_yaw + pilot_yaw)); // Allow pilot to "skid" around corners up to 45 degrees get_stabilize_yaw(wrap_360_cd(nav_yaw + pilot_yaw)); // Allow pilot to "skid" around corners up to 45 degrees
}else{ }else{

View File

@ -781,7 +781,7 @@
#endif #endif
#ifndef YAW_LOOK_AHEAD_MIN_SPEED #ifndef YAW_LOOK_AHEAD_MIN_SPEED
# define YAW_LOOK_AHEAD_MIN_SPEED 1000 // minimum ground speed in cm/s required before copter is aimed at ground course # define YAW_LOOK_AHEAD_MIN_SPEED 100 // minimum ground speed in cm/s required before copter is aimed at ground course
#endif #endif