Fix simulation timestamp update

This commit is contained in:
Stefan Bühler 2008-07-13 22:13:40 +02:00
parent 61a094fed5
commit 06ecdf245c
3 changed files with 8 additions and 7 deletions

View File

@ -33,11 +33,12 @@ void trial_loop(trial *t) {
} }
while (t->alive) { while (t->alive) {
timestamp step=getcurts(t) + LATENCY - t->sim.tm.ts; timestamp step=getcurts(t) + LATENCY - t->sim.tm.ts;
if (step > 0) {
t->sim.tm.vehicle.w = turn2w(t, t->sim.tm.vehicle.turn); t->sim.tm.vehicle.w = turn2w(t, t->sim.tm.vehicle.turn);
dgl(t,&t->sim.tm.vehicle,&t->sim.tm.vehicle,step,step); dgl(t,&t->sim.tm.vehicle,&t->sim.tm.vehicle,step,step);
t->sim.tm.ts += step;
t->sim.steps++; t->sim.steps++;
}
// simulate(t, getcurts(t) + LATENCY); // simulate(t, getcurts(t) + LATENCY);
goradar(t); goradar(t);
if (-1 == trial_check_input(t)) return; if (-1 == trial_check_input(t)) return;

View File

@ -7,7 +7,7 @@ CMD="./build/default/src/icfp08radar localhost 17676"
if [ "$1" == "--gdb" ]; then if [ "$1" == "--gdb" ]; then
CMD="gdb --args ${CMD}" CMD="gdb --args ${CMD}"
elif [ "$1" == "--valgrind" ]; then elif [ "$1" == "--valgrind" ]; then
CMD="valgrind ${CMD}" CMD="valgrind --leak-check=full ${CMD}"
fi fi
exec $CMD exec $CMD

View File

@ -70,7 +70,7 @@ def configure(conf):
common_ccflags = [ common_ccflags = [
'-std=gnu99', '-Wall', '-g', '-Wshadow', '-W', '-pedantic', '-std=gnu99', '-Wall', '-g', '-Wshadow', '-W', '-pedantic',
'-O2', #'-O2',
# '-fPIC', '-D_GNU_SOURCE', # '-fPIC', '-D_GNU_SOURCE',
] ]
conf.env['CCFLAGS'] += common_ccflags conf.env['CCFLAGS'] += common_ccflags