(args)
| 1356 | |
| 1357 | |
| 1358 | def collision_statistics_loop(args): |
| 1359 | try: |
| 1360 | # Wait for crowd service. |
| 1361 | time.sleep(3) |
| 1362 | c = Context(args) |
| 1363 | print('Collision statistics loop running.') |
| 1364 | |
| 1365 | statistics_file = open('statistics_collision.log', 'w') |
| 1366 | sim_start_time = time.time() |
| 1367 | |
| 1368 | while True: |
| 1369 | start = time.time() |
| 1370 | do_collision_statistics(c, time.time() - sim_start_time, statistics_file) |
| 1371 | time.sleep(max(0, 1 / COLLISION_STATISTICS_MAX_RATE - (time.time() - start))) # 40 Hz |
| 1372 | # print('({}) Collision statistics rate: {} Hz'.format(os.getpid(), 1 / max(time.time() - start, 0.001))) |
| 1373 | except Pyro4.errors.ConnectionClosedError: |
| 1374 | pass |
| 1375 | |
| 1376 | |
| 1377 | def main(args): |
nothing calls this directly
no test coverage detected