I want to control an autonomous robot with a Raspberry Pi 3 board and ROS Kinetic. The Pi 3 will be connected to another Linux PC used for monitoring and control settings. The setup for computers are in this article.
Due to the lack of Pi resources in terms of processor and memory, I’m forced to use resources more efficiently. The first step is to install on Pi 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. Theoretically speaking, 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 use the Raspberry Pi board as the master while the PC is the slave. This configuration means to run the Roscore on the robot instead on the remote PC. The PC is used to see the message that coming from Pi or send some manual correction back to the robot.
I installed the ROS Kinetic version with no GUI tools on the Raspbian Stretch Lite and I put all the steps below.
- Step 1: Download and install Raspbian Stretch Lite
The installation steps for Raspberry Lite are described here.
- Step 2:Connect via SSH to Pi and run the below commands:
sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’
wget http://packages.ros.org/ros.key -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
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 -j1
(thanks CaJU and Bruce W)
echo ‘source /opt/ros/kinetic/setup.bash’ >> ~/.bashrc
mkdir -p ~/catkin_workspace/src
echo ‘source ~/catkin_workspace/devel/setup.bash’ >> ~/.bashrc
export | grep ROS
- Step 3 (optional): The installation process takes several hours and sincerely, I don’t want to repeat the installation too soon. I decide to clone the memory card as soon as I finished the initial installation. Here are the steps needed to clone the memory card.