Fix collection errors from ci (#3296)

* [chibios] remove unecessary option that makes a warning on H7

see ChibiOS forum: http://forum.chibios.org/viewtopic.php?t=5830

* [guidance] fix hybrid guidance

after merging #3248

* [natnet] remove call to function that doesn't exist

issue were only on verbose mode

* [conf] remove bebop_flip aiframe file

The FLIP mode is not supported anymore, better remove this example.
If flip is really needed, it should be implemented as a custom mode in
generated autopilot.
This commit is contained in:
Gautier Hattenberger
2024-06-11 14:26:53 +02:00
committed by GitHub
parent 18fa11d99d
commit 167b1768e5
6 changed files with 21 additions and 267 deletions
-221
View File
@@ -1,221 +0,0 @@
<!DOCTYPE airframe SYSTEM "../airframe.dtd">
<airframe name="bebop_indi">
<description>Bebop, Makes Loopings
</description>
<firmware name="rotorcraft">
<target name="ap" board="bebop"/>
<target name="nps" board="pc">
<module name="fdm" type="jsbsim"/>
</target>
<!--define name="USE_SONAR" value="TRUE"/-->
<!-- Subsystem section -->
<module name="telemetry" type="transparent_udp"/>
<module name="radio_control" type="datalink"/>
<module name="motor_mixing"/>
<module name="actuators" type="bebop"/>
<module name="imu" type="bebop"/>
<module name="gps" type="furuno"/>
<module name="stabilization" type="indi_simple"/>
<module name="ahrs" type="float_mlkf"/>
<module name="ahrs" type="int_cmpl_quat">
<define name="AHRS_USE_GPS_HEADING" value="FALSE"/>
<configure name="SECONDARY_AHRS" value="int_cmpl_quat"/>
</module>
<module name="ins" type="extended"/>
<module name="geo_mag"/>
<module name="air_data"/>
<module name="logger_file">
<define name="LOGGER_FILE_PATH" value="/data/ftp/internal_000"/>
</module>
</firmware>
<commands>
<axis name="PITCH" failsafe_value="0"/>
<axis name="ROLL" failsafe_value="0"/>
<axis name="YAW" failsafe_value="0"/>
<axis name="THRUST" failsafe_value="6000"/>
</commands>
<section name="gyro_scaling">
<define name="BEBOP_GYRO_RANGE" value="MPU60X0_GYRO_RANGE_2000"/>
<define name="IMU_GYRO_P_SENS" value="4.359"/>
<define name="IMU_GYRO_Q_SENS" value="4.359"/>
<define name="IMU_GYRO_R_SENS" value="4.359"/>
<define name="IMU_GYRO_P_SENS_NUM" value="4359"/>
<define name="IMU_GYRO_Q_SENS_NUM" value="4359"/>
<define name="IMU_GYRO_R_SENS_NUM" value="4359"/>
<define name="IMU_GYRO_P_SENS_DEN" value="1000"/>
<define name="IMU_GYRO_Q_SENS_DEN" value="1000"/>
<define name="IMU_GYRO_R_SENS_DEN" value="1000"/>
</section>
<servos driver="Default">
<servo name="TOP_RIGHT" no="0" min="3000" neutral="3000" max="12000"/>
<servo name="TOP_LEFT" no="1" min="3000" neutral="3000" max="12000"/>
<servo name="BOTTOM_LEFT" no="2" min="3000" neutral="3000" max="12000"/>
<servo name="BOTTOM_RIGHT" no="3" min="3000" neutral="3000" max="12000"/>
</servos>
<section name="MIXING" prefix="MOTOR_MIXING_">
<define name="TRIM_ROLL" value="0"/>
<define name="TRIM_PITCH" value="0"/>
<define name="TRIM_YAW" value="0"/>
<define name="TYPE" value="QUAD_X"/>
</section>
<command_laws>
<call fun="motor_mixing_run(autopilot_get_motors_on(),FALSE,values)"/>
<set servo="TOP_LEFT" value="motor_mixing.commands[MOTOR_FRONT_LEFT]"/>
<set servo="TOP_RIGHT" value="motor_mixing.commands[MOTOR_FRONT_RIGHT]"/>
<set servo="BOTTOM_RIGHT" value="motor_mixing.commands[MOTOR_BACK_RIGHT]"/>
<set servo="BOTTOM_LEFT" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
</command_laws>
<section name="AIR_DATA" prefix="AIR_DATA_">
<define name="CALC_AIRSPEED" value="FALSE"/>
<define name="CALC_TAS_FACTOR" value="FALSE"/>
<define name="CALC_AMSL_BARO" value="TRUE"/>
</section>
<section name="IMU" prefix="IMU_">
<!-- Magneto calibration -->
<define name="MAG_X_NEUTRAL" value="18"/>
<define name="MAG_Y_NEUTRAL" value="157"/>
<define name="MAG_Z_NEUTRAL" value="49"/>
<define name="MAG_X_SENS" value="10.5007722373" integer="16"/>
<define name="MAG_Y_SENS" value="11.1147400462" integer="16"/>
<define name="MAG_Z_SENS" value="11.6479371722" integer="16"/>
<!-- Magneto current calibration -->
<define name="MAG_X_CURRENT_COEF" value="0.0"/>
<define name="MAG_Y_CURRENT_COEF" value="0.0"/>
<define name="MAG_Z_CURRENT_COEF" value="0.0"/>
<define name="BODY_TO_IMU_PHI" value="0." unit="deg"/>
<define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
<define name="BODY_TO_IMU_PSI" value="0." unit="deg"/>
</section>
<!-- local magnetic field -->
<!-- http://wiki.paparazziuav.org/wiki/Subsystem/ahrs#Local_Magnetic_Field -->
<section name="AHRS" prefix="AHRS_">
<!-- values used if no GPS fix, on 3D fix is update by geo_mag module -->
<!-- Toulouse -->
<!--define name="H_X" value="0.513081"/>
<define name="H_Y" value="-0.00242783"/>
<define name="H_Z" value="0.858336"/-->
<!-- Delft -->
<define name="H_X" value="0.3892503"/>
<define name="H_Y" value="0.0017972"/>
<define name="H_Z" value="0.9211303"/>
<!-- For vibrating airfames -->
<define name="GRAVITY_HEURISTIC_FACTOR" value="0"/>
</section>
<section name="INS" prefix="INS_">
<define name="SONAR_MAX_RANGE" value="2.2"/>
</section>
<section name="RC_SETPOINT" prefix="STABILIZATION_ATTITUDE_">
<!-- setpoint limits for attitude stabilization rc flight -->
<define name="SP_MAX_PHI" value="45" unit="deg"/>
<define name="SP_MAX_THETA" value="45" unit="deg"/>
<define name="SP_MAX_R" value="300" unit="deg/s"/>
<define name="DEADBAND_A" value="0"/>
<define name="DEADBAND_E" value="0"/>
<define name="DEADBAND_R" value="50"/>
</section>
<section name="ATTITUDE_REFERENCE" prefix="STABILIZATION_ATTITUDE_">
<!-- attitude reference generation model -->
<define name="REF_OMEGA_P" value="450" unit="deg/s"/>
<define name="REF_ZETA_P" value="0.9"/>
<define name="REF_MAX_P" value="600." unit="deg/s"/>
<define name="REF_MAX_PDOT" value="RadOfDeg(8000.)"/>
<define name="REF_OMEGA_Q" value="450" unit="deg/s"/>
<define name="REF_ZETA_Q" value="0.9"/>
<define name="REF_MAX_Q" value="600." unit="deg/s"/>
<define name="REF_MAX_QDOT" value="RadOfDeg(8000.)"/>
<define name="REF_OMEGA_R" value="450" unit="deg/s"/>
<define name="REF_ZETA_R" value="0.9"/>
<define name="REF_MAX_R" value="600." unit="deg/s"/>
<define name="REF_MAX_RDOT" value="RadOfDeg(8000.)"/>
</section>
<section name="STABILIZATION_ATTITUDE_INDI" prefix="STABILIZATION_INDI_">
<!-- control effectiveness -->
<define name="G1_P" value="0.0639"/>
<define name="G1_Q" value="0.0361"/>
<define name="G1_R" value="0.0022"/>
<define name="G2_R" value="0.1450"/>
<!-- reference acceleration for attitude control -->
<define name="REF_ERR_P" value="600.0"/>
<define name="REF_ERR_Q" value="600.0"/>
<define name="REF_ERR_R" value="600.0"/>
<define name="REF_RATE_P" value="28.0"/>
<define name="REF_RATE_Q" value="28.0"/>
<define name="REF_RATE_R" value="28.0"/>
<!-- second order filter parameters -->
<define name="FILT_CUTOFF" value="8.0"/>
<!-- first order actuator dynamics -->
<define name="ACT_FREQ_P" value="53.9"/>
<define name="ACT_FREQ_Q" value="53.9"/>
<define name="ACT_FREQ_R" value="53.9"/>
<!-- Adaptive Learning Rate -->
<define name="USE_ADAPTIVE" value="FALSE"/>
<define name="ADAPTIVE_MU" value="0.0001"/>
</section>
<section name="GUIDANCE_V" prefix="GUIDANCE_V_">
<define name="HOVER_KP" value="283"/>
<define name="HOVER_KD" value="82"/>
<define name="HOVER_KI" value="13"/>
<define name="NOMINAL_HOVER_THROTTLE" value="0.655"/>
<define name="ADAPT_THROTTLE_ENABLED" value="TRUE"/>
</section>
<section name="GUIDANCE_H" prefix="GUIDANCE_H_">
<!-- Good weather -->
<define name="MAX_BANK" value="20" unit="deg"/>
<!-- Bad weather -->
<!-- define name="MAX_BANK" value="32" unit="deg"/ -->
<define name="PGAIN" value="79"/>
<define name="DGAIN" value="100"/>
<define name="IGAIN" value="30"/>
</section>
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_NAMES" value="nw_motor, ne_motor, se_motor, sw_motor" type="string[]"/>
<define name="JSBSIM_MODEL" value="simple_x_quad_ccw" type="string"/>
</section>
<section name="AUTOPILOT">
<define name="MODE_STARTUP" value="AP_MODE_NAV"/>
<define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
<define name="MODE_AUTO1" value="AP_MODE_FLIP"/>
<define name="MODE_AUTO2" value="AP_MODE_FLIP"/>
</section>
<section name="BAT">
<define name="MILLIAMP_AT_FULL_THROTTLE" value="8700"/>
<define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
<define name="CRITIC_BAT_LEVEL" value="9.6" unit="V"/>
<define name="LOW_BAT_LEVEL" value="9.7" unit="V"/>
<define name="MAX_BAT_LEVEL" value="12.4" unit="V"/>
</section>
</airframe>
+2 -2
View File
@@ -118,8 +118,8 @@ MCFLAGS = -mcpu=$(MCU)
ODFLAGS = -x --syms ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS) ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS) ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS) CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) $(DEFS)
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS) $(UPDEFS) CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) $(DEFS) $(UPDEFS)
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(OBJDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(RULESPATH)/ld,--script=$(LDSCRIPT)$(LDOPT) LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(OBJDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(RULESPATH)/ld,--script=$(LDSCRIPT)$(LDOPT)
# Thumb interwork enabled only if needed because it kills performance. # Thumb interwork enabled only if needed because it kills performance.
-11
View File
@@ -472,17 +472,6 @@
settings_modules="modules/ahrs_int_cmpl_quat.xml modules/bebop_cam.xml modules/cv_opticflow.xml modules/electrical.xml modules/gps.xml modules/guidance_pid_rotorcraft.xml modules/guidance_rotorcraft.xml modules/imu_common.xml modules/nav_rotorcraft.xml modules/optical_flow_hover.xml modules/stabilization_indi_simple.xml" settings_modules="modules/ahrs_int_cmpl_quat.xml modules/bebop_cam.xml modules/cv_opticflow.xml modules/electrical.xml modules/gps.xml modules/guidance_pid_rotorcraft.xml modules/guidance_rotorcraft.xml modules/imu_common.xml modules/nav_rotorcraft.xml modules/optical_flow_hover.xml modules/stabilization_indi_simple.xml"
gui_color="red" gui_color="red"
/> />
<aircraft
name="bebop_flip"
ac_id="3"
airframe="airframes/tudelft/bebop_flip.xml"
radio="radios/cockpitSX.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/dummy.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/ahrs_float_mlkf.xml modules/ahrs_int_cmpl_quat.xml modules/air_data.xml modules/geo_mag.xml modules/gps.xml modules/guidance_rotorcraft.xml modules/imu_common.xml modules/ins_extended.xml modules/nav_basic_rotorcraft.xml modules/stabilization_indi_simple.xml"
gui_color="#7d7fd7e7ffff"
/>
<aircraft <aircraft
name="bebop_opticflow_indoor" name="bebop_opticflow_indoor"
ac_id="97" ac_id="97"
@@ -183,32 +183,25 @@ struct StabilizationSetpoint guidance_hybrid_h_run_accel(bool in_flight UNUSED,
return sp; return sp;
} }
int32_t guidance_hybrid_v_run_pos(bool in_flight, struct VerticalGuidance *gv) struct ThrustSetpoint guidance_hybrid_v_run_pos(bool in_flight, struct VerticalGuidance *gv)
{ {
int32_t delta_t = guidance_pid_v_run_pos(in_flight, gv); struct ThrustSetpoint th = guidance_pid_v_run_pos(in_flight, gv);
return guidance_hybrid_vertical(delta_t); return guidance_hybrid_vertical(&th);
} }
int32_t guidance_hybrid_v_run_speed(bool in_flight, struct VerticalGuidance *gv) struct ThrustSetpoint guidance_hybrid_v_run_speed(bool in_flight, struct VerticalGuidance *gv)
{ {
int32_t delta_t = guidance_pid_v_run_speed(in_flight, gv); struct ThrustSetpoint th = guidance_pid_v_run_speed(in_flight, gv);
return guidance_hybrid_vertical(delta_t); return guidance_hybrid_vertical(&th);
} }
int32_t guidance_hybrid_v_run_accel(bool in_flight, struct VerticalGuidance *gv) struct ThrustSetpoint guidance_hybrid_v_run_accel(bool in_flight, struct VerticalGuidance *gv)
{ {
int32_t delta_t = guidance_pid_v_run_accel(in_flight, gv); struct ThrustSetpoint th = guidance_pid_v_run_accel(in_flight, gv);
return guidance_hybrid_vertical(delta_t); return guidance_hybrid_vertical(&th);
} }
void guidance_hybrid_reset_heading(struct Int32Eulers *sp_cmd)
{
guidance_hybrid_ypr_sp.psi = sp_cmd->psi;
high_res_psi = sp_cmd->psi << (INT32_ANGLE_HIGH_RES_FRAC - INT32_ANGLE_FRAC);
stabilization_attitude_set_rpy_setpoint_i(sp_cmd);
}
/// Convert a required airspeed to a certain attitude for the Quadshot /// Convert a required airspeed to a certain attitude for the Quadshot
void guidance_hybrid_airspeed_to_attitude(struct Int32Eulers *ypr_sp) void guidance_hybrid_airspeed_to_attitude(struct Int32Eulers *ypr_sp)
{ {
@@ -440,8 +433,9 @@ struct StabilizationSetpoint guidance_hybrid_set_cmd_i(struct Int32Eulers *sp_cm
* Take a thrust command as input and returns the modified value * Take a thrust command as input and returns the modified value
* according to the current flight regime * according to the current flight regime
*/ */
int32_t guidance_hybrid_vertical(int32_t delta_t) struct ThrustSetpoint guidance_hybrid_vertical(struct ThrustSetpoint *th)
{ {
int32_t delta_t = th_sp_to_thrust_i(th, 0, THRUST_AXIS_Z);
int32_t hybrid_delta_t = 0; int32_t hybrid_delta_t = 0;
float fwd_speed_err = guidance_hybrid_norm_ref_airspeed_f - AIRSPEED_FORWARD; float fwd_speed_err = guidance_hybrid_norm_ref_airspeed_f - AIRSPEED_FORWARD;
@@ -486,7 +480,7 @@ int32_t guidance_hybrid_vertical(int32_t delta_t)
guidance_pid.ki = GUIDANCE_V_HOVER_KI; guidance_pid.ki = GUIDANCE_V_HOVER_KI;
} }
return hybrid_delta_t; return th_sp_from_thrust_i(hybrid_delta_t, THRUST_AXIS_Z);
} }
@@ -521,17 +515,17 @@ struct StabilizationSetpoint guidance_h_run_accel(bool in_flight, struct Horizon
return guidance_hybrid_h_run_accel(in_flight, gh); return guidance_hybrid_h_run_accel(in_flight, gh);
} }
int32_t guidance_v_run_pos(bool in_flight, struct VerticalGuidance *gv) struct ThrustSetpoint guidance_v_run_pos(bool in_flight, struct VerticalGuidance *gv)
{ {
return guidance_hybrid_v_run_pos(in_flight, gv); return guidance_hybrid_v_run_pos(in_flight, gv);
} }
int32_t guidance_v_run_speed(bool in_flight, struct VerticalGuidance *gv) struct ThrustSetpoint guidance_v_run_speed(bool in_flight, struct VerticalGuidance *gv)
{ {
return guidance_hybrid_v_run_speed(in_flight, gv); return guidance_hybrid_v_run_speed(in_flight, gv);
} }
int32_t guidance_v_run_accel(bool in_flight, struct VerticalGuidance *gv) struct ThrustSetpoint guidance_v_run_accel(bool in_flight, struct VerticalGuidance *gv)
{ {
return guidance_hybrid_v_run_accel(in_flight, gv); return guidance_hybrid_v_run_accel(in_flight, gv);
} }
@@ -61,9 +61,9 @@ extern struct StabilizationSetpoint guidance_hybrid_run(void);
extern struct StabilizationSetpoint guidance_hybrid_h_run_pos(bool in_flight, struct HorizontalGuidance *gh); extern struct StabilizationSetpoint guidance_hybrid_h_run_pos(bool in_flight, struct HorizontalGuidance *gh);
extern struct StabilizationSetpoint guidance_hybrid_h_run_speed(bool in_flight, struct HorizontalGuidance *gh); extern struct StabilizationSetpoint guidance_hybrid_h_run_speed(bool in_flight, struct HorizontalGuidance *gh);
extern struct StabilizationSetpoint guidance_hybrid_h_run_accel(bool in_flight, struct HorizontalGuidance *gh); extern struct StabilizationSetpoint guidance_hybrid_h_run_accel(bool in_flight, struct HorizontalGuidance *gh);
extern int32_t guidance_hybrid_v_run_pos(bool in_flight, struct VerticalGuidance *gv); extern struct ThrustSetpoint guidance_hybrid_v_run_pos(bool in_flight, struct VerticalGuidance *gv);
extern int32_t guidance_hybrid_v_run_speed(bool in_flight, struct VerticalGuidance *gv); extern struct ThrustSetpoint guidance_hybrid_v_run_speed(bool in_flight, struct VerticalGuidance *gv);
extern int32_t guidance_hybrid_v_run_accel(bool in_flight, struct VerticalGuidance *gv); extern struct ThrustSetpoint guidance_hybrid_v_run_accel(bool in_flight, struct VerticalGuidance *gv);
/** Creates the attitude set-points from an orientation vector. /** Creates the attitude set-points from an orientation vector.
* @param sp_cmd The orientation vector * @param sp_cmd The orientation vector
@@ -83,17 +83,12 @@ extern void guidance_hybrid_groundspeed_to_airspeed(void);
*/ */
extern void guidance_hybrid_determine_wind_estimate(void); extern void guidance_hybrid_determine_wind_estimate(void);
/** Description.
* @param sp_cmd Add Description
*/
extern void guidance_hybrid_reset_heading(struct Int32Eulers *sp_cmd);
/** Description. /** Description.
* Change thurst command from standard hover loop to hybrid thrust command * Change thurst command from standard hover loop to hybrid thrust command
* @param delta_t original thurst command * @param delta_t original thurst command
* @return modified thrust command * @return modified thrust command
*/ */
extern int32_t guidance_hybrid_vertical(int32_t delta_t); extern struct ThrustSetpoint guidance_hybrid_vertical(struct ThrustSetpoint *th);
extern bool force_forward_flight; extern bool force_forward_flight;
@@ -411,9 +411,6 @@ if not run_test_cases:
print("Natnet error: Fail to connect to natnet") print("Natnet error: Fail to connect to natnet")
exit(-1) exit(-1)
if args.verbose:
print_configuration(natnet)
while True: while True:
sleep(1) sleep(1)
except (KeyboardInterrupt, SystemExit): except (KeyboardInterrupt, SystemExit):