Vineal Shiloh
Vineal Shiloh

Reputation: 31

How to run python files in 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"

Upvotes: 3

Views: 692

Answers (1)

Olivier Michel
Olivier Michel

Reputation: 900

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.

Upvotes: 2

Related Questions