added boxkde resamplin in 2D and 3D

read activity out of sensor offline file
This commit is contained in:
toni
2018-11-24 17:09:41 +01:00
parent 9388e6e725
commit 1dac907004
13 changed files with 180 additions and 48 deletions

View File

@@ -3,9 +3,9 @@
enum class Activity {
STANDING,
WALKING,
WALKING,
STANDING,
WALKING_UP,

View File

@@ -43,6 +43,7 @@ namespace Offline {
/** all entries grouped by sensor */
std::vector<TS<int>> groundTruth;
std::vector<TS<int>> activity;
std::vector<TS<WiFiMeasurements>> wifi;
std::vector<TS<BeaconMeasurement>> beacon;
std::vector<TS<AccelerometerData>> acc;
@@ -95,6 +96,7 @@ namespace Offline {
const std::vector<Entry>& getEntries() const {return entries;}
const std::vector<TS<int>>& getActivity() const {return activity;}
const std::vector<TS<int>>& getGroundTruth() const {return groundTruth;}
@@ -187,6 +189,7 @@ namespace Offline {
else if (idx == (int)Sensor::COMPASS) {parseCompass(ts,data);}
else if (idx == (int)Sensor::GPS) {parseGPS(ts,data);}
else if (idx == (int)Sensor::MAGNETOMETER) {parseMagnetometer(ts,data);}
else if (idx == (int)Sensor::ACTIVITY) {parseActivity(ts, data);}
// TODO: this is a hack...
// the loop is called one additional time after the last entry
@@ -327,6 +330,20 @@ namespace Offline {
}
void parseActivity(const uint64_t ts, const std::string& data) {
const auto pos1 = data.find(';');
const auto pos2 = data.find(';', pos1+1);
const std::string string = data.substr(0, pos1);
const std::string id = data.substr(pos1+1, pos2);
TS<int> elem(ts, std::stoi(id));
activity.push_back(elem);
entries.push_back(Entry(Sensor::ACTIVITY, ts, activity.size()-1));
}
void parseBarometer(const uint64_t ts, const std::string& data) {
BarometerData baro;

View File

@@ -14,6 +14,7 @@ namespace Offline {
WIFI = 8,
BEACON = 9,
GPS = 16,
ACTIVITY = 50,
GROUND_TRUTH = 99,
POS = 1001, // IPIN2016
};