🖥️Desktop Environment

If you're already an experienced roboticist and developer you can program Misty by setting up your own desktop environment and code editor. There you can program Misty using Python, C# or JavaScript. While you can do most of your programming in Misty Studio, for more complex programs that require external dependencies you may need to use your preferred code editor.

Setting up a desktop environment for Python in Windows

Step 1. Power on Misty

Misty has to be powered on and connected to your WIFI network in order to receive commands.

Step 1. Download your code editor and program packages

In order to start setting a desktop environment to program Misty in Python you will need to download a code editor, a Python installer and the Misty Python SDK package. For your code editor you can use Visual Studio Code or any other Python editor.

Step 3. Set up a Path

Once you've installed Visual Studio Code and Python on your computer, you will need to create a working directory where you can extract the Misty Python SDK package zip file. The extracted contents can be place in any folder on your desktop. (For example C:\Users\YourName\Desktop\ MistyPythonSDK) Now to be able to put the code editor, Python and the Misty SDK in same desktop environment and establish a working path, you will need to search and open 'Edit the system environment variables' function in the Windows Search Bar. You will see window called System Properties, click on the button called Environment Variables.

After you open the environment variables windows you will see a section with a list of folders, choose 'Path' and click on the button 'Edit'.

Inside the path folder you will need to add all the folders paths that contain your code editor and python executables, as well as python packages and the working directory with the Misty Python SDK.

Step 4. Install Dependencies

In your Visual Studio Code you will need to set your working directory as the default directory for the terminal. This can be done in settings by searching "terminal.integrated.cwd" and writing in the folder path of the working directory. Now you can navigate back to your terminal and install the following dependencies. Place them in your terminal and press Enter. In some case you will need to install additional dependencies if you want to use more Python libraries. Visual Studio Code will highlight the lines of code that need additional dependencies to work, by hovering over the line you can use 'Quick Fix' to find the dependency you need.

pip install 'requests>=2.25.1'
pip install 'websocket-client<=0.57.0'
pip install 'yapf>=0.30.0'

Step 5. Create Robot Generator

To be able to connect to Misty via her IP address and use the API endpoints you will need to create a Python file in your working directory called update.py . Save the file and run it using the command python update.py in your terminal.

from mistyPy.GenerateRobot import RobotGenerator
RobotGenerator("ROBOT-IP_ADDRESS-GOES-HERE")

Step 6. Create your Python Project

Congratulations! You have now set up your desktop environment for Misty. You can now create a Python project and start programming Misty. Remember to keep your project file in the same folder path as your Misty Python SDK. You can run your program by using the run button in the top right corner and cancel your program by deleting the terminal session or pressing Control + C.

Last updated