60,14 → 60,23 |
#define POS_Z_MIN -150 |
#define POS_Z_MAX 150 |
|
typedef struct { |
int adc_in; |
unsigned char pwm; |
} LEG_CFG_STATE; |
|
typedef struct { /*describe the position and adc value of a leg*/ |
int x; |
int y; |
int z; |
int adc_in; |
unsigned char pwm; |
} LEG_STATE; |
} LEG_POS_STATE; |
|
typedef struct { /*describe the position and adc value of a leg*/ |
int a; |
int b; |
int c; |
} LEG_ANG_STATE; |
|
typedef struct { /*describe the position of a leg in servo angles*/ |
int a; |
int b; |
75,12 → 84,34 |
} ANGLES_STATE; |
|
typedef struct { |
LEG_STATE leg[6]; |
LEG_CFG_STATE cfg[6]; |
LEG_POS_STATE leg[6]; |
LEG_ANG_STATE ang[6]; |
char power; |
} HEXAPOD_STATE; |
|
/*****************************************/ |
|
#define EVT_SET_MASK_LEG_ANGLE 0x01 |
#define EVT_SET_MASK_LEG_POS 0x02 |
|
#define EVT_STATUS_WAIT 0x01 |
#define EVT_STATUS_EXEC 0x02 |
#define EVT_STATUS_DONE 0x03 |
|
struct action_event { |
|
unsigned char type; |
unsigned char status; |
struct timespec time; |
unsigned char mask; |
unsigned char data[20]; //Generic data |
struct action_event *next; |
|
}; |
|
struct action_event *get_first_old_event(struct timespec *time); |
|
extern sem_t mx_status; |
extern HEXAPOD_STATE status; |
|