@@ -132,15 +132,15 @@ class Sensors : public ModuleBase<Sensors>, public ModuleParams, public px4::Sch
132
132
uORB::Subscription _diff_pres_sub{ORB_ID (differential_pressure)};
133
133
uORB::Subscription _vcontrol_mode_sub{ORB_ID (vehicle_control_mode)};
134
134
uORB::Subscription _vehicle_air_data_sub{ORB_ID (vehicle_air_data)};
135
- uORB::Subscription _sensor_hall_subs[MAX_SENSOR_COUNT] { // could be set to ORB_MULTI_MAX_INSTANCES if needed
136
- {ORB_ID (sensor_hall), 0 },
137
- {ORB_ID (sensor_hall), 1 },
138
- {ORB_ID (sensor_hall), 2 },
139
- {ORB_ID (sensor_hall), 3 },
140
- };
135
+ uORB::Subscription _sensor_hall_subs[MAX_SENSOR_COUNT] { // could be set to ORB_MULTI_MAX_INSTANCES if needed
136
+ {ORB_ID (sensor_hall), 0 },
137
+ {ORB_ID (sensor_hall), 1 },
138
+ {ORB_ID (sensor_hall), 2 },
139
+ {ORB_ID (sensor_hall), 3 },
140
+ };
141
141
142
- int _av_aoa_hall_sub_index = -1 ; // AoA vane index for hall effect subscription
143
- int _av_slip_hall_sub_index = -1 ; // Slip vane index for hall effect subscription
142
+ int _av_aoa_hall_sub_index = -1 ; // AoA vane index for hall effect subscription
143
+ int _av_slip_hall_sub_index = -1 ; // Slip vane index for hall effect subscription
144
144
145
145
uORB::Publication<airspeed_s> _airspeed_pub{ORB_ID (airspeed)};
146
146
uORB::Publication<sensor_combined_s> _sensor_pub{ORB_ID (sensor_combined)};
@@ -442,7 +442,7 @@ void Sensors::diff_pres_poll()
442
442
} else {
443
443
// differential pressure temperature invalid, check barometer
444
444
if ((air_data.timestamp != 0 ) && PX4_ISFINITE (air_data.baro_temp_celcius )
445
- && (air_data.baro_temp_celcius >= -40 .f ) && (air_data.baro_temp_celcius <= 125 .f )) {
445
+ && (air_data.baro_temp_celcius >= -40 .f ) && (air_data.baro_temp_celcius <= 125 .f )) {
446
446
447
447
// TODO: review PCB_TEMP_ESTIMATE_DEG, ignore for external baro
448
448
air_temperature_celsius = air_data.baro_temp_celcius - PCB_TEMP_ESTIMATE_DEG;
@@ -480,13 +480,13 @@ void Sensors::diff_pres_poll()
480
480
481
481
/* don't risk to feed negative airspeed into the system */
482
482
airspeed.indicated_airspeed_m_s = calc_IAS_corrected ((enum AIRSPEED_COMPENSATION_MODEL)
483
- _parameters.air_cmodel ,
484
- smodel, _parameters.air_tube_length , _parameters.air_tube_diameter_mm ,
485
- diff_pres.differential_pressure_filtered_pa , air_data.baro_pressure_pa ,
486
- air_temperature_celsius);
483
+ _parameters.air_cmodel ,
484
+ smodel, _parameters.air_tube_length , _parameters.air_tube_diameter_mm ,
485
+ diff_pres.differential_pressure_filtered_pa , air_data.baro_pressure_pa ,
486
+ air_temperature_celsius);
487
487
488
488
airspeed.true_airspeed_m_s = calc_TAS_from_CAS (airspeed.indicated_airspeed_m_s , air_data.baro_pressure_pa ,
489
- air_temperature_celsius); // assume that CAS = IAS as we don't have an CAS-scale here
489
+ air_temperature_celsius); // assume that CAS = IAS as we don't have an CAS-scale here
490
490
491
491
airspeed.air_temperature_celsius = air_temperature_celsius;
492
492
@@ -593,6 +593,7 @@ void Sensors::hall_poll()
593
593
if ((_av_aoa_hall_sub_index >= 0 ) && (_av_aoa_hall_sub_index < MAX_SENSOR_COUNT)) {
594
594
// A hall sensor with selected driver ID for the AoA vane has been found/set
595
595
struct sensor_hall_s sensor_hall;
596
+
596
597
if (_sensor_hall_subs[_av_aoa_hall_sub_index].update (&sensor_hall)) {
597
598
airflow_aoa_s airflow_aoa;
598
599
airflow_aoa.timestamp = hrt_absolute_time ();
@@ -624,6 +625,7 @@ void Sensors::hall_poll()
624
625
if ((_av_slip_hall_sub_index >= 0 ) && (_av_slip_hall_sub_index < MAX_SENSOR_COUNT)) {
625
626
// A hall sensor with selected driver ID for the slip vane has been found/set
626
627
struct sensor_hall_s sensor_hall;
628
+
627
629
if (_sensor_hall_subs[_av_slip_hall_sub_index].update (&sensor_hall)) {
628
630
airflow_slip_s airflow_slip;
629
631
airflow_slip.timestamp = hrt_absolute_time ();
@@ -663,7 +665,7 @@ void Sensors::hall_poll()
663
665
}
664
666
665
667
// find the Slip hall sensor index if not set yet
666
- if (_parameters.CAL_AV_SLIP_ID >= 0 && _av_slip_hall_sub_index < 0 ) {
668
+ if (_parameters.CAL_AV_SLIP_ID >= 0 && _av_slip_hall_sub_index < 0 ) {
667
669
_av_slip_hall_sub_index = getHallSubIndex (_parameters.CAL_AV_SLIP_ID );
668
670
669
671
if (_av_slip_hall_sub_index >= 0 ) {
@@ -676,6 +678,7 @@ int Sensors::getHallSubIndex(const int av_driver_id)
676
678
{
677
679
for (unsigned i = 0 ; i < MAX_SENSOR_COUNT; i++) {
678
680
sensor_hall_s sensor_hall;
681
+
679
682
if (_sensor_hall_subs[i].copy (&sensor_hall)) {
680
683
if (sensor_hall.instance == av_driver_id) {
681
684
return i;
0 commit comments