Fix integer underflow
This commit is contained in:
parent
2a5f92a16c
commit
82ea67edb7
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user