Categories

Installation of Ubuntu MATE and ROS Kinetic on Raspberry Pi 2 and Pi 3

In this document, we will guide you on How to Install Ubuntu MATE 16.04.2 LTS and ROS Kinetic on Raspberry Pi.

 

 

Step1: Download the image for Ubuntu MATE

Official Download Link for Ubuntu MATE for Raspberry Pi
https://ubuntu-mate.org/download/
It comes packaged as an XZ archive so use 7 Zip to extract the IMG file.

 

Step2: Download and Install Win32 Disk Imager

https://sourceforge.net/projects/win32diskimager/
Installing an OS onto a Raspberry Pi requires you to use another computer to write the image file onto a micro SD card. You must have a way to mount a micro SD card onto the computer using either an inbuilt or external USB reader.

  • Insert your micro SD card and launch Win32 Disk Imager.
  • Select your extracted Ubuntu Mate IMG file and change the Device to the drive letter of your micro SD Card.
  • Click Write to begin the process.

  • It will take about 10 minutes to write the image

 

Step 3: Eject the device safely in Windows, insert it into the Raspberry Pi 3 and power it on.
  • Connect Raspberry Pi to Monitor or TV using HDMI cable.
  • Select English as the Language and click Continue.

  • Select “I don’t want to connect to a wi-fi network right now” and click Continue.

  • Select an appropriate location on the map to set the timezone and system locale and click Continue

  • Select an appropriate keyboard layout and click Continue.

  • Enter an appropriate Name, Username and Computer name and then a password. Select “Log in automatically” and click Continue.

  • The installer will now proceed to configure the system.

  • When configuration is complete you will see the splash screen below.

  • Go to the System Menu in the top left corner and select Preferences – Internet and Network – Network Connections.

  • Select “Wired connection 1” under Ethernet and click the Edit button. Click on the “IPv4 Settings” tab at the top.

  • Click on the Method drop-down list and select Manual.

  • Enter an appropriate IP Address, a Netmask in CIDR notation and the Gateway address. Enter your networks DNS server address. Click Save. Click Close to finish.

 


 

How to install ROS Kinetic on Raspberry Pi 3 (Ubuntu Mate)

 

The ROS framework is compatible with a short list of Linux distributions. Neither the hardware side is not better. There are just few hardware architectures compatible with ROS. Raspberry Pi is one of the development boards compatible in terms of hardware with ROS.

So, I thought to install ROS Kinetic on the Raspberry Pi 3 running Ubuntu Mate. But only a certain version of Ubuntu Mate is compatible with ROS and Raspberry Pi 3, it is about the Ubuntu MATE for Raspberry Pi 3. This is an OS version released last year and include support for the WiFi and Bluetooth modules integrated into the Pi 3.

The OS version used by me on Raspberry Pi 3 is Ubuntu MATE 16.04.2.

The ROS version that I have installed is Kinetic Kame. Kinetic was released early last year and is compatible with Ubuntu Mate 16.04. I chose this version for two reasons:

  1. it will be officially supported for the next five years;
  2. it is the most complete version after Indigo;

The first step in installing ROS on Raspberry Pi 3 is called Mate. Ubuntu Mate. The operating system is simple to install. I followed the steps on the download page, and within minutes I managed to have a Pi 3 running Ubuntu Mate.

What you find below are the steps to install ROS Kinetic on the Raspberry Pi 3.

 

Step1 : Go to System -> Administration -> Software & Updates

 

Step2 : Check the checkboxes to repositories to allow “restricted,” “universe,” and “multiverse.”

Software and Updates

 

 

Step3 : Setup your sources. List
sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’

 

Step4 : Setup your keys
wget http://packages.ros.org/ros.key -O – | sudo apt-key add –

 

Step5 : To be sure that your Ubuntu Mate package index is up to date, type the following command
sudo apt-get update

 

Step6 : Install ros-kinetic-desktop-full
sudo apt-get install ros-kinetic-desktop-full

 

Step7 : Initialize rosdep
sudo rosdep init
rosdep update

 

Step8 : Setting up the ROS environment variables
echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
source ~/.bashrc

 

Step9 : Create and initialize the catkin workspace

mkdir -p ~/catkin_workspace/srccd catkin_workspace/src

catkin_init_workspace

cd ~/catkin_workspace/

catkin_make

 

Step10 : Add the catkin_workspace to your ROS environment

source ~/catkin_workspace/devel/setup.bash

echo “source ~/catkin_workspace/devel/setup.bash” >> ~/.bashrc

 

Step11 : Check the ROS environment variables
export | grep ROS

 

The setup looks like in the picture 

Check the ROS installation
  1. Open a new terminal and type: roscore
  2. Open a new terminal and type: rosrun turtlesim turtlesim_node

 


Testing Rplidar

 

  • ### Create a ROS Workspace

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace

  • ### Clone the ROS node for the Lidar in the catkin workspace src dir

git clone https://github.com/robopeak/rplidar_ros.git

  • ### Build with catkin

cd ~/catkin_ws/catkin_make

  • ### Set environment when the build is complete

source devel/setup.bash

  • ### Launch demo with rviz

Check the authority of rplidar’s serial-port :

ls -l /dev |grep ttyUSB

Add the authority of write: (such as /dev/ttyUSB0)

sudo chmod 666 /dev/ttyUSB0

Start a rplidar node and view the scan result in rviz.

$ roslaunch rplidar_ros view_rplidar.launch    #for rplidar A1/A2

Start a rplidar node and run rplidar client process to print the raw scan result

 

Result

 

Rviz will pop-up and show a background grid. The “view” from the laser scanner will be marked in red. The laser scanner is positioned at the center of the grid, it has a range of roughly 15cm to 6 meters, so you’ll be able to see everything around it on its scanning plane within that range.

About the Author

rakesh@robu.in

Related Post

Submit a Review

Display Name

Email

Title

Message