Installing FRCSim Manually (Ubuntu)
FRCSim is best supported on Ubuntu 14.04, but you can run it on any platform supported by Gazebo. See http://gazebosim.org/tutorials For how to install. Gazebo does not yet run on windows.
FRCSim is nothing more than a collection of existing software plus a few small libraries. In order to use FRCSim, you will need the following:
- Gazebo (5.0 or later)
- Eclipse (Mars or later)
- Gcc 4.9
- Java 8
- WPILib Eclipse Plugins
- WPILib Gazebo Plugins
- Google's Protobuf library
Even if you're team is only using C++, you still need java8.
Furthermore, even if you're team is only using Java, you still need g++-4.9
Adding repositories to Apt
On Ubuntu 14.04, You'll need to tell Apt where to find the package you want. If you are using 15.10 you can skip this step
Run the following in your terminal, but only the ones marked for you version of ubuntu
sudo add-apt-repository ppa:openjdk-r/ppa -y #ONLY FOR 14.04 and 15.05 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y #ONLY FOR 14.04 sudo apt-get update
The first PPA is for java, and the second is for g++-4.9.
If you intend to also compile C++ programs for ARM as well as for Simulation, you'll need to install the C++ toolchain. See Installing Eclipse (C++/Java)
Install Dependencies From Apt
Fixing Executable Locations and Names
For some versions of Ubuntu, you may run into issues where g++ --version gives you 4.8 instead of 4.9.
You can verify the issue by looking at the output of:
ls -l /usr/bin/g++
If it looks like this, then you've got a problem. Here it says the g++ actually points to g++-4.8, which is not what we want.
lrwxrwxrwx 1 root root 7 Jan 4 19:05 /usr/bin/g++ -> g++-4.8
To fix this, we simply run the following, which tells g++ we want 4.9, rather than 4.8.
sudo rm -f /usr/bin/g++ sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++
Installing eclipse is a little more work, since we want the latest version. Use the following commands to download and install.
wget -O eclipse.tar.gz \ http://eclipse.mirror.rafal.ca/technology/epp/downloads/release/mars/1/eclipse-cpp-mars-1-linux-gtk-x86_64.tar.gz tar -xf eclipse.tar.gz sudo mv eclipse /opt sudo ln -s /opt/eclipse/eclipse /usr/bin/eclipse
Install WPILib Eclipse Plugins
See the gazebo website (https://gazebosim.org) for detailed instructions, or just run this in the terminal.
wget -O /tmp/gazebo6_install.sh http://osrf-distributions.s3.amazonaws.com/gazebo/gazebo6_install.sh; sudo sh /tmp/gazebo6_install.sh
Install WPILib Gazebo Plugins
The last dependency is the gazebo plugins and example models. These will be distributed in the following zip file: http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/wpilib/simulation/simulation/1.0.0/simulation-1.0.0.zip
1. Download the zip
2. make a directory called simulation in the wpilib directory
3. Extract it to that new simulation folder
unzip ~/Downloads/simulation-1.0.0.zip -d ~/wpilib/simulation
4. Make sure you have installed the development package for gazebo. This should already be installed if you used the gazebo script above.
sudo apt-get install libgazebo6-dev
You will need to compile and install gz_msgs, which is provided in the simulation.zip you just downloaded. This is so that same zip can work with many versions of protobuf and ubuntu.
Enter the ~/wpilib/simulation/gz_msgs directory and run the following commands:
sudo apt-get install cmake libprotobuf-dev libprotoc-dev protobuf-compiler -y mkdir build cd build cmake .. make install
You should now have libgz_msgs.so in ~/wpilib/simulation/lib and a few new header files in ~/wpilib/simulation/include/simulation/gz_msgs
Install Sample Robot Models
The field and game piece models for 2016 will be available on January 12th
There are a few sample models and worlds that will be useful when you develop your own custom robots. Models can be downloaded here (https://usfirst.collab.net/sf/frs/do/downloadFile/projects.wpilib/frs.simulation.frcsim_gazebo_models/frs1160?dl=1) and unzip into the ~/wpilib/simulation directory.
wget -O models.zip \ https://usfirst.collab.net/sf/frs/do/downloadFile/projects.wpilib/frs.simulation.frcsim_gazebo_models/frs1160?dl=1 unzip models.zip mv frcsim-gazebo-models-4/models ~/wpilib/simulation/ mv frcsim-gazebo-models-4/worlds ~/wpilib/simulation/
Configuring your Development Environment
Now that you have all the dependencies, there are a few things you can do to make life easier. These steps are optional but recommended for your sanity.
1. Allow the executables to be run anywhere by making symbolic links to your /usr/bin directory
sudo ln -s ~/wpilib/simulation/frcsim /usr/bin/frcsim sudo ln -s ~/wpilib/simulation/sim_ds /usr/bin/sim_ds
2. Pin frcsim, sim_ds, and eclipse to your taskbar. Even better, you can move the .desktop files for frcsim, sim_ds, and eclipse into the proper folder.
sudo mv ~/wpilib/simulation/frcsim.desktop /usr/share/applications sudo mv ~/wpilib/simulation/sim_ds.desktop /usr/share/applications sudo mv ~/wpilib/simulation/eclipse.desktop /usr/share/applications
3. Setup the icon for sim_ds. Run the following
sudo mkdir /usr/share/icons/sim_ds sudo cp ~/wpilib/simulation/sim_ds_logo.png /usr/share/icons/sim_ds/
Ok, now that you have everything setup, continue to see how to build robots models and run them in simulation!
A video walk-through of this process is available here: