In this part you will download anaconda a python distribution. By downloading anaconda you receive everything you need to run python. If you are wondering what python is, it is a programing language. Here is python.org's definition.
- 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
- Now we will use the prompt to install compas and compas_fab. In the anaconda prompt/terminal type in each of these lines found below (hitting enter after each line). You can optionally copy and paste all of the lines. Either use (crtl v / cmd v) depending on your computer. If that does not work try right clicking. However before you do that you may want to change the name of the python environment. In this case it is simply your_env_name but you could change this to be anything. Just make sure you have the same environment name for every step
conda config --add channels conda-forge
conda remove --name your_env_name --all
conda create -n your_env_name python compas compas_fab --yes
conda activate your_env_name
python -m compas_rhino.install -v 7.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. For the last line, if your Rhino version is 6 instead of 7, simply omit the '-v 7.0' part of the last line.
Explained below is what each line is does:
(base) conda config --add channels conda-forge
Adds the package conda-forge: https://conda-forge.org/#about
(base) conda remove --name your_env_name --all
Removes any environment with that name in preparation to create new one with updated version of python compas and compas_fab
(base) conda create -n your_env_name python compas compas_fab --yes
Creates a new python environment and installs compas and compas_fab. Python environments are helpful because they store everything you need for a certain project. In this case, in our project our dependencies are compas and compas_fab so we include them in our environment. If we were to start another project we could then create a new environment that includes everything we need for that project.
(base) conda activate your_env_name
Activates the environment created in the previous step
(your_env_name) python -m compas_rhino.install -v 7.0
Installs compas and compas_fab for rhino 7 (defaults to rhino 6 if the '-v 7.0' switch is omitted)
- Finally check to make sure that the installation worked by typing/copying and pasting the following code:
python
import compas_fab
compas_fab.__version__
You should see:
'0.19.1'
You can type:
exit()
to exit the >>>python prompt.
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.16.0 or newer should be printed on the screen.
In this part you will download github desktop. You will use this to get a repository 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.
- If you have an account sign in. If not it is recommended that you make one.
-
Go to documents and find the GitHub folder
- This is where the repositories at default will be saved
- 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.)
The ABB communication library is a collection of python functions that makes communication between the ABB robot controller and your computer possible. While ABB provides its own software (RobotStudio) that allows you connect to the robot controller, change settings, send instructions, and also receive feedback, a python-based means of communication is much a easier to learn and implement in design projects, especially because we can execute python code directly from Rhino and Grasshopper.
While Compas and CompasFab are available to download and install using only conda commands, the ABB communication library must be cloned from GitHub and then installed in a similar way.
You can clone the repository using a desktop application such as the Github app. To keep things simple, however, we are just going to clone the repository using the command line.
- Make a folder in Documents called GitHub
- Open Anaconda Prompt
- Use Anaconda Prompt to activate your environment (from Part 2)
If you don't remember what you named your environment in Part 2, type into Anaconda Prompt:
conda env list
Once you know the name of your environment, activate it.
conda activate your_env_name
- Navigate to the GitHub folder that you created in Documents. Copy the path.
- Clone the repository
cd (insert here the path you just copied in step 4)
git clone https://github.com/createchaos/abb_communication.git
- A folder was just created in Documents > GitHub called abb_communication. Copy the path for the abb_communication folder. Run the following commands by copying them one at a time into Anaconda Prompt. Press enter after each line.
cd (insert here the path you just copied in step 6)
pip install -e .
python -m compas_rhino.install -p abb_communication -v 7.0
Tip: don't forget the dot at the end of the pip install -e .
command!
Tip #2: Again, if you are running Rhino 6, you can just leave out the '-v 7.0' and it will default to install to Rhino 6
We will use Docker to set up backends that will enable us to visualize the robots in Grasshopper. Docker containers are like pre-packaged bubbles of code that we can access to avoid building the robot communication setup from scratch.
more info on docker here: https://gramaziokohler.github.io/compas_fab/latest/backends.html
-
Docker reqires Windows 10 Pro, Enterprise, or Education.
- To check what software you have on your computer, type "System Information" in the Search Box.
- If you do not already have Windows 10 Pro, Enterprise, or Education, you can get a license here: https://princeton.onthehub.com/
- Click "start shopping", enter your Princeton login information, and download Windows 10 Education.
- Note: If you have trouble switching the license key, try restarting your computer.
-
Download Docker Docker for Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows Docker for Mac: https://hub.docker.com/editions/community/docker-ce-desktop-mac
-
Check to see if Docker is running by looking for the whale
- If you get an error about needing to enable Virtualization in BIOS, follow the instructions here: https://bce.berkeley.edu/enabling-virtualization-in-your-pc-bios.html Note: The instructions will vary depending on the type of computer you have.
Visual Studio Code allows us to visualize the Docker containers that are running on our machines.
-
Download Visual Studio code https://code.visualstudio.com/
-
Install the Docker Extension for Visual Studio Code
- Navigate to the extensions tab (4th icon on the left bar with four boxes)
- Search for Docker
- Install Docker extension
The following steps will get you setup to use the small ABB robot arms at the ECL
- Turn on the robots
- Use Visual Studio Code to get Docker running. You do this by navigating to abb_communication>src>abb_communication>docker and then whichever robot you want to visualize, right-clicking on the .yml file and selecting 'Compose Up'
- Connect the robots to your computer. You will probably need to use an ethernet - USB adapter
- Change the settings for the ethernet cable you just connected. In Network & Internet Settings (PC), select 'Change Adapter Options'. Find the Realtek PCIe Ethernet option, right-click and select Properties. In the scroll box, select IPv4 item and click on Properties. Change to a hard-coded IP address of 192.168.0.XX and Subnet mask of 255.255.255.0. Note: the IP address you input has to start with 192.168.0 but the fourth number can be anything other than 102 and 103 (these are the IP addresses of the robots). 15 is a nice number, but feel free to pick your favorite.
-
Open Rhino and Grasshopper. Open the robot_playground_abb_arduino.ghx. Note: If you are going to make changes to the file, please save it locally (not in the ARC 574 repository folder on your computer)
-
use Anaconda Prompt to active your environment. Then ping the robots to check if you are connected. The small ABBs are 192.168.0.102 and 192.168.0.103 Note: if you receive a message that says "request timed out", go back and make sure you have completed steps 1-5 correctly.
- In the Grasshopper file, connect to ROS and load the robot for visualization
-
On the robot controller, go to the Production Window. Tap the "PP to main" button on the screen. Press the live switch on the controller (hold half way and keep holding forever). Press play. On the screen you will see "waiting for connection"
-
In the Grasshopper file, init, robot on, update settings. After hitting the robot on button, you should see "connected" on the robot controller.
- Now you are ready to send planes!
You will need to do the following steps before connecting to the UR3 robots in the ECL.
- Clone the ur_fabrication_control repository using GitHub desktop. The URL is: https://github.com/augmentedfabricationlab/ur_fabrication_control
- Switch from the Master branch to the branch called tum-princeton-restructuring - SKIP FOR NOW
- A folder was just created in Documents > GitHub called ur_fabrication_control. Copy the path for the ur_fabrication_control folder. Run the following commands one at a time in Anaconda Prompt. Press enter after each line.
conda activate your_env_name (or whatever your environment is named)
cd (insert here the path you just copied in step 6)
pip install -e .
python -m compas_rhino.install -p ur_fabrication_control -v 7.0
- SKIP FOR NOW: Open a new Rhino file. Add the src file from this folder into Rhino. When you are finished with the following steps, save the Rhino file. This will make sure it remembers the path.
- type EditPythonScript in the command line
- Go to tools > options
- Add src file for the ur_fabrication_control repository
- Add to search path (square icon with a little star in the corner)
- Navigate through your folders to find the repository. It will be in Documents > Github > ur_fabrication_control
- Inside this folder, select the src folder and hit okay. This path will now appear in the list
- Use the arrow icon to bring this path to the top of the list
- Save your Rhino file so Rhino rememebers the path
The following steps will get you setup to use the UR robot arms at the ECL
-
Turn on the robots
-
Use Visual Studio Code to get Docker running
-
Connect the robots to your computer. You will probably need to use an ethernet - USB adapter
-
Change the settings for the ethernet cable you just connected. Use 192.168.10.44 to make things easier (the 44 could be changed to something else, but this is what is already set up in the file)
-
Open Rhino and Grasshopper (units should be mm). Open the robot_playground_ur_arduino.ghx. Note: If you are going to make changes to the file, please save it locally (NOT in the ARC 574 repository folder on your computer)
-
use Anaconda Prompt to active your environment.
-
In the Grasshopper file, connect to ROS and load the robot for visualization
-
Ping the robot to make sure you are connected
-
Now you are ready to send planes!