From 767333a02c85995148d7b5e76a1918363fc32ccb Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Fri, 17 Mar 2023 21:44:20 +0100 Subject: [PATCH] [fix] update generated rotorcraft autopilot for new guidance (#3012) --- conf/autopilot/rotorcraft_autopilot.xml | 21 +++++++++++-------- .../rotorcraft/guidance/guidance_v.c | 4 ++-- .../rotorcraft/guidance/guidance_v.h | 2 ++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/conf/autopilot/rotorcraft_autopilot.xml b/conf/autopilot/rotorcraft_autopilot.xml index 55b578f59b..361cdccb35 100644 --- a/conf/autopilot/rotorcraft_autopilot.xml +++ b/conf/autopilot/rotorcraft_autopilot.xml @@ -39,18 +39,19 @@ - - + + - - + + + - + @@ -112,7 +113,7 @@ - + @@ -152,13 +153,15 @@ - + - - + + + + diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c index 5f0d132b95..84ab62e827 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c @@ -199,7 +199,7 @@ static int32_t get_vertical_thrust_coeff(void) } -static void guidance_v_thrust_adapt(bool in_flight) +void guidance_v_thrust_adapt(bool in_flight) { guidance_v.thrust_coeff = get_vertical_thrust_coeff(); @@ -302,7 +302,7 @@ void guidance_v_set_ref(int32_t pos, int32_t speed, int32_t accel) } -static void guidance_v_update_ref(void) +void guidance_v_update_ref(void) { /* convert our reference to generic representation */ int64_t tmp = gv_z_ref >> (GV_Z_REF_FRAC - INT32_POS_FRAC); diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h index e6a843ef07..11c32674fb 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h @@ -111,6 +111,8 @@ extern void guidance_v_init(void); extern void guidance_v_read_rc(void); extern void guidance_v_mode_changed(uint8_t new_mode); extern void guidance_v_notify_in_flight(bool in_flight); +extern void guidance_v_thrust_adapt(bool in_flight); +extern void guidance_v_update_ref(void); extern void guidance_v_run(bool in_flight); extern void guidance_v_z_enter(void);