2008-07-11 20:38:17 +00:00
|
|
|
|
2008-07-11 22:55:36 +00:00
|
|
|
#include "control.h"
|
2008-07-12 00:00:11 +00:00
|
|
|
#include "path.h"
|
2008-07-11 22:55:36 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2008-07-11 22:24:00 +00:00
|
|
|
int main(int argc, char **argv) {
|
2008-07-11 22:55:36 +00:00
|
|
|
trial *t;
|
2008-07-12 00:00:11 +00:00
|
|
|
path *p;
|
2008-07-11 22:55:36 +00:00
|
|
|
|
|
|
|
if (argc <= 2) {
|
|
|
|
fprintf(stderr, "Syntax: %s hostname port\n", argv[0]);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL == (t = trial_new(argv[1], argv[2]))) {
|
|
|
|
return 2;
|
|
|
|
}
|
2008-07-12 00:00:11 +00:00
|
|
|
|
|
|
|
/*create trivial path towards the origin*/
|
2008-07-11 22:55:36 +00:00
|
|
|
|
2008-07-12 01:29:24 +00:00
|
|
|
trial_wait_for_start(t);
|
2008-07-12 01:47:36 +00:00
|
|
|
p = path_new(&t->map,&t->vehicle);
|
2008-07-12 00:00:11 +00:00
|
|
|
while(t->alive){
|
|
|
|
path_execute(t,p);
|
2008-07-12 01:52:33 +00:00
|
|
|
trial_wait_for_input(t);
|
2008-07-12 00:00:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
path_free(p);
|
2008-07-11 22:55:36 +00:00
|
|
|
trial_free(t);
|
|
|
|
|
2008-07-11 20:38:17 +00:00
|
|
|
return 0;
|
|
|
|
}
|