fixed some small issues regarding museum project
This commit is contained in:
4
main.cpp
4
main.cpp
@@ -99,7 +99,7 @@ int main(int argc, char** argv) {
|
|||||||
//::testing::GTEST_FLAG(filter) = "*Dijkstra.*";
|
//::testing::GTEST_FLAG(filter) = "*Dijkstra.*";
|
||||||
|
|
||||||
//::testing::GTEST_FLAG(filter) = "*LogDistanceCeilingModelBeacon*";
|
//::testing::GTEST_FLAG(filter) = "*LogDistanceCeilingModelBeacon*";
|
||||||
//::testing::GTEST_FLAG(filter) = "*WiFiOptimizer*";
|
::testing::GTEST_FLAG(filter) = "*WiFiOptimizer*";
|
||||||
|
|
||||||
|
|
||||||
//::testing::GTEST_FLAG(filter) = "*Offline.readWrite*";
|
//::testing::GTEST_FLAG(filter) = "*Offline.readWrite*";
|
||||||
@@ -109,7 +109,7 @@ int main(int argc, char** argv) {
|
|||||||
//::testing::GTEST_FLAG(filter) = "*Matrix4*";
|
//::testing::GTEST_FLAG(filter) = "*Matrix4*";
|
||||||
//::testing::GTEST_FLAG(filter) = "*Sphere3*";
|
//::testing::GTEST_FLAG(filter) = "*Sphere3*";
|
||||||
|
|
||||||
::testing::GTEST_FLAG(filter) = "NavMeshD*";
|
//::testing::GTEST_FLAG(filter) = "NavMeshD*";
|
||||||
//::testing::GTEST_FLAG(filter) = "Timestamp*";
|
//::testing::GTEST_FLAG(filter) = "Timestamp*";
|
||||||
|
|
||||||
//::testing::GTEST_FLAG(filter) = "*RayTrace3*";
|
//::testing::GTEST_FLAG(filter) = "*RayTrace3*";
|
||||||
|
|||||||
@@ -23,10 +23,6 @@ public:
|
|||||||
RealArray2D kernelReal;
|
RealArray2D kernelReal;
|
||||||
ComplexArray2D kernelSpectrum;
|
ComplexArray2D kernelSpectrum;
|
||||||
|
|
||||||
|
|
||||||
signal.data().data
|
|
||||||
|
|
||||||
|
|
||||||
//convert image2d single vector to 2d vector, just use pointers
|
//convert image2d single vector to 2d vector, just use pointers
|
||||||
int signal_x = signal.width;
|
int signal_x = signal.width;
|
||||||
int signal_y = signal.height;
|
int signal_y = signal.height;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace NM {
|
|||||||
/** algorithm choice */
|
/** algorithm choice */
|
||||||
SamplePartitionType partitionType = SamplePartitionType::SAMPLE_PARTITION_WATERSHED;
|
SamplePartitionType partitionType = SamplePartitionType::SAMPLE_PARTITION_WATERSHED;
|
||||||
|
|
||||||
float regionMinSize = 8; // (isolated) regions smaller than this will not be rendered?!
|
float regionMinSize = 80; // (isolated) regions smaller than this will not be rendered?!
|
||||||
|
|
||||||
|
|
||||||
const float regionMergeSize = 20; //??
|
const float regionMergeSize = 20; //??
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace NM {
|
|||||||
|
|
||||||
// to-be-walked distance;
|
// to-be-walked distance;
|
||||||
const float toBeWalkedDist = params.getToBeWalkedDistance();
|
const float toBeWalkedDist = params.getToBeWalkedDistance();
|
||||||
const float toBeWalkedDistSafe = 0.75 + toBeWalkedDist * 1.1;
|
const float toBeWalkedDistSafe = 0.75 + toBeWalkedDist * 1.1;
|
||||||
|
|
||||||
// construct reachable region
|
// construct reachable region
|
||||||
NavMeshSub<Tria> reachable(params.start, toBeWalkedDistSafe);
|
NavMeshSub<Tria> reachable(params.start, toBeWalkedDistSafe);
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ namespace SMC {
|
|||||||
void updateTransitionOnly(const Control* control) {
|
void updateTransitionOnly(const Control* control) {
|
||||||
|
|
||||||
// sanity checks (if enabled)
|
// sanity checks (if enabled)
|
||||||
Assert::isNotNull(transition, "transition MUST not be null! call setTransition() first!");
|
Assert::isNotNull(transition, "transition MUST not be null! call setTransition() first!");
|
||||||
|
|
||||||
// perform the transition step
|
// perform the transition step
|
||||||
transition->transition(particles, control);
|
transition->transition(particles, control);
|
||||||
@@ -171,9 +171,9 @@ namespace SMC {
|
|||||||
State updateEvaluationOnly(const Observation& observation) {
|
State updateEvaluationOnly(const Observation& observation) {
|
||||||
|
|
||||||
// sanity checks (if enabled)
|
// sanity checks (if enabled)
|
||||||
Assert::isNotNull(resampler, "resampler MUST not be null! call setResampler() first!");
|
Assert::isNotNull(resampler, "resampler MUST not be null! call setResampler() first!");
|
||||||
Assert::isNotNull(evaluation, "evaluation MUST not be null! call setEvaluation() first!");
|
Assert::isNotNull(evaluation, "evaluation MUST not be null! call setEvaluation() first!");
|
||||||
Assert::isNotNull(estimation, "estimation MUST not be null! call setEstimation() first!");
|
Assert::isNotNull(estimation, "estimation MUST not be null! call setEstimation() first!");
|
||||||
|
|
||||||
// perform the evaluation step and calculate the sum of all particle weights
|
// perform the evaluation step and calculate the sum of all particle weights
|
||||||
evaluation->evaluation(particles, observation);
|
evaluation->evaluation(particles, observation);
|
||||||
@@ -184,13 +184,13 @@ namespace SMC {
|
|||||||
//Assert::isNotNull(weightSum, "sum of all particle weights (returned from eval) is 0.0!");
|
//Assert::isNotNull(weightSum, "sum of all particle weights (returned from eval) is 0.0!");
|
||||||
|
|
||||||
// normalize the particle weights and thereby calculate N_eff
|
// normalize the particle weights and thereby calculate N_eff
|
||||||
const double neff = normalize();
|
const double neff = normalize();
|
||||||
|
|
||||||
// estimate the current state
|
// estimate the current state
|
||||||
const State est = estimation->estimate(particles);
|
const State est = estimation->estimate(particles);
|
||||||
|
|
||||||
// if the number of efficient particles is too low, perform resampling
|
// if the number of efficient particles is too low, perform resampling
|
||||||
if (neff < particles.size() * nEffThresholdPercent) { resampler->resample(particles); }
|
if (neff < particles.size() * nEffThresholdPercent) { resampler->resample(particles); }
|
||||||
|
|
||||||
// done
|
// done
|
||||||
return est;
|
return est;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "ParticleFilterResampling.h"
|
#include "ParticleFilterResampling.h"
|
||||||
#include "../../ParticleAssertions.h"
|
#include "../../ParticleAssertions.h"
|
||||||
|
#include "../../../Assertions.h"
|
||||||
|
|
||||||
int fuck_off = 0;
|
int fuck_off = 0;
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ namespace SMC {
|
|||||||
|
|
||||||
|
|
||||||
void resample(std::vector<Particle<State>>& particles) override{
|
void resample(std::vector<Particle<State>>& particles) override{
|
||||||
|
Assert::doThrow("lol, nothing happens here. Get out!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void resample(std::vector<Particle<State>>& particles, double kld, std::vector<Particle<State>>& particlesWifi) override {
|
void resample(std::vector<Particle<State>>& particles, double kld, std::vector<Particle<State>>& particlesWifi) override {
|
||||||
@@ -101,7 +102,7 @@ namespace SMC {
|
|||||||
Particle<State> posteriorParticle = draw(cumWeight);
|
Particle<State> posteriorParticle = draw(cumWeight);
|
||||||
Particle<State> wifiParticle = drawWifi(cumWeightWifi);
|
Particle<State> wifiParticle = drawWifi(cumWeightWifi);
|
||||||
|
|
||||||
posteriorParticle.state.position = wifiParticle.state.position;
|
posteriorParticle.state.pos.pos = wifiParticle.state.pos.pos;
|
||||||
particles[i] = posteriorParticle;
|
particles[i] = posteriorParticle;
|
||||||
} else {
|
} else {
|
||||||
particles[i] = draw(cumWeight);
|
particles[i] = draw(cumWeight);
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ namespace SMC {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/** ctor */
|
/** ctor */
|
||||||
ParticleFilterResamplingKLD(double delta = 0.01, double epsilon = 0.13, uint32_t N_max = 25000) : delta(delta), epsilon(epsilon), N_max(N_max) {
|
ParticleFilterResamplingKLD(double delta = 0.01, double epsilon = 0.13, uint32_t N_max = 10000) : delta(delta), epsilon(epsilon), N_max(N_max) {
|
||||||
gen.seed(RANDOM_SEED);
|
gen.seed(RANDOM_SEED);
|
||||||
|
|
||||||
bins.setBinSizes({0.01, 0.01, 0.2, 0.3});
|
bins.setBinSizes({0.01, 0.01, 0.2});
|
||||||
bins.setRanges({BinningRange(-1,100), BinningRange(-10,60), BinningRange(-1,15), BinningRange(0, 2 * M_PI)});
|
bins.setRanges({BinningRange(-1,100), BinningRange(-10,60), BinningRange(-1,15)});
|
||||||
}
|
}
|
||||||
|
|
||||||
void resample(std::vector<Particle<State>>& particles) override {
|
void resample(std::vector<Particle<State>>& particles) override {
|
||||||
|
|||||||
Reference in New Issue
Block a user