Browse Source

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
mission-4.1.18
Randy Mackay 12 years ago
parent
commit
9672742b42
  1. 2
      ArduCopter/Attitude.pde
  2. 2
      ArduCopter/config.h

2
ArduCopter/Attitude.pde

@ -762,7 +762,7 @@ static void get_look_at_yaw() @@ -762,7 +762,7 @@ static void get_look_at_yaw()
static void get_look_ahead_yaw(int16_t pilot_yaw)
{
// 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);
get_stabilize_yaw(wrap_360_cd(nav_yaw + pilot_yaw)); // Allow pilot to "skid" around corners up to 45 degrees
}else{

2
ArduCopter/config.h

@ -781,7 +781,7 @@ @@ -781,7 +781,7 @@
#endif
#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

Loading…
Cancel
Save