mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
sensors: allow up to 4 accels, gyros, and baros and add configurable rotations for accel & gyro
This commit is contained in:
@@ -149,7 +149,7 @@ using namespace matrix;
|
||||
using namespace time_literals;
|
||||
|
||||
static constexpr char sensor_name[] {"accel"};
|
||||
static constexpr unsigned MAX_ACCEL_SENS = 3;
|
||||
static constexpr unsigned MAX_ACCEL_SENS = 4;
|
||||
|
||||
/// Data passed to calibration worker routine
|
||||
typedef struct {
|
||||
@@ -176,6 +176,7 @@ static calibrate_return read_accelerometer_avg(float (&accel_avg)[MAX_ACCEL_SENS
|
||||
{ORB_ID(sensor_accel), 0, 0},
|
||||
{ORB_ID(sensor_accel), 0, 1},
|
||||
{ORB_ID(sensor_accel), 0, 2},
|
||||
{ORB_ID(sensor_accel), 0, 3},
|
||||
};
|
||||
|
||||
/* use the first sensor to pace the readout, but do per-sensor counts */
|
||||
@@ -202,6 +203,9 @@ static calibrate_return read_accelerometer_avg(float (&accel_avg)[MAX_ACCEL_SENS
|
||||
case 2:
|
||||
offset = Vector3f{sensor_correction.accel_offset_2};
|
||||
break;
|
||||
case 3:
|
||||
offset = Vector3f{sensor_correction.accel_offset_3};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,6 +477,9 @@ int do_accel_calibration_quick(orb_advert_t *mavlink_log_pub)
|
||||
case 2:
|
||||
offset = Vector3f{sensor_correction.accel_offset_2};
|
||||
break;
|
||||
case 3:
|
||||
offset = Vector3f{sensor_correction.accel_offset_3};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user