Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run python files in Webots

Tags:

python

webots

I am a new user to webots R2109b. I wrote a code to run youbot but I'm not able to run the controller python files. Even if I reload my world files it's not compiling my controller files. Should I change the python path to the webots directory? if yes how can I change my python compiler path to the webots

Whenever I run webots with my python controller file. My file is not even compiling and instead its running .exe file in controller

INFO: youbot: Starting controller: "C:\Program Files\Webots\projects\robots\kuka\youbot\controllers\youbot\youbot.exe"
INFO: void: Starting controller: "C:\Program Files\Webots\resources\projects\controllers\void\void.exe"
like image 395
Vineal Shiloh Avatar asked Jan 30 '26 22:01

Vineal Shiloh


1 Answers

Beware: Python programs are not compiled.

When Webots launches a controller program, it searches inside the controller folder for a binary file with the same name as the folder, e.g., my_controller/my_controller.exe. if not found, it will try to copy it from the my_controller/build folder. If not such folder exists, it will try other possibilities, including launching my_controller/my_controller.py. This is certainly what you want to achieve. Therefore, I would recommend you to delete any file and subfolder from your controller folder except your Python controller program. That should fix your problem.

like image 196
Olivier Michel Avatar answered Feb 01 '26 12:02

Olivier Michel