-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Webots is handling internal controllers very well. They are automatically started and restarted at world reset.
Webots should display why the world is not running. What extern controller is not connected or what (intern or extern) controller is not calling step(...)?
"" controllers have to be started manually outside of webots. If these controllers and webots are both started by an script, and webots is loading the world for several seconds, during this loading time the following error message is been shown in the extern controllers console:
Cannot open file: /tmp/webots-7310-vWkop6/WEBOTS_SERVER (retrying in 1 second)
Cannot open file: /tmp/webots-7310-vWkop6/WEBOTS_SERVER (retrying in 2 seconds)
...
This message should be less alarming, maybe "Webots has not loaded the world yet (retrying in 1 second)".
(like the message "Webots doesn't seems to be ready yet: (retrying in 1 second)" if the external controller is started but webots is not)
If the world is reloaded or reset, the extern controller can't reconnect, the only way is to stop the controllers and run them again. It would be more convenient if the extern controller can something like this:
while(true) {
Robot *robot = new Robot();
int timeStep = (int)robot->getBasicTimeStep();
while (robot->step(timeStep) != -1) {
...
}
delete robot;
}
This is not possible now: "delete robot" terminates the program. "new Robot()" shows the error message "Only one instance of the Robot class should be created".