Skip to content
This repository has been archived by the owner on Mar 3, 2019. It is now read-only.

Commit

Permalink
Scan attend la réponse des AX-12
Browse files Browse the repository at this point in the history
  • Loading branch information
PFGimenez committed May 16, 2017
1 parent ab80163 commit 38d62a2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pc/src/pathfinding/PathCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 38d62a2

Please sign in to comment.