Make one euro adjustable via settings
This commit is contained in:
parent
5f839c66a1
commit
d93b5d5eb1
|
@ -43,7 +43,7 @@ BleFingerprint::~BleFingerprint()
|
|||
Serial.printf("%d Del | MAC: %s, ID: %s\n", xPortGetCoreID(), SMacf(address).c_str(), id.c_str());
|
||||
}
|
||||
|
||||
BleFingerprint::BleFingerprint(BLEAdvertisedDevice *advertisedDevice)
|
||||
BleFingerprint::BleFingerprint(BLEAdvertisedDevice *advertisedDevice, float fcmin, float beta, float dcutoff) : oneEuro{one_euro_filter<double, unsigned long>(1, fcmin, beta, dcutoff)}
|
||||
{
|
||||
firstSeenMicros = esp_timer_get_time();
|
||||
address = advertisedDevice->getAddress();
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#ifndef _BLEFINGERPRINT_
|
||||
#define _BLEFINGERPRINT_
|
||||
|
||||
#include <NimBLEDevice.h>
|
||||
#include <NimBLEAdvertisedDevice.h>
|
||||
#include <NimBLEEddystoneURL.h>
|
||||
#include <NimBLEEddystoneTLM.h>
|
||||
#include <NimBLEBeacon.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include <NimBLEAdvertisedDevice.h>
|
||||
#include <NimBLEBeacon.h>
|
||||
#include <NimBLEDevice.h>
|
||||
#include <NimBLEEddystoneTLM.h>
|
||||
#include <NimBLEEddystoneURL.h>
|
||||
#include <SoftFilters.h>
|
||||
|
||||
class BleFingerprint
|
||||
{
|
||||
|
||||
public:
|
||||
BleFingerprint(BLEAdvertisedDevice *advertisedDevice);
|
||||
BleFingerprint(BLEAdvertisedDevice *advertisedDevice, float fcmin, float beta, float dcutoff);
|
||||
~BleFingerprint();
|
||||
|
||||
void seen(BLEAdvertisedDevice *advertisedDevice);
|
||||
|
@ -38,7 +38,7 @@ private:
|
|||
Reading<Differential<float>> output;
|
||||
|
||||
TimestampFilter<float> tsFilter;
|
||||
one_euro_filter<double, unsigned long> oneEuro{one_euro_filter<double, unsigned long>(1, 0.01, 0.01, 1)};
|
||||
one_euro_filter<double, unsigned long> oneEuro;
|
||||
DifferentialFilter<float> diffFilter;
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -83,3 +83,9 @@
|
|||
|
||||
// Number of seconds between update checks
|
||||
#define CHECK_FOR_UPDATES_INTERVAL 300
|
||||
|
||||
#define ONE_EURO_FCMIN 0.05
|
||||
|
||||
#define ONE_EURO_BETA 0.05
|
||||
|
||||
#define ONE_EURO_DCUTOFF 1
|
||||
|
|
|
@ -10,7 +10,7 @@ BleFingerprint *getFingerprintInternal(BLEAdvertisedDevice *advertisedDevice)
|
|||
return *it;
|
||||
}
|
||||
|
||||
auto created = new BleFingerprint(advertisedDevice);
|
||||
auto created = new BleFingerprint(advertisedDevice, ONE_EURO_FCMIN, ONE_EURO_BETA, ONE_EURO_DCUTOFF);
|
||||
auto it2 = std::find_if(fingerprints.begin(), fingerprints.end(), [created](BleFingerprint *f) { return f->getId() == created->getId(); });
|
||||
if (it2 != fingerprints.end())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue