1
votes

Recently, I am training a robot to go on itself with Reinforcement Learning in webots 2019a. However, I cannot figure out how to reset the world with Supervisor in Python. Thus I have to click the RESET button everytime it fails. So, how to use a Supervisor to reset the world?

In official doc @ https://www.cyberbotics.com/doc/reference/supervisor?tab=python @func: resetPhysics is as follows:

class Node: def resetPhysics(self): # ...

However, the previous part of the doc is talking about Supervisor node. I don't know how to use it. Can anyone give an example on it? I would appreciate it a lot if someone can help me.

1

1 Answers

1
votes

In Webots R2019a, a supervisor is simply a 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. There are different ways to reset the physics of a simulation, partially or totally. A simple search for the "reset" keyword on this page will list them all. However, I guess the one you want to use is simulationReset(), as it does the same as the RESET button of the user interface.