How to Install ROS Kinetic on Raspberry Pi 3 running Raspbian Stretch Lite

I want to install a Raspberry Pi 3 board on an autonomous robot and use it to monitor and control the robot. All communication is via WiFi Internet with ROS Kinetic working on multiple machines.

To use Pi resources more efficiently, I thought I needed an operating system like Raspbian Stretch Lite. The interaction with this system is done through type commands. It doesn’t have GUI and other software included with the Desktop version. In conclusion, it is a perfect operating system if you want to not stress the Pi board with too many tasks that you do not need anyway.

The system will be configured so that Raspberry Pi is the master. The Roscore will run on the robot instead on the remote PC. On the PC I just want to see the message that coming from Pi or send some manual correction back to the robot.

In this tutorial, you will find the steps necessary to install the ROS Kinetic version with no GUI tools (ROS-Commo includes ROS package, build, and communication libraries).

  • Step 1: Download and install Raspbian Stretch Lite
    The installation instructions for Raspberry Lite on Raspberry Pi 3 are described here.

  • Step 2: Connect via SSH to Raspberry Pi to run more easily the ROS Kinetic installation controls.
    sudo sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    wget -O - | sudo apt-key add -
    sudo apt-get update
    sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake
    sudo apt install dirmngr
    sudo rosdep init
    rosdep update
    rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
    wstool init src kinetic-ros_comm-wet.rosinstall
    rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r --os=debian:stretch
    sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic -j2
    source /opt/ros/kinetic/setup.bash
    echo 'source /opt/ros/kinetic/setup.bash' >> ~/.bashrc
    mkdir -p ~/catkin_workspace/src
    cd catkin_workspace/src
    cd ~/catkin_workspace/
    source ~/catkin_workspace/devel/setup.bash
    echo 'source ~/catkin_workspace/devel/setup.bash' >> ~/.bashrc
    export | grep ROS
  • Step 3 (optional): The installation process takes at least two hours. If you have problems and want to reinstall the operating system with ROS Kinetic, the simplest solution is to clone the memory card as soon as you have finished the initial installation. Here are the steps needed to clone the memory card.

Because I’m not an expert on Linux or ROS commands, I’ve found valuable information here and here.

Leave a Reply

Required fields are marked *.