aidudezzz / deepbots

A wrapper framework for Reinforcement Learning in the Webots robot simulator using Python 3.

Home Page:https://deepbots.readthedocs.io/

Repository from Github https://github.comaidudezzz/deepbotsRepository from Github https://github.comaidudezzz/deepbots

SupervisorEmitterReceiver step

tsampazk opened this issue · comments

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.