Install ROS on Turtle Rover
Here is a quick tutorial on how to install ROS on your Turtle Rover

Prepare your Turtle Rover for ROS installation

First, connect your device to Turtle Rover's console via SSH
Next step is to establish Internet connection

Prepare ROS installation tools

Update package list
1
sudo apt update
Copied!
Make sure you have dirmngr installed (it’s necessary for downloading public keys from the HKP server)
1
sudo apt install dirmngr
Copied!
Add ROS repositories and download GPG keys
1
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
2
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
Copied!
Install prerequisites
1
sudo apt install python-rosdep python-rosinstall-generator python-wstool python-rosinstall python-catkin-tools python-psutil build-essential cmake
Copied!
Initialize rosdep and update its package list
1
sudo rosdep init
2
rosdep update
Copied!

Installing ROS packages

To install ROS on TurtleOS you can either compile package from source or download one of our precompiled workspaces.

A. Use our precompiled workspace

We have precompiled ROS workspaces to make installation process easier. You can find them together with lists of packages they contain here.
Download selected one to your host machine and upload it to your Rover:
Or download it directly to your Rover using wget. E.g.:
1
wget https://github.com/TurtleRover/turtleos-ros/releases/download/v0.3/2019-07-10-ROS.tar
Copied!
Create a directory for ROS kinetic workspace and extract the archive to that directory:
1
sudo mkdir -p /opt/ros/kinetic
2
sudo tar -xf 2019-07-10-ROS.tar -C /opt/ros/kinetic
Copied!
Use rosdep to install system dependencies
1
rosdep install --from-paths /opt/ros/kinetic/share --rosdistro kinetic -i -r -y
Copied!

B. Compile ROS package sources

Create a directory to store our catkin workspace
1
mkdir -p ~/ros_catkin_ws
2
cd ~/ros_catkin_ws
Copied!
Use rosinstall_generator tool for creating a rosinstall file. This file will contain a list of ROS packages alongside their sources
1
rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
Copied!
ros_comm contains basic ROS communication tools. The command above will include this package and all its recursive dependencies
Download packages to source directory using wstool
1
wstool init src kinetic-ros_comm-wet.rosinstall
Copied!
Install system dependencies of downloaded packages using the rosdep tool
1
rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r
Copied!
Initialize and configure catkin workspace
1
catkin init
2
catkin config --install -i /opt/ros/kinetic -j 2
Copied!
The configuration shown above says that the workspace is going to be installed in the /opt/ros/kinetic directory and that up to 2 parallel jobs can be running
NOTE: In this tutorial we use catkin commands from catkin-tools. If you want to use the catkin_make command instead, you can follow this tutorial
Build and install the workspace
1
sudo catkin build
Copied!
CAUTION: Raspberry Pi has limited resources and TurtleOS doesn’t have a swap partition. This fact can lead to the device becoming unresponsive over time, because of memory exhaustion. If this results in the compilation being terminated, you can try limiting the jobs running based on the memory usage sudo catkin build --mem-limit 50% The next job won’t be started as long as the memory usage is above 50% Also remember to have decent power supply (a 5V/2.5A charger would do fine)
That’s it! Our workspace is installed in the /opt/ros/kinetic directory.

Testing ROS Master Node

To access all the installed tools and packages you need to "source" the workspace. To do this, use this command:
1
source /opt/ros/kinetic/setup.bash
Copied!
If you want the command to be executed at the start of every terminal session, simply add it to the .bashrc file
1
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
Copied!
Now, to run Master Node, type:
1
roscore
Copied!
On another terminal, "source" the workspace and then type:
1
rostopic list
Copied!
You should see /rosout and /rosout_agg topics listed.

Adding or Updating packages

Let's say you want to add joy package. So first, you need to create a new rosinstall file
1
rosinstall_generator joy --rosdistro kinetic --deps --wet-only --tar > joy.rosinstall
Copied!
Next, merge it with our workspace and update package sources
1
wstool merge joy.rosinstall -t src
2
wstool update -t src
Copied!
Don't forget to install system dependencies via rosdep
1
rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r
Copied!
Rebuild our workspace
1
sudo catkin build
Copied!
Last modified 2yr ago