Skip to content
Snippets Groups Projects
Commit 3618ac62 authored by rmackay9's avatar rmackay9
Browse files

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
parent c22462bf
No related branches found
No related tags found
No related merge requests found
...@@ -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; return ahrs.yaw_sensor;
}else{ }else{
#if ALTERNATIVE_YAW_MODE == ENABLED
_yaw = nav_yaw + (yaw_input / 50); _yaw = nav_yaw + (yaw_input / 50);
return wrap_360(_yaw); 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) static int16_t get_angle_boost(int16_t value)
......
...@@ -989,4 +989,8 @@ ...@@ -989,4 +989,8 @@
# define RETRO_LOITER_MODE DISABLED # define RETRO_LOITER_MODE DISABLED
#endif #endif
#ifndef ALTERNATIVE_YAW_MODE
# define ALTERNATIVE_YAW_MODE DISABLED
#endif
#endif // __ARDUCOPTER_CONFIG_H__ #endif // __ARDUCOPTER_CONFIG_H__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment