added boxkde resamplin in 2D and 3D
read activity out of sensor offline file
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
|
||||
enum class Activity {
|
||||
|
||||
STANDING,
|
||||
WALKING,
|
||||
|
||||
WALKING,
|
||||
STANDING,
|
||||
|
||||
WALKING_UP,
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Offline {
|
||||
WIFI = 8,
|
||||
BEACON = 9,
|
||||
GPS = 16,
|
||||
ACTIVITY = 50,
|
||||
GROUND_TRUTH = 99,
|
||||
POS = 1001, // IPIN2016
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user