mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 02:03:34 +08:00
Fix getting the aoa and slip hall id
This commit is contained in:
committed by
JaeyoungLim
parent
538b8d9913
commit
69aaa9bad2
@@ -338,10 +338,6 @@ Sensors::~Sensors()
|
|||||||
sub.unregisterCallback();
|
sub.unregisterCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &sub : _sensor_hall_subs) {
|
|
||||||
sub.unregisterCallback();
|
|
||||||
}
|
|
||||||
|
|
||||||
_vehicle_acceleration.Stop();
|
_vehicle_acceleration.Stop();
|
||||||
_vehicle_angular_velocity.Stop();
|
_vehicle_angular_velocity.Stop();
|
||||||
|
|
||||||
@@ -658,9 +654,7 @@ void Sensors::hall_poll()
|
|||||||
// messages and that would mess with the updated flags of the subscribers
|
// messages and that would mess with the updated flags of the subscribers
|
||||||
|
|
||||||
// find the AoA hall sensor index if not set yet
|
// find the AoA hall sensor index if not set yet
|
||||||
if ((_parameters.CAL_AV_AOA_ID >= 0) && (_parameters.CAL_AV_AOA_ID < MAX_SENSOR_COUNT) &&
|
if (_parameters.CAL_AV_AOA_ID >= 0 && _av_aoa_hall_sub_index < 0) {
|
||||||
((_av_aoa_hall_sub_index < 0) || (_av_aoa_hall_sub_index >= MAX_SENSOR_COUNT))) {
|
|
||||||
|
|
||||||
_av_aoa_hall_sub_index = getHallSubIndex(_parameters.CAL_AV_AOA_ID);
|
_av_aoa_hall_sub_index = getHallSubIndex(_parameters.CAL_AV_AOA_ID);
|
||||||
|
|
||||||
if (_av_aoa_hall_sub_index >= 0) {
|
if (_av_aoa_hall_sub_index >= 0) {
|
||||||
@@ -669,9 +663,7 @@ void Sensors::hall_poll()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find the Slip hall sensor index if not set yet
|
// find the Slip hall sensor index if not set yet
|
||||||
if ((_parameters.CAL_AV_SLIP_ID >= 0) && (_parameters.CAL_AV_SLIP_ID < MAX_SENSOR_COUNT) &&
|
if (_parameters.CAL_AV_SLIP_ID >= 0&& _av_slip_hall_sub_index < 0) {
|
||||||
((_av_slip_hall_sub_index < 0) || (_av_slip_hall_sub_index >= MAX_SENSOR_COUNT))) {
|
|
||||||
|
|
||||||
_av_slip_hall_sub_index = getHallSubIndex(_parameters.CAL_AV_SLIP_ID);
|
_av_slip_hall_sub_index = getHallSubIndex(_parameters.CAL_AV_SLIP_ID);
|
||||||
|
|
||||||
if (_av_slip_hall_sub_index >= 0) {
|
if (_av_slip_hall_sub_index >= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user