Skip to content

Catkin System Setup

Nate Koenig edited this page Oct 20, 2021 · 10 revisions

Follow these instructions if you're interested in using Ignition Fortress.

Before you start, make sure your computer satisfies the minimum System Requirements.

  1. Setup and install dependencies:

     sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    
     sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
    
     sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
    
     wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
    
     sudo apt-get update
    
     sudo apt-get -y install build-essential cmake libusb-dev libccd-dev libfcl-dev lsb-release pkg-config python ignition-dome ros-melodic-desktop \
     ros-melodic-tf2-sensor-msgs ros-melodic-robot-localization ros-melodic-ros-control ros-melodic-control-toolbox ros-melodic-twist-mux ros-melodic-joy \
     ros-melodic-rotors-control python3-vcstool python3-colcon-common-extensions ros-melodic-ros-ign g++-8 git python-rosdep
    
  2. Update all ROS and Ignition packages, in case you have some of them already pre-installed:

     sudo apt-get upgrade
     sudo rosdep init && rosdep update
    
  3. Set the default gcc version to 8:

     sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
    
  4. Create a catkin workspace, and clone the SubT repository:

     # Setup the workspace
     mkdir -p ~/subt_ws/src && cd ~/subt_ws/src
    
     git clone https://github.com/osrf/subt
    
  5. Build the workspace:

     # Source ROS distro's setup.bash
     source /opt/ros/melodic/setup.bash
    
     # Build and install into workspace
     cd ~/subt_ws/
     rosdep install --from-paths src --ignore-src -r
     catkin_make -DCMAKE_BUILD_TYPE=Release install
    
  6. Launch the SubT Simulator:

     # Source SubT setup file
     source ~/subt_ws/install/setup.bash
    
     # Test installation
     ign launch -v 4 competition.ign worldName:=tunnel_circuit_practice_01 circuit:=tunnel robotName1:=X1 robotConfig1:=X1_SENSOR_CONFIG_1
    
     **NOTE**: When the Ignition Virtual Tunnel Circuit is installed and launched for the first time, the GUI will show blank panels for a few minutes until the models are downloaded.
               They are stored under the `~/.ignition/fuel/fuel.ignitionrobotics.org/openrobotics/models` directory.
    
  7. Test movement by driving the X1 robot forward

     # Open another terminal and run this command:
     rostopic pub /X1/cmd_vel geometry_msgs/Twist '{linear:  {x: 0.5, y: 0.0, z: 0.0}}'
    

See also:

Team Configuration to understand how to choose the robots in your team and Custom Control for a basic example of a controller that can be used as a starting point for your solution.

Updating the SubT Simulator

You can get the most recent simulation models by running the following command:

ign fuel download -v 4 -j 8 -u "https://fuel.ignitionrobotics.org/OpenRobotics/collections/SubT Tech Repo"

You can get the most recent code with:

cd ~/subt_ws/src/subt
git checkout master
git pull origin master

And update Ignition Gazebo with:

sudo apt-get update && sudo apt-get upgrade ignition-dome