new walker (control+path)

added new sanity checks
fixed minor errors
added corresponding test-cases
added moving-median
This commit is contained in:
2016-02-05 20:18:48 +01:00
parent 56203e59ed
commit 382a046df1
10 changed files with 296 additions and 20 deletions

View File

@@ -199,7 +199,7 @@ public:
void buildStairLine(T& _n1, T& _n2) {
// half the grid size = small steps
const int gridSize_cm = grid.getGridSize_cm() / 2;
const int gridSize_cm = grid.getGridSize_cm();// / std::sqrt(2);
// local copies, needed for std::swap to work
T n1 = _n1; T n2 = _n2;
@@ -216,7 +216,7 @@ public:
const int idx3 = n2.getIdx(); // final node
// move upards in gridSize steps
for (int _z = gridSize_cm; _z < zDiff; _z+= gridSize_cm) {
for (int _z = gridSize_cm; _z < zDiff - gridSize_cm; _z+= gridSize_cm) {
// calculate the percentage of reached upwards-distance
const float percent = _z/zDiff;
@@ -227,8 +227,8 @@ public:
int z = n1.z_cm + _z;
// snap (x,y) to the grid???
x = std::round(x / gridSize_cm) * gridSize_cm;
y = std::round(y / gridSize_cm) * gridSize_cm;
//x = std::round(x / gridSize_cm) * gridSize_cm;
//y = std::round(y / gridSize_cm) * gridSize_cm;
// create a new node add it to the grid, and connect it with the previous one
idx2 = grid.addUnaligned(T(x,y,z));