summaryrefslogtreecommitdiff
path: root/digital/io-hub/src/robospierre/top.c
diff options
context:
space:
mode:
authorNicolas Schodet2011-06-04 01:05:07 +0200
committerNicolas Schodet2011-06-04 02:43:43 +0200
commit9a7714630675392c35aabaaee01e0d83b69230b7 (patch)
tree72b9e7f486af4287751e93fce686c50d9d0bc31f /digital/io-hub/src/robospierre/top.c
parent13776d2ecc35e6470bc159c7065a0cdf0e7db588 (diff)
digital/io-hub: add score to bonus squares, handle protected squares
Diffstat (limited to 'digital/io-hub/src/robospierre/top.c')
-rw-r--r--digital/io-hub/src/robospierre/top.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/digital/io-hub/src/robospierre/top.c b/digital/io-hub/src/robospierre/top.c
index f1f14cdd..7e3f4413 100644
--- a/digital/io-hub/src/robospierre/top.c
+++ b/digital/io-hub/src/robospierre/top.c
@@ -175,7 +175,14 @@ top_go_drop (void)
uint8_t backward = logistic_global.collect_direction == DIRECTION_FORWARD
? 0 : ASSERV_BACKWARD;
/* Go above or below the drop point. */
- if (drop_pos.v.y > PG_LENGTH / 2)
+ if (drop_pos.v.y < 350)
+ {
+ /* Protected zone. */
+ drop_pos.v.x = PG_WIDTH / 2;
+ drop_pos.v.y = 350;
+ drop_pos.a = PG_A_DEG (45);
+ }
+ else if (drop_pos.v.y > PG_LENGTH / 2)
{
drop_pos.v.y -= 350 / 2;
drop_pos.a = PG_A_DEG (-90);