ArduCopter: made Robert's new yaw method optional (off by default).

Add this line to APM_Config.h to enable Robert's yaw
#define ALTERNATIVE_YAW_MODE ENABLED
This commit is contained in:
rmackay9 2012-06-13 21:50:16 +09:00
parent 9355a159fc
commit 65050775e1
2 changed files with 18 additions and 0 deletions

View File

@ -409,9 +409,23 @@ get_nav_yaw_offset(int yaw_input, int reset)
return ahrs.yaw_sensor;
}else{
#if ALTERNATIVE_YAW_MODE == ENABLED
_yaw = nav_yaw + (yaw_input / 50);
return wrap_360(_yaw);
#else
// re-define nav_yaw if we have stick input
if(yaw_input != 0){
// set nav_yaw + or - the current location
_yaw = yaw_input + ahrs.yaw_sensor;
// we need to wrap our value so we can be 0 to 360 (*100)
return wrap_360(_yaw);
}else{
// no stick input, lets not change nav_yaw
return nav_yaw;
}
#endif
}
}
static int16_t get_angle_boost(int16_t value)

View File

@ -989,4 +989,8 @@
# define RETRO_LOITER_MODE DISABLED
#endif
#ifndef ALTERNATIVE_YAW_MODE
# define ALTERNATIVE_YAW_MODE DISABLED
#endif
#endif // __ARDUCOPTER_CONFIG_H__