diff --git a/grid/walk/v2/modules/WalkModuleActivityControl.h b/grid/walk/v2/modules/WalkModuleActivityControl.h index 95121ed..075f54b 100644 --- a/grid/walk/v2/modules/WalkModuleActivityControl.h +++ b/grid/walk/v2/modules/WalkModuleActivityControl.h @@ -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: diff --git a/main.cpp b/main.cpp index e7b4eeb..3c2ccd8 100755 --- a/main.cpp +++ b/main.cpp @@ -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*"; diff --git a/sensors/activity/ActivityButterPressure.h b/sensors/activity/ActivityButterPressure.h index 5c9adbf..0dbc19d 100644 --- a/sensors/activity/ActivityButterPressure.h +++ b/sensors/activity/ActivityButterPressure.h @@ -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 diff --git a/sensors/activity/ActivityDetector.h b/sensors/activity/ActivityDetector.h index b85ed4b..7cf90dd 100644 --- a/sensors/activity/ActivityDetector.h +++ b/sensors/activity/ActivityDetector.h @@ -41,8 +41,8 @@ private: MovingStdDevTS stdDev; MovingStdDevTS stdDev2; - MovingAverageTS baroAvgSlow; - MovingAverageTS baroAvgFast; + //MovingAverageTS baroAvgSlow; + //MovingAverageTS baroAvgFast; MovingAverageTS baroAvg; HistoryTS baroHistory;