This is the documentation for setting up the software we use for working with Universal Robotics UR3 robotic manipulators We use compas and compas_fab with the ur_online_control libary with to control and simulate the UR3s. We also use the assembly_information_model library to send more complicated sets of geometry/commands for the robot, structured in relation to the physical assembly process.
We use Rhino 6 and Grasshopper. Below are instructions to install and run Rhino 6 at home (as a Princeton University affiliate).
Downloading Rhino is already listed on Princeton Websites. So to install the program follow the instructions here: Windows, Mac
Rhino runs on a zoo server ; therefore, it needs to be connected to a specific network to work. So when you're at Princeton, it is straightforward to run Rhino because you are most likely connected to the network there. At home, however, this is a little more complicated. For this reason, we need a VPN.
- Go to the following link and download the appropriate VPN software for your computer: https://vpn.princeton.edu/global-protect/getsoftwarepage.esp
- Set the VPN by following the instructions found in this page under the section Starting and disconnecting from GlobalProtect on your computer: https://princeton.service-now.com/service?sys_id=KB0012373&id=kb_article
- Now launch Rhino. Once Rhino is running, you can disconnect from the server. But anytime you want to open a new rhino window, you must be connected to the VPN.
These are the instructions for installing the software we use on top of Rhino 6.
_In this part you will download Anaconda, distribution of the Python programming language. By installing Anaconda you get everything you need to run Python code.
- Go to page: https://www.anaconda.com/products/individual
- Hit Download to take you to the location of the installation files
- Open the Anaconda3 installer using default settings
- Install for: Just Me
- Destination Folder: this can be wherever
- Advance options: none
- Last page you may want to uncheck both boxes unless you want those pages to open in your browser
In this part you will use the command prompt (terminal if on mac) to install compas and compas_fab (frameworks that will help you visualize the robots in rhino using grasshopper and python). You can read more about COMPAS and COMPAS_FAB here: Compas_fab, Compas. For this installation we will be using a command prompt specific to anaconda (the program we installed in the previous step). It may look intimidating at first. However, once you understand how to use the command prompt/terminal, it can be a very useful tool. If you want to read more about why developers use the command prompt/terminal check this article.
-
Open the anaconda prompt as an administrator
-
Install compas and compas_fab using the command line. In the anaconda prompt/terminal type in each of the lines below (hitting enter after each line).
- You can optionally copy and paste the lines.
- The first 4 lines create a conda environment. You can rename this environment, which we have written here as arc_311, to be anything you want. Just make sure you have the same environment name for every step
conda config --add channels conda-forge
conda remove --name arc_311 --all
conda create -n arc_311 python=3.6 compas=0.15.6 compas_fab=0.11.0 --yes
conda activate arc_311
python -m compas_rhino.install
python -m compas_fab.rhino.install -v 6.0
For the last two steps you will need to allow the anaconda prompt/terminal to make changes to local rhino files. So make sure you are logged in as an administrator.
- Finally, check to make sure that the installation worked by entering the following lines:
python
import compas_fab
compas_fab.__version__
You should see:
'0.11.0';
In this step we are starting a python file, adding the package compas_fab (which we installed in the previous step) and requesting the package's version. You should have installed the most current package. So a version of 0.11.0 or newer should be printed on the screen.
In this part you will download github desktop. You will use this to get some repositories from the web that will help you work with the robots in grasshopper. We are using github desktop to retrieve these files because we want to clone them instead of downloading them. Cloning is similar to downloading but has the option to update the files if they are changed by the creator.
-
Download & setup GitHub for desktop: https://desktop.github.com
- The proper type of GitHub should appear (i.e. mac, windows x64, etc.) however if it does not just download the appropriate version for your computer.
- Click installer for Windows and double click the downloaded zip folder for Mac to install.
- Open GitHub desktop.
- You don't need to sign in. However, it is recommended that you make an account and sign in.
-
Go to documents and find the GitHub folder
- This is where the repositories at default will be saved by default
- If you want you can create a subfolder for the repositories from this class (see part 3. v.). Make sure to not have spaces in the name of the subfolder and try to stay away from special characters as well. These specific characters can cause issues when referencing the paths (as we see in iv.)
-
Now we will clone two repositories that will allow us to us grasshopper and python to communicate to the robots (To clone each repository it is going to be the same process except for the step iii.)
- to file and select clone repository
- In the new window select the URL option
- Under repository URL type
First time: https://github.com/createchaos/ur_online_control_speckle
These files will help you connect to the robots
Second time: https://github.com/createchaos/assembly_information_model
These files will help with creating the robot inside rhino - Make sure that the local path is correct. Depending on which repository you are downloading it should look something like:
a.
C:\Users\name\Documents\GitHub\ur_online_control (or assembly_information_model)
in Windows b.\Users\name\Documents\GitHub\assembly_information_model
in Mac - (Optional) If you created a subfolder change path to
...\Documents\GitHub\name of your subfolder\ur_online_control (same with assembly_information_model)
-
If these repositories need to be updated you can simply do it with GitHub desktop.
- First hit the down arrow beside the current repository and navigate to one of the two we cloned in the steps above.
- GitHub will automatically check to see if the files have been updated. If for some reason it does not, simply click Fetch origin.
- If there is an update, you see a blue box that says pull origin. Click that box and GitHub will update your files so that they match the creator's. This is why cloning is super useful!
- First hit the down arrow beside the current repository and navigate to one of the two we cloned in the steps above.
In part 2 when we downloaded compas and compas_fab we had to add them to rhino. We now need to do that for the repositories we cloned as currently rhino cannot access them.
-
Make sure you're in the arc_311 conda environment. Type:
conda activate arc_311
-
For Mac:
- Copy the directory for the two folders that you just downloaded via Github Desktop (Part 3, step 3)
- you can select the folder in Finder, and press option+command+c to copy the directory as text
- in the terminal, type:
pip install -e folder_directory
for both ur_online_control_speckle and assembly_information_model- do this step twice, replacing the folder_directory with the actual directories from step 1.
- in the terminal, type:
python -m compas_rhino.install -p ur_online_control
python -m compas_rhino.install -p assembly_information_model
- Done. Now Rhino knows how to access the files you downloaded.
- Copy the directory for the two folders that you just downloaded via Github Desktop (Part 3, step 3)
-
For Windows:
- Open a new Rhino file
- Type editpythonscript into the command line
- This will open the python_editor.
- Go to tools → options
- Add each src file from each of the two repositories installed
- To do so hit add to search path (circled in red in photo)
- Navigate through your folders to find one of the two repositories.
- Click on the repositories folder. Find and select the src folder and hit okay
- This should look like \Users\name\Documents\GitHub\ur_online_control\src or \Users\name\Documents\GitHub\assembly_information_mode\src
- Then using the up arrow bring that path to the top of the list
- Repeat with the second repository
- To do so hit add to search path (circled in red in photo)
- Finally save the rhino file wherever you want. This makes it so that Rhino remembers the paths.
- Done!
- Open a new Rhino file
Example files are in the example folder.