作者:淡忘那曾经的你_953 | 来源:互联网 | 2023-10-11 12:45
Looking at the 0.9.5 version of the synchromous_mode.py example, at line 119,120, and 121 there are:
clock.tick()
world.tick()
ts = world.wait_for_tick()
In order to put Carla in synchronous mode are these three calls all needed?
Btw, Carla document is great in giving an introduction but it will probably help a lot to have a more detail description in https://carla.readthedocs.io/en/latest/python_api/.
Thanks.
该提问来源于开源项目:carla-simulator/carla
Not sure this issue is the place to ask a question about the API, but I stumbled across it so here you go : )
How do I get to know how much simulation time is there between each tick?
Via the timestamp object in the world snapshot. E.g., (silly example but it illustrates the point):
1 2 3 4
| t_prev = world.get_snapshot().timestamp.elapsed_seconds
world.tick()
t_curr = world.get_snapshot().timestamp.elapsed_seconds
t_between_ticks = t_curr - t_prev |
And how can i set/change that?
In syncrhonous mode, you directly set this value in the world settings.
1 2 3 4
| settings = world.get_settings()
settings.synchronous_mode = True
settings.fixed_delta_seconds = 0.05 # same as fps=20
world.apply_settings(settings) |