Skip to content

Instantly share code, notes, and snippets.

@Miura55
Last active March 17, 2022 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Miura55/4d7c4002d939280dcc441fa1b210ec15 to your computer and use it in GitHub Desktop.
Save Miura55/4d7c4002d939280dcc441fa1b210ec15 to your computer and use it in GitHub Desktop.
Install ROS melodic for Raspberry Pi
#!/bin/bash
# Install ROS melodic on Raspberry Pi OS Buster
# Ref: http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Melodic%20on%20the%20Raspberry%20Pi
echo "Start Install"
# Setup ROS Repositories to source list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt -y upgrade
sudo apt -y upgrade --fix-missing
# Install dependence software
sudo apt install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake
# Init rosdep
sudo rosdep init
rosdep update
# Create workspace for build ROS
mkdir -p ~/ros_catkin_ws
cd ~/ros_catkin_ws
# Set ROS struct
rosinstall_generator desktop --rosdistro melodic --deps --wet-only --tar > melodic-desktop-wet.rosinstall
# Init workspace
wstool init src melodic-desktop-wet.rosinstall
# Resolve dependences
rosdep install -y --from-paths src --ignore-src --rosdistro melodic -r --os=debian:buster
# Build ROS Melodic
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j2
# Set environment
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
echo "Finish Install"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment