summaryrefslogtreecommitdiff
path: root/digital/io/src/asserv.c
diff options
context:
space:
mode:
authorJérémy Dufour2008-04-20 19:55:55 +0200
committerJérémy Dufour2008-04-20 19:55:55 +0200
commitf088b0f951d1d074429c2a6e8f4946310108db6d (patch)
treebf6401ef43ddad65e8ba1b34b0bce398bd27c55c /digital/io/src/asserv.c
parent4d0f3e53f4e845dd067daacf1c1086b09d825c98 (diff)
* digital/io/src
- add the goto an absolute position and them absolute angle to the asserv module.
Diffstat (limited to 'digital/io/src/asserv.c')
-rw-r--r--digital/io/src/asserv.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/digital/io/src/asserv.c b/digital/io/src/asserv.c
index 4f132f3d..c8251ba1 100644
--- a/digital/io/src/asserv.c
+++ b/digital/io/src/asserv.c
@@ -366,6 +366,26 @@ asserv_goto_angle (int16_t angle)
asserv_twi_send_command ('y', 2);
}
+/* Go to an absolute position and then an absolute angle. */
+void
+asserv_goto_xya (uint32_t x, uint32_t y, int16_t a)
+{
+ /* Put X as parameter */
+ asserv_twi_buffer_param[0] = v32_to_v8 (x, 2);
+ asserv_twi_buffer_param[1] = v32_to_v8 (x, 1);
+ asserv_twi_buffer_param[2] = v32_to_v8 (x, 0);
+ /* Put distance as parameter */
+ asserv_twi_buffer_param[3] = v32_to_v8 (y, 2);
+ asserv_twi_buffer_param[4] = v32_to_v8 (y, 1);
+ asserv_twi_buffer_param[5] = v32_to_v8 (y, 0);
+ /* Put angle as parameter */
+ asserv_twi_buffer_param[6] = v16_to_v8 (a, 1);
+ asserv_twi_buffer_param[7] = v16_to_v8 (a, 0);
+ /* Send the got to an absolute position and them absolute angle command to
+ * the asserv board */
+ asserv_twi_send_command ('X', 8);
+}
+
/* Go to the wall (moving backward). */
void
asserv_go_to_the_wall (void)