Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing temp waround on npushrotationtick, simplifying and correctin…

…g rotation counter gyro integration
  • Loading branch information...
commit 37437e22f56d4359066c7f557e3bdb76dc45be77 1 parent 42aa391
Clovis Scotti authored
View
7 PushBurton2/npushrotationstick.cpp
@@ -35,6 +35,13 @@ QString NPushRotationsTick::get_pretty_print() const
void NPushRotationsTick::updateCleanDegs()
{
+
+// if(rawDegs > 0) {
+// rawDegs *= 1.3;
+// } else {
+// rawDegs *= 1.4;
+// }
+
if(fabs(rawDegs) > 90.0) {
if(rawDegs > 0)
cleanDegs = ceil(rawDegs/180.0);
View
25 PushBurton2/rotationcounter.cpp
@@ -49,6 +49,7 @@ bool RotationCounter::subscribesTo(PushBurtonGenericDevice* deviceType)
void RotationCounter::incoming_reading(NPushLogTick * tick)
{
+ static double lastMeas = 0.0;
if(typeid(*tick) == typeid(NPushAirTimeTick)) {
NPushAirTimeTick * airTimeTick = (NPushAirTimeTick *)tick;
@@ -61,10 +62,7 @@ void RotationCounter::incoming_reading(NPushLogTick * tick)
afterJumpDecCnter = 0;
for(int i=0;i<PRE_SPIN_BUFFER_SIZE;i++){
-
-// spinAcc += pastSpinBuff[i];
- integrateSpinAcc(pastSpinBuff[i]);
-
+ spinAcc += pastSpinBuff[i];
}
// qDebug() << "Starting at; SpinAcc = " << spinAcc;
@@ -84,8 +82,12 @@ void RotationCounter::incoming_reading(NPushLogTick * tick)
//Which axis are we lookin?
spinInc = ((double)imuTick->gyro[2])/14.375;
- spinInc *= (imuTick->msecsToEpoch - lastTstamp)*0.001;
+ //interpolation
+ spinInc = (spinInc+lastMeas)/2.00;
+ lastMeas = spinInc;
+
+ spinInc *= (imuTick->msecsToEpoch - lastTstamp)*0.001;
}
@@ -93,14 +95,12 @@ void RotationCounter::incoming_reading(NPushLogTick * tick)
if(onAir) {
-// spinAcc += spinInc;
- integrateSpinAcc(spinInc);
+ spinAcc += spinInc;
//emit intermediary rotation tick? if so, emit here.
}
if(afterJumpDecCnter > 0) {
-// spinAcc += spinInc;
- integrateSpinAcc(spinInc);
+ spinAcc += spinInc;
afterJumpDecCnter--;
if(afterJumpDecCnter == 0) {
@@ -114,13 +114,6 @@ void RotationCounter::incoming_reading(NPushLogTick * tick)
}
}
-void RotationCounter::integrateSpinAcc(double meas)
-{
- static double lastMeas = 0.0;
- spinAcc += (meas + lastMeas)/2;
- lastMeas = meas;
-}
-
void RotationCounter::emitRotTick()
{
NPushRotationsTick * newTick = 0;
View
2  PushBurton2/rotationcounter.h
@@ -50,8 +50,6 @@ public slots:
private:
- void integrateSpinAcc(double meas);
-
void emitRotTick();
quint64 lastTstamp;
Please sign in to comment.
Something went wrong with that request. Please try again.