Fixed drawing of distance circles
This commit is contained in:
@@ -108,6 +108,7 @@ public:
|
|||||||
|
|
||||||
K::GnuplotSplotElementEmpty emptyElem;
|
K::GnuplotSplotElementEmpty emptyElem;
|
||||||
|
|
||||||
|
std::vector<int> distanceCircles;
|
||||||
|
|
||||||
K::GnuplotSplotElementPM3D pm3doutline;
|
K::GnuplotSplotElementPM3D pm3doutline;
|
||||||
|
|
||||||
@@ -186,7 +187,7 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void addCircle(int id, const Point2& center, float radius, const K::GnuplotColor& strokeColor)
|
void addDistanceCircle(const Point2& center, float radius, const K::GnuplotColor& strokeColor)
|
||||||
{
|
{
|
||||||
auto c = K::GnuplotCoordinate2(center.x, center.y, K::GnuplotCoordinateSystem::FIRST);
|
auto c = K::GnuplotCoordinate2(center.x, center.y, K::GnuplotCoordinateSystem::FIRST);
|
||||||
auto r = K::GnuplotCoordinate1(radius, K::GnuplotCoordinateSystem::FIRST);
|
auto r = K::GnuplotCoordinate1(radius, K::GnuplotCoordinateSystem::FIRST);
|
||||||
@@ -196,8 +197,19 @@ public:
|
|||||||
|
|
||||||
K::GnuplotObjectCircle* obj = new K::GnuplotObjectCircle(c, r, fill, stroke);
|
K::GnuplotObjectCircle* obj = new K::GnuplotObjectCircle(c, r, fill, stroke);
|
||||||
|
|
||||||
splot.getObjects().set(id, obj);
|
splot.getObjects().add(obj);
|
||||||
|
|
||||||
|
distanceCircles.push_back(obj->getID());
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearDistanceCircles()
|
||||||
|
{
|
||||||
|
for (int oldID : distanceCircles)
|
||||||
|
{
|
||||||
|
splot.getObjects().remove(oldID);
|
||||||
|
}
|
||||||
|
|
||||||
|
distanceCircles.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void addBBoxes(const BBoxes3& boxes, const K::GnuplotColor& c) {
|
void addBBoxes(const BBoxes3& boxes, const K::GnuplotColor& c) {
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ static CombinedStats<float> run(Settings::DataSetup setup, int walkIdx, std::str
|
|||||||
std::string currDir = std::filesystem::current_path().string();
|
std::string currDir = std::filesystem::current_path().string();
|
||||||
|
|
||||||
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(setup.map);
|
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(setup.map);
|
||||||
Offline::FileReader fr(setup.training[walkIdx], setup.NanoSecondTimestamps);
|
Offline::FileReader fr(setup.training[walkIdx], setup.HasNanoSecondTimestamps);
|
||||||
|
|
||||||
// ground truth
|
// ground truth
|
||||||
std::vector<int> gtPath = setup.gtPath;
|
std::vector<int> gtPath = setup.gtPath;
|
||||||
@@ -334,6 +334,8 @@ static CombinedStats<float> run(Settings::DataSetup setup, int walkIdx, std::str
|
|||||||
errorStats.ftm.add(distErrorFtm);
|
errorStats.ftm.add(distErrorFtm);
|
||||||
|
|
||||||
// draw wifi ranges
|
// draw wifi ranges
|
||||||
|
plot.clearDistanceCircles();
|
||||||
|
|
||||||
for (size_t i = 0; i < obs.ftm.size(); i++)
|
for (size_t i = 0; i < obs.ftm.size(); i++)
|
||||||
{
|
{
|
||||||
WiFiMeasurement wifi2 = obs.ftm[i];
|
WiFiMeasurement wifi2 = obs.ftm[i];
|
||||||
@@ -349,7 +351,7 @@ static CombinedStats<float> run(Settings::DataSetup setup, int walkIdx, std::str
|
|||||||
default: color = K::GnuplotColor::fromRGB(255, 0, 0); break;
|
default: color = K::GnuplotColor::fromRGB(255, 0, 0); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
plot.addCircle(1000 + i, apPos.xy(), wifi2.getFtmDist(), color);
|
plot.addDistanceCircle(apPos.xy(), wifi2.getFtmDist(), color);
|
||||||
}
|
}
|
||||||
|
|
||||||
obs.wifi.clear();
|
obs.wifi.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user