Disclaimer: Ich bin ein totaler Noob und nicht viel von einem Coder.
Ich habe eine 10DOF IMU. Ich versuche die Geschwindigkeit eines Sensors zu bekommen. Ich verstehe auf einer oberflächlichen Ebene die Begrenzung von Sensoren mit Drift etc ... Ich werde Sie durch meinen Gedankengang führen.Velocity funktioniert nicht durch computational Integration
Dieses doppelte Array enthält die XYZ-Werte meines Beschleunigungsmessers. Dies sind lineare Beschleunigungszahlen, ein Algorithmus hat den Gravitationsfaktor berücksichtigt und herausgenommen.
accelCompoDoub[0] = parseDouble(accelCompoString[0]);
accelCompoDoub[1] = parseDouble(accelCompoString[1]);
accelCompoDoub[2] = parseDouble(accelCompoString[2]);
Meine App verfolgt die verstrichene Zeit und benötigt ebenfalls deltaT. DeltaT wird verwendet, um die Beschleunigung rechnerisch zu integrieren.
currentTime = System.nanoTime();
if (startTime == 0.0 && previousTime == 0.0){
startTime = currentTime;
previousTime = currentTime;
}else{
deltaT = currentTime - previousTime;
}
runningTime = currentTime - startTime;
runningTime = TimeUnit.NANOSECONDS.toMillis(runningTime);
runningTimeDouble = runningTime/1000.0;
Konvertiert von Nano zu Mikro und nicht zu Milli. Der Grund dafür war, dass meine Daten eine Menge von 0,0 gefunden haben.
deltaT = TimeUnit.NANOSECONDS.toMicros(deltaT);
deltaTDoub = deltaT/1000000.0;
previousTime = currentTime;
Dies ist, wo Geschwindigkeit = Geschwindigkeit + (Beschl) * (Zeitänderung)
velocityComp[0] += accelCompoDoub[0]*deltaTDoub;
velocityComp[1] += accelCompoDoub[1]*deltaTDoub;
velocityComp[2] += accelCompoDoub[2]*deltaTDoub;
Log.i("Velocity", Arrays.toString(velocityComp));
Meine Ergebnisse, wie ich auf der z-Achse des Sensors nach oben mit einer schnellen Geschwindigkeit bin bewegt. Das ist nicht richtig und ich habe versucht, es zu korrigieren. Danke, dass Sie mir geholfen haben. Lassen Sie mich wissen, wenn zusätzliche Informationen benötigt werden.
Ergebnisse von Berechnungen.
I/Velocity: [-0.063722465, -0.132597938, 0.06367645599999999]
I/Velocity: [-7.25024E-4, -0.0018097799999999998, 5.87136E-4]
I/Velocity: [-8.90561E-4, -0.0026836670000000003, 3.80492E-4]
I/Velocity: [-7.223840000000001E-4, -0.002324192, -8.8788E-5]
I/Velocity: [-0.0014603620000000002, -0.0046326660000000006, -0.0013441560000000002]
I/Velocity: [-0.056317518, -0.161929746, -0.10376649000000002]
I/Velocity: [-5.45706E-4, -0.001396428, -0.001515708]
I/Velocity: [-0.00108585, -0.00286045, -0.0047196]
I/Velocity: [-0.001350592, -0.00551372, -0.010952008000000001]
I/Velocity: [-0.027746648999999998, -0.12593060399999997, -0.285394104]
I/Velocity: [-3.4505000000000007E-4, -9.82105E-4, -0.003035925]
I/Velocity: [-3.19982E-4, -0.00120291, -0.004499598]
I/Velocity: [1.67466E-4, -0.001290081, -0.004254081]
I/Velocity: [7.457259999999999E-4, -0.0025310280000000003, -0.007799432000000001]
I/Velocity: [0.016570047999999997, -0.099231992, -0.27039305599999996]
I/Velocity: [-1.6146000000000002E-4, -0.0014244750000000001, -0.00291915]
I/Velocity: [-8.8816E-4, -0.002367105, -0.003107767]
I/Velocity: [-0.001062369, -0.001895124, -0.001395471]
I/Velocity: [-0.0028341610000000004, -0.004603984, -0.001379862]
I/Velocity: [-0.130232, -0.2220188, 0.0293022]
I/Velocity: [-0.00333146, -0.00568062, 0.003315785]
I/Velocity: [-0.00167499, -0.0026628819999999997, 0.002802716]
I/Velocity: [-0.0020831459999999997, -0.0031751069999999995, 0.005024214]
I/Velocity: [-0.001439764, -0.002181253, 0.004799388999999999]
I/Velocity: [-0.12709468599999998, -0.134937772, 0.47205287199999996]
I/Velocity: [-8.29008E-4, -4.7601299999999996E-4, 0.0031751369999999998]
I/Velocity: [-9.500479999999999E-4, -1.14048E-4, 0.0034474880000000003]
I/Velocity: [-0.001443932, 2.46308E-4, 0.00481496]
I/Velocity: [-0.0042386279999999995, 0.001372604, 0.012284638]
I/Velocity: [-0.10745787999999999, 0.025316348, 0.27256053799999996]
I/Velocity: [-9.26115E-4, -5.916E-5, 0.00209409]
I/Velocity: [-0.0018333919999999999, -6.785679999999999E-4, 0.003609672]
I/Velocity: [-5.516159999999999E-4, -3.88362E-4, 9.315279999999998E-4]
I/Velocity: [-0.001341424, -0.001413168, 0.0021391039999999997]
P.S: Ich habe auch versucht, um die Probe zu begrenzen, so dass der deltaT etwa 0,01 Sekunden ist.