diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp index bc8a5232f2..c107c5f80a 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp @@ -43,12 +43,12 @@ AP_InertialSensor_Backend *AP_InertialSensor_PX4::detect(AP_InertialSensor &_imu bool AP_InertialSensor_PX4::_init_sensor(void) { // assumes max 3 instances - _accel_fd[0] = open(ACCEL_DEVICE_PATH, O_RDONLY); - _accel_fd[1] = open(ACCEL_DEVICE_PATH "1", O_RDONLY); - _accel_fd[2] = open(ACCEL_DEVICE_PATH "2", O_RDONLY); - _gyro_fd[0] = open(GYRO_DEVICE_PATH, O_RDONLY); - _gyro_fd[1] = open(GYRO_DEVICE_PATH "1", O_RDONLY); - _gyro_fd[2] = open(GYRO_DEVICE_PATH "2", O_RDONLY); + _accel_fd[0] = open(ACCEL_BASE_DEVICE_PATH "0", O_RDONLY); + _accel_fd[1] = open(ACCEL_BASE_DEVICE_PATH "1", O_RDONLY); + _accel_fd[2] = open(ACCEL_BASE_DEVICE_PATH "2", O_RDONLY); + _gyro_fd[0] = open(GYRO_BASE_DEVICE_PATH "0", O_RDONLY); + _gyro_fd[1] = open(GYRO_BASE_DEVICE_PATH "1", O_RDONLY); + _gyro_fd[2] = open(GYRO_BASE_DEVICE_PATH "2", O_RDONLY); _num_accel_instances = 0; _num_gyro_instances = 0;