diff --git a/src/control_parser.c b/src/control_parser.c index cc326de..1636642 100644 --- a/src/control_parser.c +++ b/src/control_parser.c @@ -389,7 +389,7 @@ _match: t->vehicle.turn = ctx->tm->vehicle.turn; gettimeofday(&t->started, NULL); } else { - fprintf(stderr, "time difference [ms]: %i\n", getcurts(t) - ctx->tm->ts); + /* fprintf(stderr, "time difference [ms]: %i\n", getcurts(t) - ctx->tm->ts); */ } t->last_ts = ctx->tm->ts; ctx->tm = NULL; diff --git a/src/control_parser.rl b/src/control_parser.rl index 64d13f7..5337432 100644 --- a/src/control_parser.rl +++ b/src/control_parser.rl @@ -41,7 +41,7 @@ static timestamp extract_ts(context *ctx, char *fpc) { t->vehicle.turn = ctx->tm->vehicle.turn; gettimeofday(&t->started, NULL); } else { - fprintf(stderr, "time difference [ms]: %i\n", getcurts(t) - ctx->tm->ts); + /* fprintf(stderr, "time difference [ms]: %i\n", getcurts(t) - ctx->tm->ts); */ } t->last_ts = ctx->tm->ts; ctx->tm = NULL; diff --git a/src/path.c b/src/path.c index b5af1b4..22491a6 100644 --- a/src/path.c +++ b/src/path.c @@ -61,7 +61,8 @@ void path_execute(trial* t,path* p){ now = getcurts(t); /*magic number for latency, send messages that much earlier*/ - while(tmp != NULL && now - 20 > tmp->ts){ + while(tmp != NULL && now > tmp->ts + 20){ + fprintf(stderr, "now: %u, ts: %u, turn: %i, accel: %i\n", now, tmp->ts, tmp->turn, tmp->accel); tmp = (command*) g_queue_pop_head(p->commands); switch(tmp->turn){ case TURN_HARD_LEFT: vehicle_hard_left(t); break;