-
Notifications
You must be signed in to change notification settings - Fork 0
Link Pycharm and Webots
Navigate to Pycharm Section in Official Instruction
You need to (follow that section):
-
Add Content Root under Project -> Project Structure
-
Add Environmental Variable under Run -> Run/Debug Configuration
-
Important: Add Windows Environmental Variable (follow this and Official List)
WEBOTS_HOME
=C:\Program Files\Webots
(Or any Installation Location)Path
= Create new one if not exist or add%WEBOTS_HOME%\lib\controller
by double clicking orginalPath
Variable and click NewPath
(only if Python < 3.8) = add%WEBOTS_HOME%\msys64\mingw64\bin
and%WEBOTS_HOME%\msys64\mingw64\bin\cpp
PYTHONPATH
= Create new one if not exist or add${WEBOTS_HOME}\lib\controller\python3X
(Replace X with python version (ie. python39))PYTHONIOENCODING
=UTF-8
Important: Restart computer to take effect, won't work if not restarted
-
Open Webots and Navigate to File -> Open Sample World or open desired World (the one declared in the .py file)
-
Toggle Controller Option to
<extern>
by clicking controller (in one of the nodes in the Window on the left with many circles) -> select<extern>
-
Under the same tab, toggle Supervisor to
TRUE
-
Click Reset Similation (Ctrl+Shift+T) and Run
-
Run the .Py file (eg. Webots_example_Run.py)
-
Done :)
Solution:
- Check settings in Pycharm
- Check Environmental Variables in Windows settings; Remember to restart computer to take effect
Solution:
- Restart simulation and Restart Webots software
- Restart computer