mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 13:18:52 +08:00
ekf2: define max number of range finders seperate from max number of mutli uORB topics
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
This commit is contained in:
@@ -253,7 +253,8 @@ private:
|
||||
bool _callback_registered{false};
|
||||
|
||||
// because we can have several distance sensor instances with different orientations
|
||||
uORB::Subscription _range_finder_subs[ORB_MULTI_MAX_INSTANCES] {{ORB_ID(distance_sensor), 0}, {ORB_ID(distance_sensor), 1}, {ORB_ID(distance_sensor), 2}, {ORB_ID(distance_sensor), 3}};
|
||||
static constexpr int MAX_RNG_SENSOR_COUNT = 4;
|
||||
uORB::Subscription _range_finder_subs[MAX_RNG_SENSOR_COUNT] {{ORB_ID(distance_sensor), 0}, {ORB_ID(distance_sensor), 1}, {ORB_ID(distance_sensor), 2}, {ORB_ID(distance_sensor), 3}};
|
||||
int _range_finder_sub_index = -1; // index for downward-facing range finder subscription
|
||||
|
||||
// because we can have multiple GPS instances
|
||||
@@ -1748,7 +1749,7 @@ void Ekf2::resetPreFlightChecks()
|
||||
|
||||
int Ekf2::getRangeSubIndex()
|
||||
{
|
||||
for (unsigned i = 0; i < ORB_MULTI_MAX_INSTANCES; i++) {
|
||||
for (unsigned i = 0; i < MAX_RNG_SENSOR_COUNT; i++) {
|
||||
distance_sensor_s report{};
|
||||
|
||||
if (_range_finder_subs[i].update(&report)) {
|
||||
|
||||
Reference in New Issue
Block a user