Browse Source

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
master
rmackay9 13 years ago
parent
commit
65050775e1
  1. 14
      ArduCopter/Attitude.pde
  2. 4
      ArduCopter/config.h

14
ArduCopter/Attitude.pde

@ -409,9 +409,23 @@ get_nav_yaw_offset(int yaw_input, int reset) @@ -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)

4
ArduCopter/config.h

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

Loading…
Cancel
Save