summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src/apbirthday/strat.cc
diff options
context:
space:
mode:
authorNicolas Schodet2013-04-10 01:59:54 +0200
committerNicolas Schodet2013-04-10 01:59:54 +0200
commitd7d47681242fea0d566cb3a46bfcf04c493311f7 (patch)
treeba6560e102c00b92f7e0ac0b8675d18f124b72f7 /digital/io-hub/src/apbirthday/strat.cc
parent90f09316ebb9bbb717300b12f9bac8821441e61b (diff)
digital/io-hub/src/apbirthday: blow candles which are really near
Diffstat (limited to 'digital/io-hub/src/apbirthday/strat.cc')
-rw-r--r--digital/io-hub/src/apbirthday/strat.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/digital/io-hub/src/apbirthday/strat.cc b/digital/io-hub/src/apbirthday/strat.cc
index c755af69..328c1298 100644
--- a/digital/io-hub/src/apbirthday/strat.cc
+++ b/digital/io-hub/src/apbirthday/strat.cc
@@ -76,6 +76,12 @@ Strat::decision_candles (CandlesDecision &decision, uint16_t robot_angle)
}
else
{
+ // So near... let blow them...
+ if (score_forward && robot_angle > G_ANGLE_UF016_DEG (-45))
+ score_forward += 100;
+ if (score_backward && robot_angle < G_ANGLE_UF016_DEG (180 + 45))
+ score_backward += 100;
+ // Compare.
if (score_forward > score_backward)
{
decision.dir_sign = 1;