/demos/trunk/chimera/calibrate.c |
---|
50,9 → 50,9 |
}; |
struct leg_calibration calibration_table[] = { |
{1,{0,90,-45,45,-90,0},{450001,392401,435601},{-208800,41400,234001}}, |
{1,{0,90,-45,45,-45,45},{403201,374401,349201},{-201600,-32400,63000}}, |
{1,{0,90,-45,45,0,90},{417601,403201,424801},{-169200,36000,-144000}}, |
{1,{0,90,-45,45,-90,0},{432001,403201,432001},{-201600,28800,241201}}, |
{1,{0,90,-45,45,-45,45},{417601,388801,424741},{-216000,-43200,82770}}, |
{1,{0,90,-45,45,0,90},{414001,424801,410401},{-162000,39600,-122400}}, |
{-1,{0,90,-45,45,-90,0},{413949,453599,431999},{216000,50401,-215599}}, |
{-1,{0,90,-45,45,-45,45},{421199,421199,443799},{165600,-8999,30600}}, |
{-1,{0,90,-45,45,0,90},{0,0,0},{0,0,0}}, |
/demos/trunk/chimera/chimera.c |
---|
80,15 → 80,27 |
e[6+i].type = EVT_SET_MASK_LEG_ANGLE; |
e[6+i].mask = 1 << i; |
*(int *)(e[6+i].data) = 0 * 3600; |
*(int *)(e[6+i].data) = 135 * 3600; |
*(int *)(e[6+i].data + 4) = 0; |
*(int *)(e[6+i].data + 8) = 0; |
*(unsigned char *)(e[i].data + 12) = 7; |
*(unsigned char *)(e[6+i].data + 12) = 7; |
insert_action_event(&(e[6+i])); |
} |
kern_gettime(&(e[15].time)); |
ADDUSEC2TIMESPEC(30000000,&(e[15].time)); |
e[15].type = EVT_SET_MASK_LEG_ANGLE; |
e[15].mask = 1 << 3; |
*(int *)(e[15].data) = 0; |
*(int *)(e[15].data + 4) = 0; |
*(int *)(e[15].data + 8) = -45 * 3600; |
*(unsigned char *)(e[15].data + 12) = 4; |
insert_action_event(&(e[15])); |
} |
int main(int argc, char **argv) |
100,6 → 112,8 |
sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT); |
clear(); |
init_send(); /* Comunication */ |
init_key(); /* Keyboard */ |
/demos/trunk/chimera/send.c |
---|
377,8 → 377,8 |
if (pid == NIL) { |
perror("Could not create task <Get_Task>"); |
sys_end(); |
} else |
task_activate(pid); |
} //else |
//task_activate(pid); |
} |
void init_send() |
393,6 → 393,13 |
sem_init(&mx_status,0,1); |
sem_init(&mx_servo,0,1); |
for (i=0; i<16;i++) { |
servo_set_max_angle_sec(COM_PORT,i,460000); |
servo_set_min_angle_sec(COM_PORT,i,-460000); |
} |
for (i=0; i<6;i++) { |
status.ang[i].a = 0; |
status.ang[i].b = 0; |
/demos/trunk/chimera/keys.c |
---|
118,8 → 118,8 |
active_leg = 4; |
break; |
case KEY_6: |
//active_leg = 5; |
calibrate_step(100000); |
active_leg = 5; |
//calibrate_step(100000); |
break; |
/* |
case KEY_C: |