sensor_calibration: increase threshold for updating calibration offsets or scale

- this is to minimize needlessly writing negligible parameter changes and triggering unnecessary estimator bias resets
This commit is contained in:
Daniel Agar
2021-02-23 13:32:00 -05:00
committed by GitHub
parent d65d06f82d
commit e38560b928
3 changed files with 6 additions and 6 deletions

View File

@@ -125,7 +125,7 @@ void Accelerometer::SensorCorrectionsUpdate(bool force)
bool Accelerometer::set_offset(const Vector3f &offset)
{
if (Vector3f(_offset - offset).longerThan(0.001f)) {
if (Vector3f(_offset - offset).longerThan(0.01f)) {
_offset = offset;
_calibration_count++;
@@ -137,7 +137,7 @@ bool Accelerometer::set_offset(const Vector3f &offset)
bool Accelerometer::set_scale(const Vector3f &scale)
{
if (Vector3f(_scale - scale).longerThan(0.001f)) {
if (Vector3f(_scale - scale).longerThan(0.01f)) {
_scale = scale;
_calibration_count++;

View File

@@ -125,7 +125,7 @@ void Gyroscope::SensorCorrectionsUpdate(bool force)
bool Gyroscope::set_offset(const Vector3f &offset)
{
if (Vector3f(_offset - offset).longerThan(0.001f)) {
if (Vector3f(_offset - offset).longerThan(0.01f)) {
_offset = offset;
_calibration_count++;

View File

@@ -85,7 +85,7 @@ void Magnetometer::set_external(bool external)
bool Magnetometer::set_offset(const Vector3f &offset)
{
if (Vector3f(_offset - offset).longerThan(0.001f)) {
if (Vector3f(_offset - offset).longerThan(0.01f)) {
_offset = offset;
_calibration_count++;
@@ -97,7 +97,7 @@ bool Magnetometer::set_offset(const Vector3f &offset)
bool Magnetometer::set_scale(const Vector3f &scale)
{
if (Vector3f(_scale.diag() - scale).longerThan(0.001f)) {
if (Vector3f(_scale.diag() - scale).longerThan(0.01f)) {
_scale(0, 0) = scale(0);
_scale(1, 1) = scale(1);
_scale(2, 2) = scale(2);
@@ -111,7 +111,7 @@ bool Magnetometer::set_scale(const Vector3f &scale)
bool Magnetometer::set_offdiagonal(const Vector3f &offdiagonal)
{
if (Vector3f(Vector3f{_scale(0, 1), _scale(0, 2), _scale(1, 2)} - offdiagonal).longerThan(0.001f)) {
if (Vector3f(Vector3f{_scale(0, 1), _scale(0, 2), _scale(1, 2)} - offdiagonal).longerThan(0.01f)) {
_scale(0, 1) = offdiagonal(0);
_scale(1, 0) = offdiagonal(0);