mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:43:45 +02:00
Initial values, report error.
This commit is contained in:
parent
ff9e6f831c
commit
517bbe80a7
2 changed files with 10 additions and 2 deletions
|
@ -249,6 +249,8 @@ void SerialInterface::readData(float deltaTime) {
|
||||||
_angularAccelToLinearAccel * angularAcceleration;
|
_angularAccelToLinearAccel * angularAcceleration;
|
||||||
glm::vec3 error = _estimatedAcceleration - predictedAcceleration;
|
glm::vec3 error = _estimatedAcceleration - predictedAcceleration;
|
||||||
|
|
||||||
|
printLog("error %g\n", glm::length(error));
|
||||||
|
|
||||||
// adjust according to error in each dimension, in proportion to input magnitudes
|
// adjust according to error in each dimension, in proportion to input magnitudes
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
if (fabsf(error[i]) < EPSILON) {
|
if (fabsf(error[i]) < EPSILON) {
|
||||||
|
|
|
@ -31,8 +31,14 @@ public:
|
||||||
_estimatedVelocity(0, 0, 0),
|
_estimatedVelocity(0, 0, 0),
|
||||||
_lastAcceleration(0, 0, 0),
|
_lastAcceleration(0, 0, 0),
|
||||||
_lastRotationRates(0, 0, 0),
|
_lastRotationRates(0, 0, 0),
|
||||||
_angularVelocityToLinearAccel(0),
|
_angularVelocityToLinearAccel( // experimentally derived initial values
|
||||||
_angularAccelToLinearAccel(0)
|
0.001f, -0.008f, 0.020f,
|
||||||
|
0.003f, -0.003f, 0.025f,
|
||||||
|
0.017f, 0.007f, 0.029f),
|
||||||
|
_angularAccelToLinearAccel( // experimentally derived initial values
|
||||||
|
0.0f, 0.0f, 0.002f,
|
||||||
|
0.0f, 0.0f, 0.002f,
|
||||||
|
-0.002f, -0.002f, 0.0f)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void pair();
|
void pair();
|
||||||
|
|
Loading…
Reference in a new issue