aidudezzz / deepbots

A wrapper framework for Reinforcement Learning in the Webots robot simulator using Python 3.
https://deepbots.readthedocs.io/
GNU General Public License v3.0
236 stars 50 forks source link

SupervisorEmitterReceiver step #37

Closed tsampazk closed 4 years ago

tsampazk commented 4 years ago

SupervisorEmitterReceiver class implements the following step method:

def step(self, action):
        self.supervisor.step(self.timestep)

        self.handle_emitter(action)
        return (
            self.get_observations(),
            self.get_reward(action),
            self.is_done(),
            self.get_info(),
        )

self.supervisor.step(self.timestep) is a Webots method for stepping the controller and needs to be part of a conditional, e.g. from Webots docs: while supervisor.step(timestep) != -1:

This probably need to change to:

if self.supervisor.step(self.timestep) == -1:
        exit()

to allow for the controller to exit normally.