summaryrefslogtreecommitdiff
path: root/digital/io-hub/src/robospierre/element.c
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-30 01:10:13 +0200
committerNicolas Schodet2011-05-30 01:12:06 +0200
commite0e813dc81eb0d5346ed76724438c94e4ac1e54b (patch)
treecf1062a7af03e24a55d6c4f10c4399bd04a64a15 /digital/io-hub/src/robospierre/element.c
parent5cff7f4d119ef237e95f26a970f771939dd54260 (diff)
digital/io-hub: change element_get_pos
Diffstat (limited to 'digital/io-hub/src/robospierre/element.c')
-rw-r--r--digital/io-hub/src/robospierre/element.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/digital/io-hub/src/robospierre/element.c b/digital/io-hub/src/robospierre/element.c
index 0022f09a..bc76a2b0 100644
--- a/digital/io-hub/src/robospierre/element.c
+++ b/digital/io-hub/src/robospierre/element.c
@@ -31,6 +31,8 @@
#include "chrono.h"
#include "logistic.h"
+#include "bot.h"
+#include "playground.h"
/** Elements on table. */
struct element_t element_table[] =
@@ -710,19 +712,18 @@ element_get_pos (uint8_t element_id)
element_t e = element_get (element_id);
position_t pos;
pos.v = e.pos;
- pos.a = 0;
+ pos.a = 0xffff;
if (e.attr == (ELEMENT_GREEN |ELEMENT_RIGHT))
{
- /* Set angle to 90° clockwise. */
- pos.a = 0x4000;
- /* Remove 400 mm. */
- pos.v.x -= 400;
+ /* To the right. */
+ pos.a = 0x0000;
+ pos.v.x = PG_WIDTH - BOT_GREEN_ELEMENT_PLACE_DISTANCE_MM;
}
if (e.attr == (ELEMENT_GREEN |ELEMENT_LEFT))
{
- /* Set angle to 270° clockwise. */
- pos.a = 0xc000;
- pos.v.x += 400;
+ /* To the left. */
+ pos.a = 0x8000;
+ pos.v.x = BOT_GREEN_ELEMENT_PLACE_DISTANCE_MM;
}
return pos;
}