From 155c74a7a555f1df5415fc716db99be73a6b8d01 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Wed, 11 Dec 2024 19:44:31 +0100 Subject: [PATCH 1/3] Airframes: remove unnecessary double newlines --- ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil | 1 - ROMFS/px4fmu_common/init.d/airframes/12001_octo_cox | 1 - ROMFS/px4fmu_common/init.d/airframes/16001_helicopter | 1 - ROMFS/px4fmu_common/init.d/airframes/17002_TF-AutoG2 | 2 -- ROMFS/px4fmu_common/init.d/airframes/17003_TF-G2 | 1 - ROMFS/px4fmu_common/init.d/airframes/24001_dodeca_cox | 1 - ROMFS/px4fmu_common/init.d/airframes/4050_generic_250 | 1 - ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu | 5 ----- ROMFS/px4fmu_common/init.d/airframes/4071_ifo | 1 - ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21 | 2 -- .../init.d/airframes/50001_aion_robotics_r1_rover | 1 - .../init.d/airframes/59000_generic_ground_vehicle | 1 - .../px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy | 1 - 13 files changed, 19 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil b/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil index e124e9981ac1..2bcfc14a2e03 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil +++ b/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil @@ -12,7 +12,6 @@ . ${R}etc/init.d/rc.fw_defaults - param set UAVCAN_ENABLE 0 param set-default CA_AIRFRAME 1 diff --git a/ROMFS/px4fmu_common/init.d/airframes/12001_octo_cox b/ROMFS/px4fmu_common/init.d/airframes/12001_octo_cox index 1dba92b89d9d..d72eaa213211 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/12001_octo_cox +++ b/ROMFS/px4fmu_common/init.d/airframes/12001_octo_cox @@ -21,7 +21,6 @@ . ${R}etc/init.d/rc.mc_defaults - param set-default MAV_TYPE 14 param set-default CA_ROTOR_COUNT 8 diff --git a/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter b/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter index de21a8821668..695604e0b189 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter +++ b/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter @@ -11,7 +11,6 @@ . ${R}etc/init.d/rc.heli_defaults - # Disable PID gains for initial setup. These should be enabled after setting the FF gain. # P is expected to be lower than FF. param set-default MC_ROLLRATE_P 0 diff --git a/ROMFS/px4fmu_common/init.d/airframes/17002_TF-AutoG2 b/ROMFS/px4fmu_common/init.d/airframes/17002_TF-AutoG2 index 0ed3b201c8a5..7f85a770e19e 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/17002_TF-AutoG2 +++ b/ROMFS/px4fmu_common/init.d/airframes/17002_TF-AutoG2 @@ -22,7 +22,6 @@ . ${R}etc/init.d/rc.fw_defaults - param set-default BAT1_CAPACITY 2500 param set-default BAT1_N_CELLS 3 @@ -41,7 +40,6 @@ param set-default FW_P_LIM_MAX 25 param set-default FW_P_LIM_MIN -5 param set-default FW_P_RMAX_NEG 20 - param set-default CA_AIRFRAME 1 param set-default CA_ROTOR_COUNT 1 diff --git a/ROMFS/px4fmu_common/init.d/airframes/17003_TF-G2 b/ROMFS/px4fmu_common/init.d/airframes/17003_TF-G2 index 0fced30c8efa..1907b33a3248 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/17003_TF-G2 +++ b/ROMFS/px4fmu_common/init.d/airframes/17003_TF-G2 @@ -20,7 +20,6 @@ . ${R}etc/init.d/rc.fw_defaults - param set-default BAT1_CAPACITY 3300 param set-default BAT1_N_CELLS 3 diff --git a/ROMFS/px4fmu_common/init.d/airframes/24001_dodeca_cox b/ROMFS/px4fmu_common/init.d/airframes/24001_dodeca_cox index f894d47d74fd..6f75f8619867 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/24001_dodeca_cox +++ b/ROMFS/px4fmu_common/init.d/airframes/24001_dodeca_cox @@ -19,7 +19,6 @@ param set-default NAV_ACC_RAD 2 param set-default RTL_DESCEND_ALT 10 param set-default RTL_RETURN_ALT 30 - param set-default CA_ROTOR_COUNT 12 # Bottom motors param set-default CA_ROTOR0_PX 0 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250 b/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250 index d460138cc815..129eacbffdeb 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250 +++ b/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250 @@ -21,7 +21,6 @@ param set-default MC_PITCHRATE_P 0.08 param set-default MC_PITCHRATE_D 0.001 param set-default MC_YAW_P 4 - param set-default MC_ROLLRATE_MAX 1600 param set-default MC_PITCHRATE_MAX 1600 param set-default MC_YAWRATE_MAX 1000 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu b/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu index e5e5e083437f..fe40b95aa034 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu +++ b/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu @@ -38,7 +38,6 @@ param set-default COM_FLTMODE5 -1 param set-default COM_FLTMODE6 1 param set-default COM_RC_LOSS_T 3 - # ekf2 param set-default EKF2_BARO_NOISE 2 @@ -79,19 +78,16 @@ param set-default EKF2_RNG_POS_Z 0.033 param set-default EKF2_TERR_NOISE 1 - # Maximum allowed angle velocity in the landed state param set-default LNDMC_ROT_MAX 40 # Maximum vertical velocity allowed in the landed state param set-default LNDMC_Z_VEL_MAX 0.7 - # filtering param set-default IMU_DGYRO_CUTOFF 50 param set-default IMU_GYRO_CUTOFF 65 - # Pitch angle & rate setting param set-default MC_PITCHRATE_P 0.075 param set-default MC_PITCHRATE_I 0.1 @@ -148,7 +144,6 @@ param set-default RC_MAP_RETURN_SW 7 param set-default RC1_TRIM 1000 - # optical flow param set-default SENS_FLOW_MAXR 7.4 param set-default SENS_FLOW_MINHGT 0.15 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4071_ifo b/ROMFS/px4fmu_common/init.d/airframes/4071_ifo index 8cfc14ae1ef7..141ca861c422 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4071_ifo +++ b/ROMFS/px4fmu_common/init.d/airframes/4071_ifo @@ -30,7 +30,6 @@ param set-default IMU_DGYRO_CUTOFF 90 param set-default IMU_GYRO_CUTOFF 100 # System - param set-default SENS_BOARD_ROT 10 # EKF2 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21 b/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21 index 4833d17af23c..85b045e84a2a 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21 +++ b/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21 @@ -18,7 +18,6 @@ # . ${R}etc/init.d/rc.mc_defaults - param set-default SYS_HAS_MAG 0 param set-default EKF2_OF_CTRL 1 param set-default EKF2_GPS_CTRL 0 @@ -85,6 +84,5 @@ param set-default PWM_MAIN_MAX3 255 param set-default SENS_FLOW_MINRNG 0.05 - syslink start mavlink start -d /dev/bridge0 -b 57600 -m osd -r 40000 diff --git a/ROMFS/px4fmu_common/init.d/airframes/50001_aion_robotics_r1_rover b/ROMFS/px4fmu_common/init.d/airframes/50001_aion_robotics_r1_rover index 7cdf2d10a673..57a3644dae00 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/50001_aion_robotics_r1_rover +++ b/ROMFS/px4fmu_common/init.d/airframes/50001_aion_robotics_r1_rover @@ -40,7 +40,6 @@ param set-default RD_YAW_I 0.1 param set-default RD_YAW_RATE_P 0.1 param set-default RD_YAW_RATE_I 0.01 - # Pure pursuit parameters param set-default PP_LOOKAHD_MAX 10 param set-default PP_LOOKAHD_MIN 1 diff --git a/ROMFS/px4fmu_common/init.d/airframes/59000_generic_ground_vehicle b/ROMFS/px4fmu_common/init.d/airframes/59000_generic_ground_vehicle index a773c1158d44..078ea7859d8b 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/59000_generic_ground_vehicle +++ b/ROMFS/px4fmu_common/init.d/airframes/59000_generic_ground_vehicle @@ -15,7 +15,6 @@ . ${R}etc/init.d/rc.rover_defaults - param set-default BAT1_N_CELLS 2 param set-default EKF2_ANGERR_INIT 0.01 diff --git a/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy b/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy index 06a2d3fb2f91..1449a6d3adf3 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy +++ b/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy @@ -22,7 +22,6 @@ . ${R}etc/init.d/rc.uuv_defaults - param set-default MAV_1_CONFIG 102 param set-default BAT1_A_PER_V 37.8798 From 6aefad5057b83ec33f802c4f08216e65edf8bfea Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Wed, 11 Dec 2024 19:45:12 +0100 Subject: [PATCH 2/3] PCF8583: refactor 1e6f for 1000000.f --- src/drivers/rpm/pcf8583/PCF8583.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/rpm/pcf8583/PCF8583.cpp b/src/drivers/rpm/pcf8583/PCF8583.cpp index fcc9828dad86..085015247f4b 100644 --- a/src/drivers/rpm/pcf8583/PCF8583.cpp +++ b/src/drivers/rpm/pcf8583/PCF8583.cpp @@ -195,8 +195,8 @@ void PCF8583::RunImpl() } // Calculate RPM and accuracy estimation - float indicated_rpm = (((float)diffCount / _param_pcf8583_magnet.get()) / ((float)diffTime / 1000000.f)) * 60.f; - float estimated_accurancy = 1 / (float)_param_pcf8583_magnet.get() / ((float)diffTime / 1000000) * 60.f; + float indicated_rpm = (((float)diffCount / _param_pcf8583_magnet.get()) / ((float)diffTime / 1e6f)) * 60.f; + float estimated_accurancy = 1 / (float)_param_pcf8583_magnet.get() / ((float)diffTime / 1e6f) * 60.f; // publish data to uorb rpm_s msg{}; From 751098062ef814db07fbf5b303cf0f0a97629b8e Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Wed, 11 Dec 2024 19:45:42 +0100 Subject: [PATCH 3/3] LidarLitePWM: refactor static cast and comment --- src/drivers/distance_sensor/ll40ls_pwm/LidarLitePWM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/distance_sensor/ll40ls_pwm/LidarLitePWM.cpp b/src/drivers/distance_sensor/ll40ls_pwm/LidarLitePWM.cpp index 1ef65a5ca396..8e94a4171034 100644 --- a/src/drivers/distance_sensor/ll40ls_pwm/LidarLitePWM.cpp +++ b/src/drivers/distance_sensor/ll40ls_pwm/LidarLitePWM.cpp @@ -109,7 +109,7 @@ LidarLitePWM::measure() return PX4_ERROR; } - const float current_distance = float(_pwm.pulse_width) * 1e-3f; /* 10 usec = 1 cm distance for LIDAR-Lite */ + const float current_distance = static_cast(_pwm.pulse_width) * 1e-3f; // 1us = 1mm distance for LIDAR-Lite /* Due to a bug in older versions of the LidarLite firmware, we have to reset sensor on (distance == 0) */ if (current_distance <= 0.0f) {