本文整理汇总了Python中Simulator.Simulator.step方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.step方法的具体用法?Python Simulator.step怎么用?Python Simulator.step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simulator.Simulator
的用法示例。
在下文中一共展示了Simulator.step方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Simulator
# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import step [as 别名]
if __name__ == '__main__':
# Initialize the components
simulator = Simulator()
goalPlanner = GoalPlanner()
pathPlanner = PathPlanner()
timestep = 0.1
try:
while True:
now = time.time()
# Run all of the components
world = simulator.step()
goal = goalPlanner.step(world)
path = pathPlanner.step(goal)
# Wait for the next timestep
elapsed = time.time() - now
if (elapsed < timestep):
time.sleep(timestep - elapsed)
else:
print "Main loop took too long!"
# Stop on ctrl-C
except KeyboardInterrupt:
pass