praktisch nix
This commit is contained in:
parent
70ee5f69a6
commit
e25bcd734f
@ -194,7 +194,6 @@ INLINE timestamp getcurts(trial *t) {
|
|||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
timestamp ts = (tv.tv_sec - t->started.tv_sec) * 1000 + (tv.tv_usec - t->started.tv_usec) / 1000;
|
timestamp ts = (tv.tv_sec - t->started.tv_sec) * 1000 + (tv.tv_usec - t->started.tv_usec) / 1000;
|
||||||
printf("Timestamp: %u\n", ts);
|
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ path *path_new(map* m,vehicle *v){
|
|||||||
/* Calculate a trivial path to the origin*/
|
/* Calculate a trivial path to the origin*/
|
||||||
|
|
||||||
/* Turn towards origin, take shorter direction*/
|
/* Turn towards origin, take shorter direction*/
|
||||||
angle = atan(v->y/v->x)*180/M_PI;
|
angle = atan2(v->y,v->x)*180/M_PI;
|
||||||
stop = abs(angle - v->dir)/m->max_turn*1000;
|
stop = abs(angle - v->dir)/m->max_turn*1000;
|
||||||
printf("Angle: %f stop: %f\n",angle,stop);
|
printf("Angle: %f stop: %f\n",angle,stop);
|
||||||
if(angle - v->dir > 0){
|
if(angle - v->dir > 0){
|
||||||
@ -60,7 +60,6 @@ void path_execute(trial* t,path* p){
|
|||||||
}
|
}
|
||||||
|
|
||||||
now = getcurts(t);
|
now = getcurts(t);
|
||||||
fprintf(stderr,"Now: %d TS: %d\n",now,clock());
|
|
||||||
/*magic number for latency, send messages that much earlier*/
|
/*magic number for latency, send messages that much earlier*/
|
||||||
while(tmp != NULL && now - 20 > tmp->ts){
|
while(tmp != NULL && now - 20 > tmp->ts){
|
||||||
tmp = (command*) g_queue_pop_head(p->commands);
|
tmp = (command*) g_queue_pop_head(p->commands);
|
||||||
|
Loading…
Reference in New Issue
Block a user