在webots 2019a中,如何使用Supervisor用Python重置物理世界?

In webots 2019a, how to use Supervisor to reset the physical world with Python?

最近,我正在训练一个机器人在 webots 2019a 中进行强化学习。但是,我不知道如何在 Python 中用 Supervisor 重置世界。因此,每次失败时我都必须单击 RESET 按钮。 那么,如何使用Supervisor来重置世界呢?

官方文档@https://www.cyberbotics.com/doc/reference/supervisor?tab=python @func: resetPhysics 如下:

class节点: def resetPhysics(自我): # ...

但是,文档的前一部分是在谈论 Supervisor 节点。 我不知道如何使用它。任何人都可以举个例子吗? 如果有人能帮助我,我将不胜感激。

在 Webots R2019a 中,主管就是 Robot node which has its supervisor field set to TRUE. Therefore, to use a supervisor to reset the physical world, you need to add a Robot node in your simulation (or turn your existing Robot into a supervisor by setting its supervisor field to TRUE). Once done, this robot can use the Supervisor API。 有多种方法可以部分或全部重置模拟的物理特性。在 this page will list them all. However, I guess the one you want to use is simulationReset() 上简单搜索 "reset" 关键字,因为它的作用与用户界面的 RESET 按钮相同。