ethanwu10/Erebus

Robot controller: Robots won't re-initialize after reset

Opened this issue · 0 comments

Resetting the simulation environment resets the state of sensors and actuators, however the controller currently only initializes the controller when a client is bound to it. We cannot just listen for a reset event because a few ticks will elapse between the reset being issued and the reset actually happening.

There appears to be no way to detect the actual reset from a controller since customData is not reset and the values on sensors and actuators do not update on reset (things like sampling period and target position return the same values from API calls as before the reset even though they are actually reset to default values). Thus, the supervisor has to handle notifying robot controllers of the reset (probably through customData).

This can be implemented through a list robot DEFs or by putting the robots into a group

Current workarounds:

  • re-bind (disconnect and reconnect) the clients to the robots after each reset