fixed activity enum problems

This commit is contained in:
toni
2017-10-24 18:42:21 +02:00
parent 0151a4f6e4
commit 5d6d62c2d2
4 changed files with 13 additions and 15 deletions

View File

@@ -6,7 +6,7 @@
#include "../../../../geo/Heading.h"
#include "../../../../math/Distributions.h"
#include "../../../../sensors/pressure/ActivityButterPressure.h"
#include "../../../../sensors/activity/ActivityButterPressure.h"
/**
@@ -74,20 +74,20 @@ public:
const int deltaZ_cm = potentialNode.z_cm - curNode.z_cm;
// TODO: general activity enum and activity-detector based on barometer and accelerometer?
const ActivityButterPressure::Activity activity = ctrl->activity;
const Activity activity = ctrl->activity;
// const float kappa = 0.75;
switch (activity) {
case ActivityButterPressure::Activity::DOWN:
case Activity::WALKING_DOWN:
if (deltaZ_cm < 0) {return 0.60;}
if (deltaZ_cm == 0) {return 0.25;}
{return 0.15;}
case ActivityButterPressure::Activity::UP:
case Activity::WALKING_UP:
if (deltaZ_cm > 0) {return 0.60;}
if (deltaZ_cm == 0) {return 0.25;}
{return 0.15;}
case ActivityButterPressure::Activity::STAY:
case Activity::WALKING:
if (deltaZ_cm == 0) {return 0.60;}
{return 0.40;}
// case ActivityButterPressure::Activity::DOWN:

View File

@@ -109,7 +109,7 @@ int main(int argc, char** argv) {
//::testing::GTEST_FLAG(filter) = "*Matrix4*";
//::testing::GTEST_FLAG(filter) = "*Sphere3*";
::testing::GTEST_FLAG(filter) = "WiFiVAPGrouper*";
::testing::GTEST_FLAG(filter) = "WiFiVAPGrouper*";
//::testing::GTEST_FLAG(filter) = "Timestamp*";
//::testing::GTEST_FLAG(filter) = "*RayTrace3*";

View File

@@ -50,13 +50,13 @@ public:
/** ctor */
ActivityButterPressure() : currentActivity(STAY){
ActivityButterPressure() : currentActivity(Activity::STANDING){
;
}
/** add new sensor readings that were received at the given timestamp */
Activity add(const Timestamp& ts, const BarometerData& baro) {
void add(const Timestamp& ts, const BarometerData& baro) {
//init
static bool firstCall = false;
@@ -65,7 +65,7 @@ public:
firstCall = true;
butter2.stepInitialization(0);
return STAY;
currentActivity = Activity::STANDING;
}
bool newInterpolatedValues = false;
@@ -123,14 +123,12 @@ public:
}
}
return currentActivity;
}
/** get the current Activity */
Activity getCurrentActivity() {
Activity get() const {
return currentActivity;
}
}
};
#endif // ACTIVITYBUTTERPRESSURE_H

View File

@@ -41,8 +41,8 @@ private:
MovingStdDevTS<float> stdDev;
MovingStdDevTS<float> stdDev2;
MovingAverageTS<float> baroAvgSlow;
MovingAverageTS<float> baroAvgFast;
//MovingAverageTS<float> baroAvgSlow;
//MovingAverageTS<float> baroAvgFast;
MovingAverageTS<float> baroAvg;
HistoryTS<float> baroHistory;