a lot!!! of changes
added main menu added debug display many debug widgets for plotting live data worked on android live sensors added offline-data sensor feeding some dummy data sensors worked on the map display added ui debug for grid-points, particles and weights added a cool dude to display the estimation added real filtering based on the Indoor components c++11 fixes for android compilation online and offline filtering support new resampling technique for testing map loading via dialog
This commit is contained in:
80
ui/debug/plot/Data.h
Normal file
80
ui/debug/plot/Data.h
Normal file
@@ -0,0 +1,80 @@
|
||||
#ifndef PLOT_DATA_H
|
||||
#define PLOT_DATA_H
|
||||
|
||||
#include <vector>
|
||||
#include "Range.h"
|
||||
#include <cmath>
|
||||
|
||||
class Data {
|
||||
|
||||
using Key = float;
|
||||
using Value = float;
|
||||
|
||||
public:
|
||||
|
||||
struct KeyVal {
|
||||
Key key;
|
||||
Value val;
|
||||
KeyVal(const Key& key, const Value& val) : key(key), val(val) {;}
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
/** contained data */
|
||||
std::vector<KeyVal> data;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/** add a new value */
|
||||
void add(const Key key, const Value val) {
|
||||
data.push_back(KeyVal(key,val));
|
||||
}
|
||||
|
||||
/** remove the given index */
|
||||
void remove(const int idx) {
|
||||
data.erase(data.begin()+idx);
|
||||
}
|
||||
|
||||
Key getKey(const int idx) const {
|
||||
return data[idx].key;
|
||||
}
|
||||
|
||||
Value getValue(const int idx) const {
|
||||
return data[idx].val;
|
||||
}
|
||||
|
||||
const KeyVal& getKeyValue(const int idx) const {
|
||||
return data[idx];
|
||||
}
|
||||
|
||||
const KeyVal& operator [] (const int idx) const {
|
||||
return data[idx];
|
||||
}
|
||||
|
||||
const KeyVal& front() const {return data.front();}
|
||||
const KeyVal& back() const {return data.back();}
|
||||
|
||||
/** get the range (min/max) for the key-data (x-axes) */
|
||||
Range getKeyRange() const {
|
||||
Range range(+INFINITY,-INFINITY);
|
||||
for (const KeyVal& kv : data) {range.adjust(kv.key);}
|
||||
return range;
|
||||
}
|
||||
|
||||
/** get the range (min/max) for the value-data (y-axes) */
|
||||
Range getValueRange() const {
|
||||
Range range(+INFINITY,-INFINITY);
|
||||
for (const KeyVal& kv : data) {range.adjust(kv.val);}
|
||||
return range;
|
||||
}
|
||||
|
||||
/** get the number of entries */
|
||||
size_t size() const {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // PLOT_DATA_H
|
||||
Reference in New Issue
Block a user