From 9deed1fd46591b6f5c794f068348c0bdf67e2a94 Mon Sep 17 00:00:00 2001 From: tsere Date: Wed, 22 Jan 2020 16:40:49 +0000 Subject: [PATCH] Update 'maze.adoc' --- maze.adoc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 + --