mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
ekf2: multi ekf supports up to 4 IMUs
This commit is contained in:
@@ -1407,11 +1407,11 @@ int EKF2::task_spawn(int argc, char *argv[])
|
|||||||
// ekf selector requires SENS_IMU_MODE = 0
|
// ekf selector requires SENS_IMU_MODE = 0
|
||||||
multi_mode = true;
|
multi_mode = true;
|
||||||
|
|
||||||
// IMUs (1 - 3 supported)
|
// IMUs (1 - 4 supported)
|
||||||
param_get(param_find("EKF2_MULTI_IMU"), &imu_instances);
|
param_get(param_find("EKF2_MULTI_IMU"), &imu_instances);
|
||||||
|
|
||||||
if (imu_instances < 1 || imu_instances > 3) {
|
if (imu_instances < 1 || imu_instances > 4) {
|
||||||
const int32_t imu_instances_limited = math::constrain(imu_instances, 1, 3);
|
const int32_t imu_instances_limited = math::constrain(imu_instances, 1, 4);
|
||||||
PX4_WARN("EKF2_MULTI_IMU limited %d -> %d", imu_instances, imu_instances_limited);
|
PX4_WARN("EKF2_MULTI_IMU limited %d -> %d", imu_instances, imu_instances_limited);
|
||||||
param_set_no_notification(param_find("EKF2_MULTI_IMU"), &imu_instances_limited);
|
param_set_no_notification(param_find("EKF2_MULTI_IMU"), &imu_instances_limited);
|
||||||
imu_instances = imu_instances_limited;
|
imu_instances = imu_instances_limited;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
* @group EKF2
|
* @group EKF2
|
||||||
* @reboot_required true
|
* @reboot_required true
|
||||||
* @min 0
|
* @min 0
|
||||||
* @max 3
|
* @max 4
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(EKF2_MULTI_IMU, 0);
|
PARAM_DEFINE_INT32(EKF2_MULTI_IMU, 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user