44 Copyright (c) 2024 SparkFun Electronics
55*/
66
7+ /* ******************************************************************************
8+ Example 6 - Standard Deviation
9+
10+ This example demonstrates how to read the standard deviation of the
11+ measurements of the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).
12+
13+ The OTOS uses Kalman filters to estimate the position, velocity, and
14+ acceleration of the x, y, and heading. The square root of the diagonal
15+ elements of the covariance matrices are provided for the standard deviation
16+ of each measurement. THEY DO NOT REPRESENT THE ACTUAL TRACKING ERROR! These
17+ are statistical quantities that assume a correct model of the system, but
18+ there could be unmodelled error sources that cause the physical error to
19+ become larger than these statistical error (eg. improper calibration, or
20+ tilting the OTOS to not be flat against the tracking surface). These are
21+ provided primarily for anyone wanting to perform sensor fusion with
22+ additional sensors.
23+ *******************************************************************************/
24+
725#include " SparkFun_Qwiic_OTOS_Arduino_Library.h"
826#include " Wire.h"
927
@@ -69,22 +87,21 @@ void loop()
6987 // REPRESENT THE ACTUAL TRACKING ERROR! These are statistical quantities
7088 // that assume a correct model of the system, but there could be unmodelled
7189 // error sources that cause the physical error to become larger than these
72- // statistical error (eg. improper calibration, or rotating the OTOS to not
90+ // statistical error (eg. improper calibration, or tilting the OTOS to not
7391 // be flat against the tracking surface). These are provided primarily for
74- // anyone wanting to perform sensor fusion with additional sensors, but they
75- // can be used to at least "get an idea" of the quality of the accuracy.
92+ // anyone wanting to perform sensor fusion with additional sensors.
7693 myOtos.getPositionStdDev (posStdDev);
7794 // myOtos.getVelocityStdDev(velStdDev);
7895 // myOtos.getAccelerationStdDev(accStdDev);
7996
80- // These values can instead be read out in chunks:
97+ // These values can instead be burst read out in chunks:
8198 // myOtos.getPosVelAcc(pos, vel, acc);
8299 // myOtos.getPosVelAccStdDev(posStdDev, velStdDev, accStdDev);
83100
84- // Or all at once:
101+ // Or burst read them all at once:
85102 // myOtos.getPosVelAccAndStdDev(pos, vel, acc, posStdDev, velStdDev, accStdDev);
86103
87- // Print measurements
104+ // Print position and standard deviation
88105 Serial.println ();
89106 Serial.println (" Sensor pose:" );
90107 Serial.print (" X (Inches): " );
@@ -100,6 +117,7 @@ void loop()
100117 Serial.print (" +/- " );
101118 Serial.println (posStdDev.h );
102119
120+ // Print velocity and standard deviation
103121 // Serial.println();
104122 // Serial.println("Sensor velocity:");
105123 // Serial.print("X (Inches/sec): ");
@@ -115,6 +133,7 @@ void loop()
115133 // Serial.print(" +/- ");
116134 // Serial.println(velStdDev.h);
117135
136+ // Print acceleration and standard deviation
118137 // Serial.println();
119138 // Serial.println("Sensor acceleration:");
120139 // Serial.print("X (Inches/sec^2): ");
0 commit comments