OSDN Git Service

Update lejos_osek to nxtOSEK_v205b0.zip
[nxt-jsp/etrobo-atk.git] / nxtOSEK / samples_c / biped_robot / motion.h
1 /* motion.h */\r
2 \r
3 #ifndef _MOTION_H_\r
4 #define _MOTION_H_\r
5 \r
6 #include "ecrobot_interface.h"\r
7 #include "nxte.h"\r
8 \r
9 #define N_NXTe_CH   1 /* number of NXTe channels in use */\r
10 #define SERVO_DELAY 4 /* servo control delay */\r
11 \r
12 #define BLANK -1 /* no angle data */\r
13 \r
14 typedef enum {\r
15         NEUTRAL,\r
16         STAND_UP,\r
17         FORWARD,\r
18         RIGHT_TURN,\r
19         LEFT_TURN\r
20 } motionCmd_t;\r
21 \r
22 typedef struct {\r
23         S16 angle[N_NXTe_CH][MAX_SERVO_CH]; /* angles for servo ch01 to ch10 (-1: set no angle) */\r
24         U16 wait; /* wait time in msec after setting all angles */\r
25 } motion_t;\r
26 \r
27 typedef struct {\r
28         motion_t *pMotion; /* address of motion parameter */\r
29         int steps; /* motion steps */\r
30 } motionTable_t;\r
31 \r
32 extern void initServo(U8 port_id);\r
33 extern  int setServo(U8 port_id, motion_t *motion);\r
34 extern void setMotion(U8 port_id, motionCmd_t cmd);\r
35 \r
36 #endif\r