diff --git a/docs/source/_static/tutorials/setting-up-pycharm/001-start-menu.png b/docs/source/_static/tutorials/setting-up-pycharm/001-start-menu.png new file mode 100644 index 00000000..8c32c69d Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/001-start-menu.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/002-privacy-policy.png b/docs/source/_static/tutorials/setting-up-pycharm/002-privacy-policy.png new file mode 100644 index 00000000..b3781261 Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/002-privacy-policy.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/003-create-project.png b/docs/source/_static/tutorials/setting-up-pycharm/003-create-project.png new file mode 100644 index 00000000..ae759391 Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/003-create-project.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/004-create-project-config.png b/docs/source/_static/tutorials/setting-up-pycharm/004-create-project-config.png new file mode 100644 index 00000000..c0a8e87a Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/004-create-project-config.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/005-new-file.png b/docs/source/_static/tutorials/setting-up-pycharm/005-new-file.png new file mode 100644 index 00000000..8b185d9b Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/005-new-file.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/006-new-file-config.png b/docs/source/_static/tutorials/setting-up-pycharm/006-new-file-config.png new file mode 100644 index 00000000..dbe5f1e6 Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/006-new-file-config.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/007-settings.png b/docs/source/_static/tutorials/setting-up-pycharm/007-settings.png new file mode 100644 index 00000000..91508c98 Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/007-settings.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/008-settings-tab.png b/docs/source/_static/tutorials/setting-up-pycharm/008-settings-tab.png new file mode 100644 index 00000000..3b564e93 Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/008-settings-tab.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/009-settings-install.png b/docs/source/_static/tutorials/setting-up-pycharm/009-settings-install.png new file mode 100644 index 00000000..b386ab04 Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/009-settings-install.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/010-install-sbot.png b/docs/source/_static/tutorials/setting-up-pycharm/010-install-sbot.png new file mode 100644 index 00000000..d7d095af Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/010-install-sbot.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/011-install-success.png b/docs/source/_static/tutorials/setting-up-pycharm/011-install-success.png new file mode 100644 index 00000000..c247b287 Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/011-install-success.png differ diff --git a/docs/source/_static/tutorials/setting-up-pycharm/012-code.png b/docs/source/_static/tutorials/setting-up-pycharm/012-code.png new file mode 100644 index 00000000..c7e13a1e Binary files /dev/null and b/docs/source/_static/tutorials/setting-up-pycharm/012-code.png differ diff --git a/docs/source/tutorials/index.rst b/docs/source/tutorials/index.rst index 0ef74f14..b6c1f108 100644 --- a/docs/source/tutorials/index.rst +++ b/docs/source/tutorials/index.rst @@ -7,6 +7,7 @@ This section contains guides that will help your use your robotics kit. :maxdepth: 1 connecting-your-kit + setting-up-pycharm using-your-kit electronics-labs python-whirlwind-tour diff --git a/docs/source/tutorials/setting-up-pycharm.rst b/docs/source/tutorials/setting-up-pycharm.rst new file mode 100644 index 00000000..2fc5d443 --- /dev/null +++ b/docs/source/tutorials/setting-up-pycharm.rst @@ -0,0 +1,108 @@ +Setting up the PyCharm IDE +========================== + +This tutorial will guide you through setting up the `PyCharm `__ editor with support for our robot software. This means that the editor can do a better job of checking your code and suggesting as you type, saving you wasting time transferring your code to your robot only to find that a variable name has been mispelt, or something equally menial! + +First, open up PyCharm from the Start Menu: + +.. figure:: /_static/tutorials/setting-up-pycharm/001-start-menu.png + :alt: Searching for and selecting PyCharm in the Start Menu. + :scale: 75% + + Searching for and selecting PyCharm in the Start Menu. + +It may ask you to read and accept their terms and conditions before you can proceed: + +.. figure:: /_static/tutorials/setting-up-pycharm/002-privacy-policy.png + :alt: The terms and conditions dialogue box. + :scale: 75% + + The terms and conditions dialogue box. + +Firstly, we will need to create a new project. + +.. figure:: /_static/tutorials/setting-up-pycharm/003-create-project.png + :alt: The welcome dialogue, with the Create New Project button. + :scale: 75% + + The welcome dialogue, with the Create New Project button. + +Next, you will need to configure the environment for your project. This ensures that +we are using a compatible version of Python (3.6 or later), and that Pycharm is aware of the +other code running on, and controlling your robot. + +At the top of the dialogue box, choose an appropriate location to save your code. + +.. hint:: If you are using a university computer, files that are placed in your ``H:/`` drive will + be synchronised and backed up across any other university computer. + +Select *New Environment using Virtualenv*, and Python 3.6 for the base interpreter. + +.. warning:: The location of Python 3.6 may vary by computer. Ask a volunteer for help if you are stuck. + +.. figure:: /_static/tutorials/setting-up-pycharm/004-create-project-config.png + :alt: Project configuration dialogue + :scale: 75% + + Project configuration dialogue + +Once PyCharm has finished loading, we need to create a new ``main.py``. + +Right-click on your project name, select New -> Python File. + +.. figure:: /_static/tutorials/setting-up-pycharm/005-new-file.png + :alt: Create a new Python file + :scale: 75% + + Create a new Python file + +You will need to name your file ``main.py`` or your robot will not recognise it. + +.. figure:: /_static/tutorials/setting-up-pycharm/006-new-file-config.png + :alt: Naming your file + :scale: 75% + + Naming your file + +In order to get suggestions as you type your code, you'll need to install the same Python package that is used on your robot, which is called ``sbot``. You can do this by opening PyCharm's settings, navigating to the "Project Interpreter" tab, and pressing the Install button: + +.. figure:: /_static/tutorials/setting-up-pycharm/007-settings.png + :alt: Opening PyCharm's settings from the File menu. + :scale: 75% + + Opening PyCharm's settings from the File menu. + +.. figure:: /_static/tutorials/setting-up-pycharm/008-settings-tab.png + :alt: The Project Interpreter tab in PyCharm's settings. + :scale: 75% + + The Project Interpreter tab in PyCharm's settings. + +.. figure:: /_static/tutorials/setting-up-pycharm/009-settings-install.png + :alt: This button opens the package installation window. + :scale: 75% + + This button opens the package installation window. + +Enter "sbot" into the search bar and ensure it is selected in the pane on the left, then press "Install Package". This will take some time, so wait for the green success message. + +.. figure:: /_static/tutorials/setting-up-pycharm/010-install-sbot.png + :alt: Installing sbot + :scale: 75% + + Installing sbot + +.. figure:: /_static/tutorials/setting-up-pycharm/011-install-success.png + :alt: Installation success + :scale: 75% + + Installation success + +You are now ready to program your robot. Pycharm will give you auto-suggestions and let you know if your +code is mis-spelt or has other common errors. + +.. figure:: /_static/tutorials/setting-up-pycharm/012-code.png + :alt: Code auto-suggestions + :scale: 75% + + Code auto-suggestions