mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 09:58:23 +08:00
fix setting ref speed if not using ref model
This commit is contained in:
@@ -360,9 +360,18 @@ static void guidance_h_update_reference(void)
|
||||
guidance_h.ref.accel.x = ACCEL_BFP_OF_REAL(gh_ref.accel.x);
|
||||
guidance_h.ref.accel.y = ACCEL_BFP_OF_REAL(gh_ref.accel.y);
|
||||
} else {
|
||||
VECT2_COPY(guidance_h.ref.pos, guidance_h.sp.pos);
|
||||
INT_VECT2_ZERO(guidance_h.ref.speed);
|
||||
INT_VECT2_ZERO(guidance_h.ref.accel);
|
||||
if (nav.setpoint_mode == NAV_SETPOINT_MODE_POS) {
|
||||
VECT2_COPY(guidance_h.ref.pos, guidance_h.sp.pos);
|
||||
INT_VECT2_ZERO(guidance_h.ref.speed);
|
||||
INT_VECT2_ZERO(guidance_h.ref.accel);
|
||||
} else { //(nav.setpoint_mode == NAV_SETPOINT_MODE_SPEED)
|
||||
guidance_h.ref.pos.x = stateGetPositionNed_i()->x;
|
||||
guidance_h.ref.pos.y = stateGetPositionNed_i()->y;
|
||||
guidance_h.ref.speed.x = guidance_h.sp.speed.x;
|
||||
guidance_h.ref.speed.y = guidance_h.sp.speed.y;
|
||||
guidance_h.ref.accel.x = 0;
|
||||
guidance_h.ref.accel.y = 0;
|
||||
} // TODO: make accel ref set
|
||||
}
|
||||
|
||||
#if GUIDANCE_H_USE_SPEED_REF
|
||||
|
||||
Reference in New Issue
Block a user