enter image description here

I'm rather new at Webots.

How do I change the controller for a node to another controller code in a different location?

I'm having trouble changing the code for an e-puck. The edit controller always takes me back to the original code, and I can't save to another location.

I saved it as Epuck_Glider.c, but it won't take any coding changes, and whenever I try to reopen it via "edit controller" it always reopens and runs the original code.


1 Answer 1


The controller can be changed from the Field editor (located just below the Scene Tree). When you select the EPuck.controller field, the Field editor displays the currently used controller as well a "Select..." button to change it:

enter image description here

Note that Webots expects that a controller is located in a directory having the same name as the main controller source file. So, if you save your controller C file with a different name in the same directory as another controller, this new C controller won't be recognized. Here you can find some documentation about the expected Webots project directory structure.

If you want to create a new controller, then the simplest option is to use the "New Robot Controller..." wizard. Since Webots R2022b this wizard is located in the "File / New" menu.

Disclaimer: I am a part of the Webots development team.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.