Skip to content

Commit

Permalink
Fix compile warnings in make test (#3216)
Browse files Browse the repository at this point in the history
* Silent compile warnings in tests

* silent warnings in conf_test

* fix defines: if OLD -> warn and convert. If new, then use. If no old and no new, use default.
  • Loading branch information
dewagter committed Dec 18, 2023
1 parent f0d2cd3 commit a07d674
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions conf/airframes/examples/bebop2_opticflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@
<define name="FILT_CUTOFF_R" value="3.2"/>

<!-- first order actuator dynamics -->
<define name="ACT_DYN_P" value="0.06"/>
<define name="ACT_DYN_Q" value="0.06"/>
<define name="ACT_DYN_R" value="0.06"/>
<define name="ACT_FREQ_P" value="31.7"/>
<define name="ACT_FREQ_Q" value="31.7"/>
<define name="ACT_FREQ_R" value="31.7"/>

<!-- Adaptive Learning Rate -->
<define name="USE_ADAPTIVE" value="FALSE"/>
Expand Down
7 changes: 4 additions & 3 deletions conf/airframes/examples/cube_orange.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<define name="GUIDANCE_INDI_FILTER_CUTOFF" value="0.5"/>
<define name="GUIDANCE_INDI_LINE_GAIN" value="0.2"/>
<define name="GUIDANCE_INDI_MIN_THROTTLE" value="2500"/>
<define name="GUIDANCE_INDI_THRUST_DYNAMICS_FREQ" value="18"/>
</module>

<module name="motor_mixing"/>
Expand Down Expand Up @@ -300,9 +301,9 @@
<define name="FILT_CUTOFF_R" value="4.0"/>

<!-- first order actuator dynamics -->
<define name="ACT_DYN_P" value="0.0354"/>
<define name="ACT_DYN_Q" value="0.0354"/>
<define name="ACT_DYN_R" value="0.0354"/>
<define name="ACT_FREQ_P" value="18"/>
<define name="ACT_FREQ_Q" value="18"/>
<define name="ACT_FREQ_R" value="18"/>

<!-- Adaptive Learning Rate -->
<define name="USE_ADAPTIVE" value="FALSE"/>
Expand Down
1 change: 1 addition & 0 deletions conf/modules/imu_mpu9250_i2c.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<test>
<define name="IMU_MPU9250_I2C_DEV" value="i2c1"/>
<define name="USE_I2C1"/>
<define name="PERIODIC_FREQUENCY" value="512"/>
<define name="IMU_MPU9250_PERIODIC_FREQ" value="512"/>
</test>
</makefile>
Expand Down
1 change: 1 addition & 0 deletions conf/modules/imu_mpu9250_spi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<define name="USE_SPI1"/>
<define name="IMU_MPU9250_SPI_SLAVE_IDX" value="0"/>
<define name="USE_SPI_SLAVE0"/>
<define name="PERIODIC_FREQUENCY" value="512"/>
<define name="IMU_MPU9250_PERIODIC_FREQ" value="512"/>
</test>
</makefile>
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/sensors_hitl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<file name="sensors_hitl.c"/>
<test firmware="rotorcraft">
<include name="../../conf/simulator/nps"/>
<define name="NPS_PROPAGATE" value="500"/>
<define name="AHRS_PROPAGATE_FREQUENCY" value="500"/>
<define name="HITL_DEVICE" value="usb_serial"/>
<define name="USE_USB_SERIAL"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ static void guidance_indi_filter_thrust(void);
#warning "The thrust dynamics are now specified in continuous time with the corner frequency of the first order model!"
#warning "define GUIDANCE_INDI_THRUST_DYNAMICS_FREQ in rad/s"
#warning "Use -log(1 - old_number) * PERIODIC_FREQUENCY to compute it from the old value."
#define GUIDANCE_INDI_THRUST_DYNAMICS_FREQ (-ln(1-GUIDANCE_INDI_THRUST_DYNAMICS)*PERIODIC_FREQUENCY)
#endif

#ifndef GUIDANCE_INDI_THRUST_DYNAMICS_FREQ
#ifndef STABILIZATION_INDI_ACT_DYN_P
#error "You need to define GUIDANCE_INDI_THRUST_DYNAMICS to be able to use indi vertical control"
#ifndef STABILIZATION_INDI_ACT_FREQ_P
#error "You need to define GUIDANCE_INDI_THRUST_DYNAMICS_FREQ to be able to use indi vertical control"
#else // assume that the same actuators are used for thrust as for roll (e.g. quadrotor)
#define GUIDANCE_INDI_THRUST_DYNAMICS_FREQ STABILIZATION_INDI_ACT_DYN_P
#define GUIDANCE_INDI_THRUST_DYNAMICS_FREQ STABILIZATION_INDI_ACT_FREQ_P
#endif
#endif //GUIDANCE_INDI_THRUST_DYNAMICS_FREQ

Expand Down

0 comments on commit a07d674

Please sign in to comment.