Skip to content

Instantly share code, notes, and snippets.

@guilyx
Last active April 9, 2020 14:58
Show Gist options
  • Save guilyx/e892da220cac00c04e8ce034d9465bb1 to your computer and use it in GitHub Desktop.
Save guilyx/e892da220cac00c04e8ce034d9465bb1 to your computer and use it in GitHub Desktop.
ROS Melodic Install Script (Ubuntu 18.04)
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 apt update
sudo apt install ros-melodic-desktop-full
sudo rosdep init
rosdep update
if [ $SHELL = "/usr/bin/zsh" ]
then
echo "source /opt/ros/melodic/setup.zsh" >> ~/.zshrc
source ~/.zshrc
elif [ $SHELL = "/bin/bash" ]
then
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
else
echo "ERROR : SHELL ENVIRONMENT NOT SUPPORTED (ZSH and BASH only !!)"
fi
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
if [ $SHELL = "/usr/bin/zsh" ]
then
source ~/.zshrc
elif [ $SHELL = "/bin/bash" ]
then
source ~/.bashrc
else
echo "ERROR"
fi
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
if [ $SHELL = "/usr/bin/zsh" ]
then
echo "source ~/catkin_ws/devel/setup.zsh" >> ~/.zshrc
elif [ $SHELL = "/bin/bash" ]
then
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
else
echo "ERROR : SHELL ENVIRONMENT NOT SUPPORTED (ZSH and BASH only !!)"
fi
echo $ROS_PACKAGE_PATH
@guilyx
Copy link
Author

guilyx commented Apr 9, 2020

Need to check for the distro before starting to try and install ROS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment