diff --git a/maze.adoc b/maze.adoc index 48fc359..985eeaf 100644 --- a/maze.adoc +++ b/maze.adoc @@ -192,12 +192,16 @@ def moveFinished(lim=0): .Κώδικας raspberry [source,python] -- - if (abs(m.frontDistance-prevNode.frontDistance)>25): - continue - if (abs(m.leftDistance-prevNode.leftDistance)>25): - continue - if (abs(m.rightDistance-prevNode.rightDistance)>25): - continue + def ignoreMetrics(): + flag=False + if (abs(m.frontDistance-pos.oldFrontValue)>25): + flag=True + if (abs(m.leftDistance-pos.oldLeftValue)>25): + flag=True + if (abs(m.rightDistance-pos.oldRightValue)>25): + flag=True + return flag + --