Rev 1337 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*
* Project: S.Ha.R.K.
*
* Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "chimera.h"
void my_close
(void *arg
)
{
int i
;
TIME tmp
;
end_send
();
for (i
=3; i
<MAX_PROC
; i
++){
if (!jet_getstat
(i
, NULL
, &tmp
, NULL
, NULL
))
kern_printf
("Task Name : %s - Max Time : %d\n", proc_table
[i
].
name, (int)tmp
);
}
}
void action_stand_up
(void) {
static struct action_event e
[20];
int i
= 0;
status.
power = 1;
kern_gettime
(&(e
[i
].
time));
ADDUSEC2TIMESPEC
(10000000,&(e
[i
].
time));
e
[i
].
type = EVT_SET_MASK_LEG_ANGLE
;
e
[i
].
mask = 31;
e
[i
].
ang.
a = 0 * 3600;
e
[i
].
ang.
b = 80 * 3600;
e
[i
].
ang.
c = 0;
e
[i
].
pwm = 7;
insert_action_event
(&(e
[i
]));
kern_gettime
(&(e
[i
+1].
time));
ADDUSEC2TIMESPEC
(11000000,&(e
[i
+1].
time));
e
[i
+1].
type = EVT_SET_MASK_LEG_ANGLE
;
e
[i
+1].
mask = 31;
e
[i
+1].
ang.
a = 90 * 3600;
e
[i
+1].
ang.
b = 80 * 3600;
e
[i
+1].
ang.
c = 0;
e
[i
+1].
pwm = 7;
insert_action_event
(&(e
[i
+1]));
kern_gettime
(&(e
[i
+2].
time));
ADDUSEC2TIMESPEC
(12000000,&(e
[i
+2].
time));
e
[i
+2].
type = EVT_SET_MASK_LEG_ANGLE
;
e
[i
+2].
mask = 31;
e
[i
+2].
ang.
a = 90 * 3600;
e
[i
+2].
ang.
b = -50 * 3600;
e
[i
+2].
ang.
c = 0;
e
[i
+2].
pwm = 7;
insert_action_event
(&(e
[i
+2]));
kern_gettime
(&(e
[i
+3].
time));
ADDUSEC2TIMESPEC
(13000000,&(e
[i
+3].
time));
e
[i
+3].
type = EVT_SET_MASK_LEG_ANGLE
;
e
[i
+3].
mask = 31;
e
[i
+3].
ang.
a = 90 * 3600;
e
[i
+3].
ang.
b = 0 * 3600;
e
[i
+3].
ang.
c = 0;
e
[i
+3].
pwm = 7;
insert_action_event
(&(e
[i
+3]));
kern_gettime
(&(e
[i
+4].
time));
ADDUSEC2TIMESPEC
(15000000,&(e
[i
+4].
time));
e
[i
+4].
type = EVT_SET_MASK_LEG_ANGLE
;
e
[i
+4].
mask = 31;
e
[i
+4].
ang.
a = 90 * 3600;
e
[i
+4].
ang.
b = 0 * 3600;
e
[i
+4].
ang.
c = 0;
e
[i
+4].
pwm = 7;
insert_action_event
(&(e
[i
+4]));
}
int main
(int argc
, char **argv
)
{
TIME seme
;
seme
= sys_gettime
(NULL
);
srand(seme
);
sys_atrunlevel
(my_close
, NULL
, RUNLEVEL_BEFORE_EXIT
);
clear
();
init_send
(); /* Comunication */
init_key
(); /* Keyboard */
action_stand_up
();
return 0;
}