display if webots waits for controller; at world reset/reload reconnect extern controller #3896
Thomas-Feldmeier
started this conversation in
Ideas
Replies: 1 comment
-
That is correct. However, you can easily implement the controller auto restart by simply using a launcher script that will launch your controller program and relaunch it after it quits. It is very simple to implement it in bash or python. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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".
Beta Was this translation helpful? Give feedback.
All reactions