Installation

ControlIt! is available open-source in the following git repository:

https://github.com/liangfok/controlit 

Other repositories useful for configuring and executing ControlIt! include:

The instructions below provide details on how to setup a workspace for compiling and using ControlIt!.

Minimum System Requirements

Ensure your system meets the following minimum system requirements:

  1. Ubuntu 14.04 LTS 64-bit Desktop
  2. Gazebo Simulator. The most recent version as of March 1, 2016 is 7.0.0. If you run into dependency errors during the installation process, try executing:
    $ sudo apt-get install libgdal-dev libgazebo7
    
  3. A good graphics card if you're running Gazebo
  4. ROS Indigo. Here are the official instructions. You should only need to install the following packages:
    $ sudo apt-get install ros-indigo-desktop ros-indigo-gazebo7-plugins ros-indigo-moveit* 
    $ sudo apt-get install ros-indigo-cmake-modules
    $ sudo apt-get install python-rosinstall
    $ sudo apt-get install python-catkin-tools
    
  5. After installing ROS, be sure to execute:
    $ sudo rosdep init
    $ rosdep update
    

Install Useful Applications

See:  Recommended Applications to Install

Install Third-Party Libraries

Install the necessary third party libraries by executing the following command:

$ sudo apt-get install python-simplejson libmuparser-dev libzmq-dev libfltk1.1-dev libfltk1.1

Download and install yaml-cpp 0.3.0. This is necessary since Ubuntu 14.04 by default uses yaml-cpp 0.5.0. Updating ControlIt! to use YAML 0.5.0 is being tracked by this issue. Here are the commands:

$ tar zxvf yaml-cpp-0.3.0.tar.gz
$ cd yaml-cpp
$ mkdir build
$ cd build
$ cmake -DBUILD_SHARED_LIBS=ON ..
$ make
$ sudo make install

Here are the files that are installed (you can remove them once we've upgraded to use YAML 0.5.0):

$ sudo make install
[ 79%] Built target yaml-cpp
[ 97%] Built target run-tests
[100%] Built target parse
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libyaml-cpp.so.0.3.0
-- Installing: /usr/local/lib/libyaml-cpp.so.0.3
-- Installing: /usr/local/lib/libyaml-cpp.so
-- Installing: /usr/local/include/yaml-cpp
-- Installing: /usr/local/include/yaml-cpp/stlnode.h
-- Installing: /usr/local/include/yaml-cpp/noncopyable.h
-- Installing: /usr/local/include/yaml-cpp/eventhandler.h
-- Installing: /usr/local/include/yaml-cpp/parser.h
-- Installing: /usr/local/include/yaml-cpp/dll.h
-- Installing: /usr/local/include/yaml-cpp/ostream.h
-- Installing: /usr/local/include/yaml-cpp/node.h
-- Installing: /usr/local/include/yaml-cpp/aliasmanager.h
-- Installing: /usr/local/include/yaml-cpp/conversion.h
-- Installing: /usr/local/include/yaml-cpp/exceptions.h
-- Installing: /usr/local/include/yaml-cpp/mark.h
-- Installing: /usr/local/include/yaml-cpp/nodeimpl.h
-- Installing: /usr/local/include/yaml-cpp/yaml.h
-- Installing: /usr/local/include/yaml-cpp/anchor.h
-- Installing: /usr/local/include/yaml-cpp/iterator.h
-- Installing: /usr/local/include/yaml-cpp/ltnode.h
-- Installing: /usr/local/include/yaml-cpp/nodeutil.h
-- Installing: /usr/local/include/yaml-cpp/emitter.h
-- Installing: /usr/local/include/yaml-cpp/nodereadimpl.h
-- Installing: /usr/local/include/yaml-cpp/traits.h
-- Installing: /usr/local/include/yaml-cpp/null.h
-- Installing: /usr/local/include/yaml-cpp/binary.h
-- Installing: /usr/local/include/yaml-cpp/stlemitter.h
-- Installing: /usr/local/include/yaml-cpp/emitfromevents.h
-- Installing: /usr/local/include/yaml-cpp/emittermanip.h
-- Installing: /usr/local/include/yaml-cpp/contrib
-- Installing: /usr/local/include/yaml-cpp/contrib/graphbuilder.h
-- Installing: /usr/local/include/yaml-cpp/contrib/anchordict.h
-- Installing: /usr/local/lib/pkgconfig/yaml-cpp.pc

Setup a ControlIt! ROS Workspace

Create a ROS workspace in your home directory. The official instructions are here. Below are the commands that you should execute.

Initialize a default ROS environment:

$ source /opt/ros/indigo/setup.bash

Create a new ROS workspace (the recommended workspace name is "controlit_workspace"):

$ mkdir -p ~/[workspace name]/src
$ cd ~/[workspace name]/src
$ catkin_init_workspace
$ cd ..
$ catkin_make

Edit your ~/.bashrc. Update it to include the following lines at the bottom (note that for now every line but one is commented out):

# Setup ControlIt! ROS workspace
source $HOME/[workspace name]/devel/setup.bash
# source `rospack find controlit_environment_config`/setup.sh
# source `rospack find controlit_models`/setup.sh
# source `rospack find controlit_configs`/setup.sh

To apply the changes, close and re-open your terminal(s). Verify that it worked by typing "roscd" and ensuring that it changes to directory ~/[workspace name]/devel.

Add a .rosinstall file to your workspace (note that the command below uses the vim text edtor -- feel free to use another text editor):

$ cd $HOME/[workspace name]/
$ vim .rosinstall

Save the following lines in the .rosinstall file (note: the following assumes you have uploaded your public SSH key to your github and bitbucket accounts.):

- setup-file: {local-name: /opt/ros/indigo/setup.sh}
- git: {local-name: src/controlit, uri: 'git@github.com:liangfok/controlit.git', version: master}
- git: {local-name: src/controlit_configs, uri: 'git@github.com:liangfok/controlit_configs.git', version: master}
- git: {local-name: src/controlit_demos, uri: 'git@github.com:liangfok/controlit_demos.git', version: master}
- git: {local-name: src/controlit_models, uri: 'git@github.com:liangfok/controlit_models.git', version: master}
- hg: {local-name: src/rbdl2, uri: 'ssh://hg@bitbucket.org/cfok/rbdl2'}
- git: {local-name: src/ros_shared_memory_interface, uri: 'git@github.com:liangfok/ros_shared_memory_interface.git', version: master}

If you cannot upload your public SSH key to your github and bitbucket accounts, use the following settings to use HTTP rather than SSH to download the software:

- setup-file: {local-name: /opt/ros/indigo/setup.sh}
- git: {local-name: src/controlit, uri: 'https://github.com/liangfok/controlit.git', version: master}
- git: {local-name: src/controlit_configs, uri: 'https://github.com/liangfok/controlit_configs.git', version: master}
- git: {local-name: src/controlit_demos, uri: 'https://github.com/liangfok/controlit_demos.git', version: master}
- git: {local-name: src/controlit_models, uri: 'https://github.com/liangfok/controlit_models.git', version: master}
- hg: {local-name: src/rbdl2, uri: 'https://bitbucket.org/cfok/rbdl2'}
- git: {local-name: src/ros_shared_memory_interface, uri: 'https://github.com/liangfok/ros_shared_memory_interface.git', version: master}

Update your workspace:

$ cd ~/[workspace name]
$ wstool update

Update your ~/.bashrc to include these lines (note that the source commands are all uncommented now):

# Setup ControlIt! ROS workspace
source $HOME/[workspace name]/devel/setup.bash
source `rospack find controlit_environment_config`/setup.sh
source `rospack find controlit_models`/setup.sh
source `rospack find controlit_configs`/setup.sh

To apply the changes, close and re-open your terminal(s). See the status of your workspace by executing:

$ cd ~/[workspace name]
$ wstool info

Compile and install RBDL 2:

$ cd ~/[workspace name]/src
$ cd rbdl2 && mkdir build && cd build
$ cmake ../ -DRBDL_STORE_VERSION=ON -DCMAKE_BUILD_TYPE=Release
$ make && sudo make install

The RBDL shared object will be installed in /usr/local/lib/ and the header files will be installed in /usr/local/include/rbdl/.

Compile ControlIt!:

$ cd ~/[workspace name]
$ catkin_make

Configure Your System's Shared Memory:

Many of ControlIt!'s demos use shared memory to communicate with the simulation. To prevent needing to allocate this shared memory each time you restart your computer (and having to type your sudo password), it is recommended that you permanently allocate sufficient shared memory by executing the command below:

$ rosrun shared_memory_interface set_shared_memory_size_persistent 536870912