Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miquelmassot/6be8988fd6bb1013645b to your computer and use it in GitHub Desktop.
Save miquelmassot/6be8988fd6bb1013645b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Add ros key
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu jessie main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
# Update && Upgrade with default YES
sudo apt-get update -y
sudo apt-get upgrade -y
# Install deps
sudo apt-get install python-pip python-setuptools python-yaml python-distribute python-docutils python-dateutil python-six
sudo pip install rosdep rosinstall_generator wstool rosinstall
# Init rosdep
sudo rosdep init
rosdep update
# Create catkin workspace
mkdir ~/ros
cd ~/ros
# Download required packages
rosinstall_generator ros_comm --rosdistro indigo --deps --wet-only --exclude roslisp --tar > indigo-ros_comm-wet.rosinstall
wstool init src indigo-ros_comm-wet.rosinstall
# Resolve dependencies
rosdep install --from-paths src --ignore-src --rosdistro indigo -y -r --os=debian:jessie
# Compile!
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo -j2
# ROS installed! Source it
"source /opt/ros/indigo/setup.bash" >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment