65,27 → 65,20 |
unsigned char pwm; |
} LEG_CFG_STATE; |
|
typedef struct { /*describe the position and adc value of a leg*/ |
typedef struct { /*describe the position of leg*/ |
int x; |
int y; |
int z; |
} LEG_POS_STATE; |
|
typedef struct { /*describe the position and adc value of a leg*/ |
typedef struct { /*describe the servo angles*/ |
int a; |
int b; |
int c; |
} LEG_ANG_STATE; |
|
typedef struct { /*describe the position of a leg in servo angles*/ |
int a; |
int b; |
int c; |
} ANGLES_STATE; |
|
typedef struct { |
LEG_CFG_STATE cfg[6]; |
LEG_POS_STATE leg[6]; |
LEG_ANG_STATE ang[6]; |
char power; |
} HEXAPOD_STATE; |
93,7 → 86,6 |
/*****************************************/ |
|
#define EVT_SET_MASK_LEG_ANGLE 0x01 |
#define EVT_SET_MASK_LEG_POS 0x02 |
|
#define EVT_STATUS_WAIT 0x01 |
#define EVT_STATUS_EXEC 0x02 |
105,7 → 97,8 |
unsigned char status; |
struct timespec time; |
unsigned char mask; |
unsigned char data[20]; //Generic data |
LEG_ANG_STATE ang; //Servo angle data |
unsigned char pwm; |
struct action_event *next; |
|
}; |
119,3 → 112,6 |
void end_send(void); |
|
void init_key(void); |
|
int adjust(int angle_sec, int leg, int num); |
|