added a first implementation to main

fixed compilation (apart from trial->alive)
This commit is contained in:
Johannes Reinhardt 2008-07-12 02:00:11 +02:00
parent 4fd79e8035
commit 6ec6d6015b
3 changed files with 19 additions and 2 deletions

View File

@ -1,10 +1,12 @@
#include "control.h"
#include "path.h"
#include <stdio.h>
int main(int argc, char **argv) {
trial *t;
path *p;
if (argc <= 2) {
fprintf(stderr, "Syntax: %s hostname port\n", argv[0]);
@ -14,7 +16,16 @@ int main(int argc, char **argv) {
if (NULL == (t = trial_new(argv[1], argv[2]))) {
return 2;
}
/*create trivial path towards the origin*/
p = path_new(&t->map,&t->vehicle);
while(t->alive){
trial_wait_for_input(t);
path_execute(t,p);
}
path_free(p);
trial_free(t);
return 0;

View File

@ -1,19 +1,24 @@
#ifndef _PATH_H
#define _PATH_H
#include "control.h"
struct path;
typedef struct path path;
struct command;
typedef struct command command;
struct command{
timestamp ts;
accel_t accel;
turn_t turn;
}
};
struct path {
GQueue* commands;
}
};
command *command_new(timestamp ts, accel_t a, turn_t t);
void command_free(command* c);

View File

@ -6,6 +6,7 @@
main_source = '''
main.c
control.c
path.c
'''
def build(bld):