Last active
January 9, 2020 11:02
-
-
Save tejashah88/99354163996b039f3c6b519a73186a14 to your computer and use it in GitHub Desktop.
Installing ROS on an Kubuntu Cosmic (18.10) system by building from source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: http://wiki.ros.org/melodic/Installation/Source | |
function install_ros_first_time() { | |
# Install bootstrap dependencies | |
sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential -y | |
# Initialize rosdep | |
sudo rosdep init | |
rosdep update | |
# Create catkin workspace folder | |
mkdir ~/ros_catkin_ws | |
cd ~/ros_catkin_ws | |
# Install desktop-full version | |
rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall | |
wstool init -j8 src melodic-desktop-full.rosinstall | |
# Resolve missing dependencies | |
rosdep install --from-paths src --ignore-src --os=ubuntu:bionic --rosdistro melodic -y | |
# Build catkin workspace (release version) | |
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release | |
# Add built ROS tools to path | |
source ~/ros_catkin_ws/install_isolated/setup.bash | |
} | |
function update_ros_build() { | |
cd ~/row_catkin_ws | |
# Save old installation file | |
mv -i melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old | |
# Generate new installation file | |
rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall | |
# See difference between old and new install file | |
diff -u melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old | |
# Incorporate new install file into workspace and update it | |
wstool merge -t src melodic-desktop-full.rosinstall | |
wstool update -t src | |
# Rebuild workspace | |
./src/catkin/bin/catkin_make_isolated --install | |
# Add rebuilt ROS tools to path | |
source ~/ros_catkin_ws/install_isolated/setup.bash | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment