mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
[rotorcraft] by default always reset attitude stab on mode change again
To only reset (psi setpoint to current value, reset ref, reset integrators) the attitude stabilization if the previous mode was not using it, define NO_ATTITUDE_RESET_ON_MODE_CHANGE
This commit is contained in:
@@ -139,32 +139,35 @@ void guidance_h_mode_changed(uint8_t new_mode) {
|
||||
stabilization_attitude_reset_care_free_heading();
|
||||
case GUIDANCE_H_MODE_FORWARD:
|
||||
case GUIDANCE_H_MODE_ATTITUDE:
|
||||
#if NO_ATTITUDE_RESET_ON_MODE_CHANGE
|
||||
/* reset attitude stabilization if previous mode was not using it */
|
||||
if (guidance_h_mode == GUIDANCE_H_MODE_KILL ||
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RATE ||
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RC_DIRECT) {
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RC_DIRECT)
|
||||
#endif
|
||||
stabilization_attitude_enter();
|
||||
}
|
||||
break;
|
||||
|
||||
case GUIDANCE_H_MODE_HOVER:
|
||||
guidance_h_hover_enter();
|
||||
#if NO_ATTITUDE_RESET_ON_MODE_CHANGE
|
||||
/* reset attitude stabilization if previous mode was not using it */
|
||||
if (guidance_h_mode == GUIDANCE_H_MODE_KILL ||
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RATE ||
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RC_DIRECT) {
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RC_DIRECT)
|
||||
stabilization_attitude_enter();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case GUIDANCE_H_MODE_NAV:
|
||||
guidance_h_nav_enter();
|
||||
#if NO_ATTITUDE_RESET_ON_MODE_CHANGE
|
||||
/* reset attitude stabilization if previous mode was not using it */
|
||||
if (guidance_h_mode == GUIDANCE_H_MODE_KILL ||
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RATE ||
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RC_DIRECT) {
|
||||
guidance_h_mode == GUIDANCE_H_MODE_RC_DIRECT)
|
||||
stabilization_attitude_enter();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user