From 38d62a2ba837d011df429cd474f72c66187651fc Mon Sep 17 00:00:00 2001 From: PF Date: Tue, 16 May 2017 10:32:03 +0200 Subject: [PATCH] =?UTF-8?q?Scan=20attend=20la=20r=C3=A9ponse=20des=20AX-12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc/src/pathfinding/PathCache.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pc/src/pathfinding/PathCache.java b/pc/src/pathfinding/PathCache.java index eac73bc5..7eab9803 100644 --- a/pc/src/pathfinding/PathCache.java +++ b/pc/src/pathfinding/PathCache.java @@ -41,6 +41,9 @@ import robot.Speed; import scripts.ScriptNames; import serie.BufferOutgoingOrder; +import serie.SerialProtocol.InOrder; +import serie.SerialProtocol.State; +import serie.Ticket; import utils.Log; import utils.Log.Verbose; @@ -84,7 +87,7 @@ public PathCache(Log log, Config config, BufferOutgoingOrder out, CapteursProces simuleSerie = config.getBoolean(ConfigInfo.SIMULE_SERIE); dureePeremption = config.getInt(ConfigInfo.DUREE_PEREMPTION_OBSTACLES); L = config.getInt(ConfigInfo.CENTRE_ROTATION_ROUE_X); - sleepScan = 3 * config.getInt(ConfigInfo.SENSORS_SEND_PERIOD) * config.getInt(ConfigInfo.SENSORS_PRESCALER); + sleepScan = 2 * config.getInt(ConfigInfo.SENSORS_SEND_PERIOD) * config.getInt(ConfigInfo.SENSORS_PRESCALER); enableScan = config.getBoolean(ConfigInfo.ENABLE_SCAN); this.fakeChemin = fakeChemin; this.realChemin = realChemin; @@ -399,9 +402,12 @@ private void scan() throws InterruptedException for(int i = 0; i <= nbMesures; i++) { double courbure = L / Math.tan(angle); - out.setDirectionRoues(courbure); - angle += deltaAngle; + Ticket t = out.setDirectionRoues(courbure); + InOrder o = t.attendStatus(); + if(o.etat == State.KO) + log.critical("Erreur lors du scan : "+o); Thread.sleep(sleepScan); + angle += deltaAngle; } capteurs.endScan(); log.debug("Scan fini", Verbose.CAPTEURS.masque);