热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

synchronousmodeAPIquestion

Lookingatthe0.9.5versionofthesynchromous_mode.pyexample,atline119,120,and12

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)



   



推荐阅读
author-avatar
淡忘那曾经的你_953
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有