summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src/robospierre
diff options
context:
space:
mode:
authorNicolas Schodet2011-06-04 00:52:51 +0200
committerNicolas Schodet2011-06-04 00:52:51 +0200
commit13776d2ecc35e6470bc159c7065a0cdf0e7db588 (patch)
treeb2b055ca5c87f22b61883b045a17886263428fb8 /digital/io-hub/src/robospierre
parentaad98e1b215d1e4d8513964904fc6fbeea7976ae (diff)
digital/io-hub: handle path to protected zone
Diffstat (limited to 'digital/io-hub/src/robospierre')
-rw-r--r--digital/io-hub/src/robospierre/path.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/digital/io-hub/src/robospierre/path.c b/digital/io-hub/src/robospierre/path.c
index 4f871213..7da57ec6 100644
--- a/digital/io-hub/src/robospierre/path.c
+++ b/digital/io-hub/src/robospierre/path.c
@@ -252,6 +252,13 @@ path_blocking (uint8_t a, uint8_t b, int16_t *dp)
return 1;
if (a_green || b_green)
factor = 4;
+ /* Test for protected zone. */
+ if (va.y <= 350 && va.x > PG_WIDTH / 2 - 350 && va.y < PG_WIDTH / 2 + 350
+ && (vb.x < PG_WIDTH / 2 - 350 || vb.x > PG_WIDTH / 2 + 350))
+ return 1;
+ if (vb.y <= 350 && vb.x > PG_WIDTH / 2 - 350 && vb.y < PG_WIDTH / 2 + 350
+ && (va.x < PG_WIDTH / 2 - 350 || va.x > PG_WIDTH / 2 + 350))
+ return 1;
/* Test for a blocking obstacle. */
for (i = 0; i < PATH_OBSTACLES_NB && !blocking; i++)
{