Windows
Install Python SDK

Windows - Installing and using the BOW Python SDK

This tutorial assumes you have already installed the BOW System Tray application and simulator on your workstation. If not, follow this tutorial to get your environment set up.

Installing the Python SDK

  1. The simplest way to install the BOW SDKs is using the Systray application. Simply click the "Install SDKs" drop down menu and then select "Python SDK".
drawing
  1. Follow the onscreen prompts and wait for the installation to complete.

    1. If you receive the following error, then you will first need to install Python. To install Python, simply search for "Python 3" in the microsoft store and install. At the time of writing Python 3.11 is the latest version (3.7 or greater is required).
    drawing drawing
    1. If you receive the following error, then you will need to install Visual Studio Build Tools for C++, which is required for the installation of the Python package.
    drawing
    1. Visit the official downloads (opens in a new tab) page.
    2. Scroll down to "Build Tools for Visual Studio 2022" under the "Tools for Visual Studio" heading and click download.
    drawing
    1. Run the downloaded installer
    2. When the installer opens, under the "Workloads" tab, check the box for "Desktop development with C++" and select install.
    drawing
  2. When the installation is complete a dialog box will appear asking you to confirm and the Python SDK will now appear under the "Installed SDKs" section in the systray.

  3. To test the installation we can open a Python 3 terminal, either by searching for it under the start menu, or by running the command python. Then try importing the newly installed package, bow_client.

drawing
  1. If there are no errors as a result of this command then we know the package installed successfully, and you are ready develop!

Testing with a simulated robot

Now lets run your first BOW enabled Python program to control a simulated robot.

  1. Let's start by running the simulator, this can either be launched from the systray, "Launch Webots Simulator", or by running "Webots" from the start menu.
  2. In Webots, select File -> Open Sample World. In the menu that appears, navigate to BOW -> pal_robotics -> tiago++ -> tiago++.wbt and click OK.
drawing
  1. Once the project opens the BOW driver will start running automatically, after a short moment the simulated Tiago++ robot, named Buddy, will appear in the BOW systray under the "My Robots" heading. Select this robot, and it will appear under the "Current Selection" heading. You are now connected to Buddy.
drawing
  1. Before running our example project we need to install pynput, a python package which is used to get the keyboard input. Open a cmd or powershell window and use the command pip install pynput.
drawing
  1. Now let's navigate to an example project, by clicking on the installed SDK in the systray you will be taken to the tutorials directory (C:\Users\USER\.bow\tutorials\Python).
  2. For this example we will use the Keyboard Control project, open the keyboard control directory and within a cmd or powershell window run the command
python '.\keyboard_control.py\'
drawing
  1. You will see a window open which displays the image stream from the camera of the Tiago++. You will also see some activity in the console of the Webots sim which indicates that the connection to the robot has been made.
drawing
  1. Try controlling the robot using your keyboard. W, A, S and D keys control forwards, backwards and rotate, Q and E control strafing, the arrow keys control head movements.
  2. That's it, you have now tested your first BOW enabled robot using the Python SDK.

Experiment

Why not take this test further, your robot doesn't need to be on the same local network as your Python program. Why not run the simulated robot on one workstation and run the keyboard controller from another workstation on a different network to experience simulated telepresence!