added missing code-changes (mainly eval)
This commit is contained in:
@@ -41,6 +41,9 @@ public:
|
||||
vis.estPath.clear();
|
||||
vis.particles.clear();
|
||||
vis.particles.add(K::GnuplotPoint3(this->centerOfMass.x, this->centerOfMass.y, this->centerOfMass.z));
|
||||
const int advance = this->stdDevDist / grid.getGridSize_cm();
|
||||
const T& d = *this->path->getFromStart(advance).element;
|
||||
vis.particles.add(K::GnuplotPoint3(d.x_cm, d.y_cm, d.z_cm));
|
||||
for (int i = 0; i < (int)this->path->size()-1; ++i) {
|
||||
const DijkstraNode<T>& dn1 = (*this->path)[i+0];
|
||||
const DijkstraNode<T>& dn2 = (*this->path)[i+1];
|
||||
|
||||
@@ -243,6 +243,10 @@ public:
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void bergwerk_path1_nexus_simple() {
|
||||
|
||||
runName = "bergwerk_path1_nexus_simple";
|
||||
@@ -253,11 +257,385 @@ public:
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path1/nexus/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path1dbl);
|
||||
|
||||
for (auto& n : grid) {n.imp = 1;}
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void bergwerk_path1_nexus_imp() {
|
||||
|
||||
runName = "bergwerk_path1_nexus_importance";
|
||||
|
||||
BarometerEvaluation::barometerSigma = 0.10;
|
||||
sr = new SensorReader("./measurements/bergwerk/path1/nexus/vor/1454775984079.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path1/nexus/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path1/nexus/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path1dbl);
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path1_nexus_multi() {
|
||||
|
||||
runName = "bergwerk_path1_nexus_multi";
|
||||
|
||||
BarometerEvaluation::barometerSigma = 0.10;
|
||||
sr = new SensorReader("./measurements/bergwerk/path1/nexus/vor/1454775984079.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path1/nexus/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path1/nexus/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path1dbl);
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path1dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path1_nexus_shortest() {
|
||||
|
||||
runName = "bergwerk_path1_nexus_shortest";
|
||||
|
||||
BarometerEvaluation::barometerSigma = 0.10;
|
||||
sr = new SensorReader("./measurements/bergwerk/path1/nexus/vor/1454775984079.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path1/nexus/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path1/nexus/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path1dbl);
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path1dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
void bergwerk_path2_nexus() {
|
||||
BarometerEvaluation::barometerSigma = 0.10;
|
||||
sr = new SensorReader("./measurements/bergwerk/path2/nexus/vor/1454779863041.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path2/nexus/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path2/nexus/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path2dbl);
|
||||
}
|
||||
|
||||
void bergwerk_path2_nexus_simple() {
|
||||
|
||||
runName = "bergwerk_path2_nexus_simple";
|
||||
bergwerk_path2_nexus();
|
||||
for (auto& n : grid) {n.imp = 1;} // remove importance
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void bergwerk_path2_nexus_imp() {
|
||||
|
||||
runName = "bergwerk_path2_nexus_importance";
|
||||
bergwerk_path2_nexus();
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path2_nexus_multi() {
|
||||
|
||||
runName = "bergwerk_path2_nexus_multi";
|
||||
bergwerk_path2_nexus();
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path2dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path2_nexus_shortest() {
|
||||
|
||||
runName = "bergwerk_path2_nexus_shortest";
|
||||
bergwerk_path2_nexus();
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path2dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
walk->times = 4;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
void bergwerk_path3_nexus() {
|
||||
BarometerEvaluation::barometerSigma = 0.10;
|
||||
sr = new SensorReader("./measurements/bergwerk/path3/nexus/vor/1454782562231.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path3/nexus/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path3/nexus/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path3dbl);
|
||||
}
|
||||
|
||||
void bergwerk_path3_nexus_simple() {
|
||||
|
||||
runName = "bergwerk_path3_nexus_simple";
|
||||
bergwerk_path3_nexus();
|
||||
for (auto& n : grid) {n.imp = 1;} // remove importance
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void bergwerk_path3_nexus_imp() {
|
||||
|
||||
runName = "bergwerk_path3_nexus_importance";
|
||||
bergwerk_path3_nexus();
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path3_nexus_multi() {
|
||||
|
||||
runName = "bergwerk_path3_nexus_multi";
|
||||
bergwerk_path3_nexus();
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path3dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path3_nexus_shortest() {
|
||||
|
||||
runName = "bergwerk_path3_nexus_shortest";
|
||||
bergwerk_path3_nexus();
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path3dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
void bergwerk_path4_nexus() {
|
||||
BarometerEvaluation::barometerSigma = 0.10;
|
||||
sr = new SensorReader("./measurements/bergwerk/path4/nexus/vor/1454776525797.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path4/nexus/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path4/nexus/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path4dbl);
|
||||
//for (const K::Particle<MyState>& _p : pf->getParticles()) {
|
||||
// K::Particle<MyState>& p = (K::Particle<MyState>&) _p;
|
||||
// p.state.pCur = floors.gtwp[path4dbl.front()];
|
||||
// p.state.pOld = p.state.pCur;
|
||||
// p.state.walkState.node = grid.getNodePtrFor( conv(p.state.pCur) );
|
||||
// p.state.walkState.heading = Angle::degToRad(90);
|
||||
//}
|
||||
}
|
||||
|
||||
void bergwerk_path4_nexus_simple() {
|
||||
|
||||
runName = "bergwerk_path4_nexus_simple";
|
||||
bergwerk_path4_nexus();
|
||||
for (auto& n : grid) {n.imp = 1;} // remove importance
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void bergwerk_path4_nexus_imp() {
|
||||
|
||||
runName = "bergwerk_path4_nexus_importance";
|
||||
bergwerk_path4_nexus();
|
||||
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path4_nexus_multi() {
|
||||
|
||||
runName = "bergwerk_path4_nexus_multi";
|
||||
bergwerk_path4_nexus();
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
void bergwerk_path4_nexus_shortest() {
|
||||
|
||||
runName = "bergwerk_path4_nexus_shortest";
|
||||
bergwerk_path4_nexus();
|
||||
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
void bergwerk_path1_galaxy() {
|
||||
BarometerEvaluation::barometerSigma = 0.20;
|
||||
stepSize = 0.9;
|
||||
sr = new SensorReader("./measurements/bergwerk/path1/galaxy/vor/1454776168794.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path1/galaxy/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path1/galaxy/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path1dbl);
|
||||
}
|
||||
|
||||
void bergwerk_path1_galaxy_simple() {
|
||||
runName = "bergwerk_path1_galaxy_simple";
|
||||
bergwerk_path1_galaxy();
|
||||
for (auto& n : grid) {n.imp = 1;} // remove importance
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path1_galaxy_multi() {
|
||||
runName = "bergwerk_path1_galaxy_multi";
|
||||
bergwerk_path1_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path1dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path1_galaxy_shortest() {
|
||||
runName = "bergwerk_path1_galaxy_shortest";
|
||||
bergwerk_path1_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path1dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
void bergwerk_path2_galaxy() {
|
||||
BarometerEvaluation::barometerSigma = 0.20;
|
||||
stepSize = 0.9;
|
||||
sr = new SensorReader("./measurements/bergwerk/path2/galaxy/vor/1454780113404.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path2/galaxy/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path2/galaxy/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path2dbl);
|
||||
}
|
||||
|
||||
void bergwerk_path2_galaxy_simple() {
|
||||
runName = "bergwerk_path2_galaxy_simple";
|
||||
bergwerk_path2_galaxy();
|
||||
for (auto& n : grid) {n.imp = 1;} // remove importance
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path2_galaxy_multi() {
|
||||
runName = "bergwerk_path2_galaxy_multi";
|
||||
bergwerk_path2_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path2dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path2_galaxy_shortest() {
|
||||
runName = "bergwerk_path2_galaxy_shortest";
|
||||
bergwerk_path2_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path2dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
void bergwerk_path3_galaxy() {
|
||||
BarometerEvaluation::barometerSigma = 0.20;
|
||||
stepSize = 0.9;
|
||||
sr = new SensorReader("./measurements/bergwerk/path3/galaxy/vor/1454782896548.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path3/galaxy/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path3/galaxy/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path3dbl);
|
||||
}
|
||||
|
||||
void bergwerk_path3_galaxy_simple() {
|
||||
runName = "bergwerk_path3_galaxy_simple";
|
||||
bergwerk_path3_galaxy();
|
||||
for (auto& n : grid) {n.imp = 1;} // remove importance
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path3_galaxy_multi() {
|
||||
runName = "bergwerk_path3_galaxy_multi";
|
||||
bergwerk_path3_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path3dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path3_galaxy_shortest() {
|
||||
runName = "bergwerk_path3_galaxy_shortest";
|
||||
bergwerk_path3_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path3dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
void bergwerk_path4_galaxy() {
|
||||
BarometerEvaluation::barometerSigma = 0.20;
|
||||
stepSize = 0.9;
|
||||
sr = new SensorReader("./measurements/bergwerk/path4/galaxy/vor/1454779020844.csv"); // forward
|
||||
srt = new SensorReaderTurn("./measurements/bergwerk/path4/galaxy/vor/Turns.txt");
|
||||
srs = new SensorReaderStep("./measurements/bergwerk/path4/galaxy/vor/Steps2.txt");
|
||||
gtw = getGroundTruthWay(*sr, floors.gtwp, path4dbl);
|
||||
}
|
||||
|
||||
void bergwerk_path4_galaxy_simple() {
|
||||
runName = "bergwerk_path4_galaxy_simple";
|
||||
bergwerk_path4_galaxy();
|
||||
for (auto& n : grid) {n.imp = 1;} // remove importance
|
||||
GridWalkSimpleControl<MyGridNode>* walk = new GridWalkSimpleControl<MyGridNode>();
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path4_galaxy_multi() {
|
||||
runName = "bergwerk_path4_galaxy_multi";
|
||||
bergwerk_path4_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) );
|
||||
GridWalkPathControl<MyGridNode>* walk = new GridWalkPathControl<MyGridNode>(grid, DijkstraMapper(grid), end);
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
}
|
||||
|
||||
void bergwerk_path4_galaxy_shortest() {
|
||||
|
||||
runName = "bergwerk_path4_galaxy_shortest";
|
||||
bergwerk_path4_galaxy();
|
||||
MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) );
|
||||
DebugShortestPath<MyGridNode>* walk = new DebugShortestPath<MyGridNode>(grid, DijkstraMapper(grid), end, this->floors);
|
||||
//walk->times = 2;
|
||||
walk->pOther = 0.15;
|
||||
pf->setTransition( std::unique_ptr<MyTransition>( new MyTransition(grid, *walk)) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
#include "../frank/BeaconSensorReader.h"
|
||||
#include "../frank/OrientationSensorReader.h"
|
||||
|
||||
|
||||
#include <Indoor/misc/Time.h>
|
||||
|
||||
class EvalBase {
|
||||
|
||||
protected:
|
||||
@@ -64,9 +67,11 @@ protected:
|
||||
std::vector<int> path4 = {29, 28, 27, 32, 33, 34, 35, 36, 10, 9, 8, 22, 37, 38, 39, 40, 41, 42, 43, 44};
|
||||
std::vector<int> path4dbl = {29, 29, 28, 27, 32, 33, 34, 35, 36, 10, 9, 8, 22, 37, 38, 39, 40, 41, 42, 43, 44}; // duplicate 1st waypoint!
|
||||
|
||||
float stepSize = 0.71;
|
||||
|
||||
public:
|
||||
|
||||
EvalBase() : grid(MiscSettings::gridSize_cm), floors(Helper::getFloors()) {
|
||||
EvalBase() : grid(MiscSettings::gridSize_cm), floors(Helper::getFloors(grid)) {
|
||||
|
||||
// build the grid
|
||||
Helper::buildTheGrid(grid, floors);
|
||||
@@ -173,9 +178,11 @@ public:
|
||||
uint64_t lastTransitionTS = 0;
|
||||
int64_t start_time = -1;
|
||||
|
||||
K::Statistics<float> statsTime;
|
||||
K::Statistics<double> stats;
|
||||
int cnt = 0;
|
||||
|
||||
std::vector<float> errors;
|
||||
|
||||
// process each single sensor reading
|
||||
while(sr->hasNext()) {
|
||||
@@ -225,7 +232,7 @@ public:
|
||||
while (!step_observations.empty() && current_time > step_observations.front().ts) {
|
||||
const StepObservation _so = step_observations.front(); step_observations.pop_front(); (void) _so;
|
||||
obs.step->steps++;
|
||||
ctrl.walked_m = obs.step->steps * 0.71;
|
||||
ctrl.walked_m = obs.step->steps * stepSize;
|
||||
}
|
||||
|
||||
// process all occurred steps
|
||||
@@ -241,6 +248,8 @@ public:
|
||||
// time for a transition?
|
||||
if (se.ts - lastTransitionTS > MiscSettings::timeSteps) {
|
||||
|
||||
auto tick1 = Time::tick();
|
||||
|
||||
lastTransitionTS = se.ts;
|
||||
|
||||
// timed updates
|
||||
@@ -252,16 +261,25 @@ public:
|
||||
const Point3 curEst = est.pCur;
|
||||
|
||||
// error calculation. compare ground-truth to estimation
|
||||
const int offset = 750;
|
||||
const int offset = 0;
|
||||
const Point3 curGT = gtw.getPosAtTime(se.ts - offset);
|
||||
const Point3 diff = curEst - curGT;
|
||||
|
||||
auto tick2 = Time::tick();
|
||||
float diffTime = Time::diffMS(tick1, tick2) * 1.25f;
|
||||
statsTime.add(diffTime);
|
||||
std::cout << "#" << statsTime.getAvg() << "\t" << diffTime << std::endl;
|
||||
|
||||
// skip the first 10 scans due to uniform distribution start
|
||||
if (++cnt > 10) {
|
||||
|
||||
pathEst.push_back(curEst);
|
||||
const float err = diff.length();
|
||||
stats.add(err);
|
||||
std::cout << stats.asString() << std::endl;
|
||||
errors.push_back(err);
|
||||
|
||||
// skip the first 24 scans due to uniform distribution start (12 seconds)
|
||||
if (++cnt > 24) {
|
||||
stats.add(err);
|
||||
std::cout << stats.asString() << std::endl;
|
||||
}
|
||||
|
||||
// plot
|
||||
@@ -287,17 +305,55 @@ public:
|
||||
//Point2 p2 = p1 + Angle::getPointer(obs.orientation.values[0]) * 0.05;
|
||||
vis.gp << "set arrow 999 from screen " << p1.x<<","<<p1.y << " to screen " << p2.x<<","<<p2.y<<"\n";
|
||||
|
||||
vis.show();
|
||||
|
||||
// prevent gnuplot errors
|
||||
usleep(1000*333);
|
||||
static int dspCnt = 0;
|
||||
if (++dspCnt > 0) {
|
||||
vis.show();
|
||||
usleep(1000*33); // prevent gnuplot errors
|
||||
dspCnt = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
sleep(1000);
|
||||
// append error for each run to a file
|
||||
std::ofstream oTError("/tmp/errors.txt", std::ios_base::app);
|
||||
oTError << runName << "\n\t"; stats.appendTo(oTError); oTError << "\n\n";
|
||||
oTError.close();
|
||||
|
||||
// detailled error-description
|
||||
std::ofstream oError("/tmp/err_" + runName + ".dat");
|
||||
for (float f : errors) {oError << f << "\n";}
|
||||
oError.close();
|
||||
|
||||
// plot-data
|
||||
std::ofstream oPath("/tmp/path_" + runName + ".dat"); vis.groundTruth.addDataTo(oPath); oPath.close();
|
||||
std::ofstream oEst("/tmp/est_" + runName + ".dat"); vis.estPath.addDataTo(oEst); oEst.close();
|
||||
std::ofstream oFloor("/tmp/floors.dat"); vis.floors.addDataTo(oFloor); oFloor.close();
|
||||
|
||||
std::ofstream oPlot("/tmp/plot_" + runName + ".gp");
|
||||
|
||||
oPlot << "set terminal eps size 3.4,2\n";
|
||||
oPlot << "set output '" << runName << ".eps'\n";
|
||||
oPlot << "set termoption dashlength 0.5\n";
|
||||
|
||||
oPlot << "set ticslevel 0\n";
|
||||
oPlot << "set view equal xy\n";
|
||||
oPlot << "set zrange [0:2200]\n";
|
||||
oPlot << "set multiplot layout 1,1 scale 2.7,2.7 offset 0,0.23\n";
|
||||
oPlot << "set view 72,33\n";
|
||||
|
||||
oPlot << "unset border\n";
|
||||
oPlot << "unset xtics\n";
|
||||
oPlot << "unset ytics\n";
|
||||
oPlot << "unset ztics\n";
|
||||
|
||||
oPlot << "splot \\\n";
|
||||
oPlot << "'floors.dat' skip 21 notitle with lines lc rgb '#777777', \\\n";
|
||||
oPlot << "'path_bergwerk_path2_nexus_shortest.dat' skip 21 notitle with lines lw 2.5 dashtype 2 lc rgb '#007700', \\\n";
|
||||
oPlot << "'est_bergwerk_path2_nexus_shortest.dat' skip 21 notitle with lines lw 2.5 lc rgb '#000099' ";
|
||||
|
||||
oPlot.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,35 +16,68 @@ class PaperPlot {
|
||||
|
||||
public:
|
||||
|
||||
struct Size {
|
||||
float w;
|
||||
float h;
|
||||
Size(const float w, const float h) : w(w), h(h) {;}
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
|
||||
std::string file;
|
||||
K::Gnuplot gp;
|
||||
K::GnuplotSplot plot;
|
||||
|
||||
K::GnuplotSplotElementLines floors;
|
||||
K::GnuplotSplotElementColorPoints nodes;
|
||||
K::GnuplotSplotElementLines edges;
|
||||
K::GnuplotSplotElementLines edgesSame;
|
||||
K::GnuplotSplotElementLines edgesStair;
|
||||
|
||||
public:
|
||||
|
||||
PaperPlot(const std::string& file, Size s) : file(file) {
|
||||
toFile(file, s);
|
||||
setup();
|
||||
}
|
||||
|
||||
PaperPlot() {
|
||||
setup();
|
||||
}
|
||||
|
||||
void toFile(const std::string& file, const Size s) {
|
||||
gp << "set output '" << file << "'\n";
|
||||
gp << "set terminal eps size " << s.w << "," << s.h << "\n";
|
||||
}
|
||||
|
||||
void setup() {
|
||||
|
||||
floors.setLineWidth(2);
|
||||
|
||||
plot.add(&edges);
|
||||
plot.add(&edgesSame);
|
||||
plot.add(&edgesStair);
|
||||
|
||||
plot.add(&nodes);
|
||||
plot.add(&floors);
|
||||
|
||||
nodes.setPointSize(0.7);
|
||||
edges.setColorHex("#555555");
|
||||
nodes.setPointSize(0.2);
|
||||
|
||||
edgesSame.setColorHex("#555555");
|
||||
edgesStair.setColorHex("#AAAA55");
|
||||
|
||||
|
||||
gp << "set ticslevel 0\n";
|
||||
|
||||
|
||||
//gp << "set zrange [0:0]\n";
|
||||
|
||||
}
|
||||
|
||||
void show() {
|
||||
gp.draw(plot);
|
||||
if (file.length() != 0) {
|
||||
std::string dataFile = file + ".dat";
|
||||
std::ofstream os(dataFile.c_str());
|
||||
os << gp.getBuffer();
|
||||
os.close();
|
||||
}
|
||||
gp.flush();;
|
||||
}
|
||||
|
||||
@@ -95,7 +128,7 @@ public:
|
||||
}
|
||||
|
||||
/** show all nodes (and edges?) within the given region */
|
||||
template <typename T> void debugGrid(Grid<T>& grid, const BBox3& bbox, const bool addNodes, const bool addEdges) {
|
||||
template <typename T> void debugGrid(Grid<T>& grid, const BBox3& bbox, const bool addNodes, const bool addEdges, const bool addAllEdges = false) {
|
||||
|
||||
std::set<uint64_t> used;
|
||||
|
||||
@@ -107,10 +140,11 @@ public:
|
||||
}
|
||||
if (addEdges) {
|
||||
for (const T& n2 : grid.neighbors(n1)) {
|
||||
if (n1.z_cm == n2.z_cm) {continue;} // speedup
|
||||
if (n1.z_cm == n2.z_cm && !addAllEdges) {continue;} // speedup
|
||||
if (used.find(n2.getIdx()) == used.end()) {
|
||||
const K::GnuplotPoint3 p2(n2.x_cm, n2.y_cm, n2.z_cm);
|
||||
edges.addSegment(p1, p2);
|
||||
if (p1.z != p2.z) {edgesStair.addSegment(p1, p2);}
|
||||
else {edgesSame.addSegment(p1, p2);}
|
||||
}
|
||||
}
|
||||
used.insert(n1.getIdx());
|
||||
|
||||
@@ -27,13 +27,47 @@ class PaperVisGrid {
|
||||
public:
|
||||
|
||||
|
||||
static void show() {
|
||||
|
||||
// the grid
|
||||
Grid<MyGridNode> grid(40);
|
||||
|
||||
// floors
|
||||
Helper::FHWSFloors floors = Helper::getFloors(grid);
|
||||
Helper::buildTheGrid(grid, floors);
|
||||
|
||||
PaperPlot plot("/tmp/grid.eps", PaperPlot::Size(4,3));
|
||||
|
||||
// stairwell low left
|
||||
{BBox3 bbox;
|
||||
bbox.add(Point3(1300, 650,160));
|
||||
bbox.add(Point3(2000,1300,floors.h2.cm()));
|
||||
plot.debugGrid(grid, bbox, true, true, true);}
|
||||
plot.addFloor(floors.f1, floors.h1);
|
||||
plot.addFloor(floors.f2, floors.h2);
|
||||
|
||||
plot.gp << "set view 64, 300\n";
|
||||
plot.gp << "unset cbrange\n";
|
||||
plot.gp << "unset colorbox\n";
|
||||
plot.gp << "unset xtics\n";
|
||||
plot.gp << "unset ytics\n";
|
||||
plot.gp << "unset ztics\n";
|
||||
plot.gp << "unset border\n";
|
||||
plot.gp << "set xrange[1250:2050]\n";
|
||||
plot.gp << "set yrange[600:1350]\n";
|
||||
plot.gp << "set hidden3d front\n";
|
||||
|
||||
plot.show();
|
||||
|
||||
}
|
||||
|
||||
static void showStairs() {
|
||||
|
||||
// the grid
|
||||
Grid<MyGridNode> grid(20);
|
||||
|
||||
// floors
|
||||
Helper::FHWSFloors floors = Helper::getFloors();
|
||||
Helper::FHWSFloors floors = Helper::getFloors(grid);
|
||||
Helper::buildTheGrid(grid, floors);
|
||||
|
||||
// // load the floorplan
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
#include "../Settings.h"
|
||||
#include "../DijkstraMapper.h"
|
||||
|
||||
PaperPlot2D::Size s1 = PaperPlot2D::Size(2,4);
|
||||
PaperPlot2D::Size s1 = PaperPlot2D::Size(4,1.5);
|
||||
PaperPlot2D::Size s2 = PaperPlot2D::Size(4,1.7);
|
||||
|
||||
class PaperVisImportance {
|
||||
|
||||
@@ -79,9 +80,11 @@ public:
|
||||
|
||||
{
|
||||
PaperPlot2D plot("floorplan_importance.eps", s1);
|
||||
plot.setRanges(0,2100, 0,5100);
|
||||
plot.addFloor(f0);
|
||||
plot.setRanges(0,5100, 0,2100);
|
||||
//plot.addFloor(f0);
|
||||
plot.addGrid(grid, ColorizerImp());
|
||||
plot.gp << "set colorbox\n";
|
||||
plot.gp << "set lmargin 0\n set tmargin 0\n set bmargin 0\n set rmargin 0.6\n";
|
||||
plot.show();
|
||||
}
|
||||
|
||||
@@ -110,8 +113,10 @@ public:
|
||||
|
||||
|
||||
// start and end
|
||||
const MyGridNode& gnStart = grid.getNodeFor(GridPoint(1500, 300, 0));
|
||||
const MyGridNode& gnEnd = grid.getNodeFor(GridPoint(900, 4600, 0));
|
||||
//const MyGridNode& gnStart = grid.getNodeFor(GridPoint(1500, 300, 0));
|
||||
//const MyGridNode& gnEnd = grid.getNodeFor(GridPoint(900, 4600, 0));
|
||||
const MyGridNode& gnStart = grid.getNodeFor(GridPoint(300, 300, 0));
|
||||
const MyGridNode& gnEnd = grid.getNodeFor(GridPoint(4700, 1300, 0));
|
||||
|
||||
// build all shortest path to reach th target
|
||||
Dijkstra<MyGridNode> dijkstra;
|
||||
@@ -131,23 +136,30 @@ public:
|
||||
DijkstraPath<MyGridNode> pathImp(dijkstra.getNode(gnEnd), dijkstra.getNode(gnStart));
|
||||
|
||||
// build plot
|
||||
K::GnuplotPlotElementLines gpPath1; gpPath1.setLineWidth(2); gpPath1.setColorHex("#444444");
|
||||
K::GnuplotPlotElementLines gpPath2; gpPath2.setLineWidth(2); gpPath2.setColorHex("#000000");
|
||||
K::GnuplotPlotElementLines gpPath1a; gpPath1a.setLineWidth(6); gpPath1a.setColorHex("#000000");
|
||||
K::GnuplotPlotElementLines gpPath1b; gpPath1b.setLineWidth(2); gpPath1b.setColorHex("#ffffff");
|
||||
K::GnuplotPlotElementLines gpPath2a; gpPath2a.setLineWidth(7); gpPath2a.setColorHex("#000000");
|
||||
K::GnuplotPlotElementLines gpPath2b; gpPath2b.setLineWidth(2); gpPath2b.setColorHex("#ffffff");
|
||||
|
||||
for (DijkstraNode<MyGridNode>* dn : pathNormal) {
|
||||
gpPath1.add(K::GnuplotPoint2(dn->element->x_cm, dn->element->y_cm));
|
||||
gpPath1a.add(K::GnuplotPoint2(dn->element->x_cm, dn->element->y_cm));
|
||||
gpPath1b.add(K::GnuplotPoint2(dn->element->x_cm, dn->element->y_cm));
|
||||
}
|
||||
for (DijkstraNode<MyGridNode>* dn : pathImp) {
|
||||
gpPath2.add(K::GnuplotPoint2(dn->element->x_cm, dn->element->y_cm));
|
||||
gpPath2a.add(K::GnuplotPoint2(dn->element->x_cm, dn->element->y_cm));
|
||||
gpPath2b.add(K::GnuplotPoint2(dn->element->x_cm, dn->element->y_cm));
|
||||
}
|
||||
|
||||
// plot the 2 paths
|
||||
{
|
||||
PaperPlot2D plot("floorplan_paths.eps", s1);
|
||||
plot.setRanges(0,2100, 0,5100);
|
||||
plot.floors.setColorHex("#777777");
|
||||
plot.setRanges(0,5100, 0,2100);
|
||||
plot.addFloor(f0);
|
||||
plot.plot.add(&gpPath1); gpPath1.setCustomAttr("dashtype 3");
|
||||
plot.plot.add(&gpPath2);
|
||||
plot.plot.add(&gpPath1a); //gpPath1a.setCustomAttr("dashtype 2");
|
||||
plot.plot.add(&gpPath1b); gpPath1b.setCustomAttr("dashtype 2");
|
||||
plot.plot.add(&gpPath2a);
|
||||
plot.plot.add(&gpPath2b);
|
||||
plot.show();
|
||||
}
|
||||
|
||||
@@ -166,21 +178,98 @@ public:
|
||||
if (i % 250 == 0) {std::cout << i << std::endl;}
|
||||
const MyGridNode& nStart = gnEnd;
|
||||
GridWalkState<MyGridNode> sStart(&nStart, Heading::rnd());
|
||||
//GridWalkState<MyGridNode> sEnd = walk.getDestination(grid, sStart, 135, 0);
|
||||
GridWalkState<MyGridNode> sEnd = walk.getDestination(grid, sStart, 135, 0);
|
||||
(void) sEnd;
|
||||
|
||||
}
|
||||
|
||||
// plot the heat-map
|
||||
{
|
||||
PaperPlot2D plot("floorplan_dijkstra_heatmap.eps", s1);
|
||||
plot.setRanges(0,2100, 0,5100);
|
||||
plot.gp << "set palette gray negative\n";
|
||||
PaperPlot2D plot("floorplan_dijkstra_heatmap.eps", s2);
|
||||
plot.setRanges(0,5220, 0,2100);
|
||||
plot.floors.setColorHex("#000000");
|
||||
//plot.gp << "set palette gray negative\n";
|
||||
plot.gp << "set palette defined ( 0 'white', 1 'blue', 2 'orange', 3 'yellow' )\n";
|
||||
plot.gp << "set lmargin 0\n set tmargin 0\n set bmargin 0\n set rmargin 0\n";
|
||||
plot.addFloor(f0);
|
||||
plot.addGrid(grid, ColorizeHeat(7000, 50));
|
||||
plot.plot.add(&gpPath1a); //gpPath1a.setCustomAttr("dashtype 2");
|
||||
plot.plot.add(&gpPath1b); gpPath1b.setCustomAttr("dashtype 2");
|
||||
plot.plot.add(&gpPath2a);
|
||||
plot.plot.add(&gpPath2b);
|
||||
plot.gp << "set object circle at 300,300 size 40,40 front\n";
|
||||
plot.gp << "set object circle at 4700,1300 size 40,40 front\n";
|
||||
plot.show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void showDijkstraDistance() {
|
||||
|
||||
// load the floorplan
|
||||
FloorplanFactorySVG fpFac(MiscSettings::floorplanPlot, 2.822222);
|
||||
Floor f0 = fpFac.getFloor("test1");
|
||||
const LengthF h0 = LengthF::cm(0);
|
||||
|
||||
// add the floorplan to the grid
|
||||
Grid<MyGridNode> grid(20);
|
||||
GridFactory<MyGridNode> gridFac(grid);
|
||||
|
||||
gridFac.addFloor(f0, h0.cm());
|
||||
|
||||
// remove all isolated nodes not attached to 300,300,floor0
|
||||
gridFac.removeIsolated( (MyGridNode&)grid.getNodeFor( GridPoint(300,300,h0.cm()) ) );
|
||||
|
||||
|
||||
|
||||
// start and end
|
||||
const MyGridNode& gnStart = grid.getNodeFor(GridPoint(300, 300, 0));
|
||||
const MyGridNode& gnEnd = grid.getNodeFor(GridPoint(4700, 1300, 0));
|
||||
|
||||
// build all shortest path to reach th target
|
||||
Dijkstra<MyGridNode> dijkstra;
|
||||
|
||||
// stamp importance information onto the grid-nodes
|
||||
GridImportance gridImp;
|
||||
gridImp.addImportance(grid, h0.cm());
|
||||
|
||||
// path WITH importance
|
||||
DijkstraMapper accImp(grid);
|
||||
dijkstra.build(gnStart, gnStart, accImp);
|
||||
DijkstraPath<MyGridNode> pathImp(dijkstra.getNode(gnEnd), dijkstra.getNode(gnStart));
|
||||
|
||||
// stamp distance information onto the grid
|
||||
// attach a corresponding weight-information to each user-grid-node
|
||||
for (MyGridNode& node : grid) {
|
||||
const DijkstraNode<MyGridNode>* dn = dijkstra.getNode(node);
|
||||
node.distToTarget = dn->cumWeight;
|
||||
}
|
||||
|
||||
// plot the heat-map
|
||||
{
|
||||
PaperPlot2D plot;
|
||||
plot.setRanges(0,5220, 0,2100);
|
||||
plot.floors.setColorHex("#000000");
|
||||
//plot.gp << "set palette gray negative\n";
|
||||
plot.gp << "set palette defined ( 0 'white', 1 'blue', 2 'orange', 3 'yellow' )\n";
|
||||
plot.gp << "set lmargin 0\n set tmargin 0\n set bmargin 0\n set rmargin 0\n";
|
||||
plot.addFloor(f0);
|
||||
plot.addGrid(grid, ColorizerDist());
|
||||
plot.gp << "set object circle at 300,300 size 40,40 front\n";
|
||||
plot.gp << "set object circle at 4700,1300 size 40,40 front\n";
|
||||
plot.show();
|
||||
sleep(1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user