summaryrefslogtreecommitdiff
path: root/digital/asserv/src/asserv/twi_proto.c
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-05 11:38:48 +0200
committerNicolas Schodet2008-04-05 11:38:48 +0200
commite668c747f1e5787b4cb8ed2627abbc975d75eff2 (patch)
treeaa9a390f9fdfed24f2ec2e7ec00617c5fa5d2916 /digital/asserv/src/asserv/twi_proto.c
parent8c570ab124d33abbf4d4798fbbcb04ab24b98998 (diff)
* digital/asserv/src/asserv:
- angle offset clean up. - added angle offset proto command.
Diffstat (limited to 'digital/asserv/src/asserv/twi_proto.c')
-rw-r--r--digital/asserv/src/asserv/twi_proto.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/digital/asserv/src/asserv/twi_proto.c b/digital/asserv/src/asserv/twi_proto.c
index 5b398996..9b3d8f36 100644
--- a/digital/asserv/src/asserv/twi_proto.c
+++ b/digital/asserv/src/asserv/twi_proto.c
@@ -28,7 +28,6 @@
#include "modules/utils/utils.h"
#include "modules/utils/byte.h"
#include "modules/twi/twi.h"
-#include "modules/math/fixed/fixed.h"
#include "io.h"
#include "misc.h"
@@ -40,8 +39,6 @@
#include "postrack.h"
#include "traj.h"
-#define M_PI 3.14159265358979323846 /* pi */
-
struct twi_proto_t
{
u8 seq;
@@ -132,18 +129,7 @@ twi_proto_callback (u8 *buf, u8 size)
case c ('a', 2):
/* Set angular speed controlled position consign.
* - w: angle offset. */
- {
- int32_t a = ((int32_t) (int16_t) v8_to_v16 (buf[2], buf[3])) << 8;
- a = fixed_mul_f824 (a, 2 * M_PI * (1L << 24));
- uint32_t f = postrack_footing;
- int32_t arc = fixed_mul_f824 (f, a);
- state_main.mode = MODE_SPEED;
- speed_theta.use_pos = speed_alpha.use_pos = 1;
- speed_theta.pos_cons = pos_theta.cons;
- speed_alpha.pos_cons = pos_alpha.cons;
- speed_alpha.pos_cons += arc;
- state_start (&state_main, 0);
- }
+ traj_angle_offset_start (((int32_t) (int16_t) v8_to_v16 (buf[2], buf[3])) << 8, 0);
break;
case c ('f', 0):
/* Go to the wall. */