Skip to main content

Follow ARTag

An ARTag follower example for a stock Leo Rover

In this example, we will show you how to make the Leo Rover mobile robot follow an ARTag.

What to expect?

After completing this tutorial, your rover should be able to follow a printed ARTag.

Prerequisites

📄Connect to Leo Rover AP
Learn how to connect to your Leo Rover via WiFi.
📄Connect via SSH
Learn how to establish an SSH connection with your Leo Rover and access its terminal using Putty or OpenSSH.
📄ROS Development
Detailed guide on ROS development for Leo Rover, covering topics like adding additional functionalities, building ROS packages and more.

List of components

  1. Any computer which you can connect to the rover via ssh.
  2. Stock Leo Rover.

Mechanical integration

The only physical thing you'll need to do is to print an ARTag:

  • You can download an ARTag from here (you'll need only the one in the top-left corner), or you can follow the instruction on generating markers from ros wiki.
  • The printed ARTag needs to be 10cm x 10cm.
  • The printed ARTag needs to have a white border around it.

Here's an example of our ARTag that we used for this task:

leo rover alvar artag
info

Remember that the white border around the tag is necessary. You can leave the printed tag on the peace of paper, but we do recommend, to attach it to some harder material like cardboard - this way ARTag won't bend, so it will be easier for the software to notice it.

Software integration

tip

Since LeoOS 1.1.0 release, leo_examples package is installed by default. If the system is updated to at least 1.1.0 release you can skip software integration part.

info

To complete those steps, you need to connect to the rover's network first, and then log in using ssh (both covered in prerequisites).

info

One package in the leo_examples repository depends on ar_track_alvar package. As there is no release for the ROS version running on the rover (noetic) yet, you have to install it manually. To do so, type:

sudo apt install ros-noetic-ar-track-alvar

Installing using apt

You can install the package using apt by typing on the rover:

sudo apt install ros-noetic-leo-examples

Then you just need to source the ROS workspace:

source /opt/ros/${ROS_DISTRO}/setup.bash

Building from source

You can also get all needed software from our leo_examples github repository. You need to clone it on the rover in the ros workspace directory (if there's no such a directory, then, first go through the ROS development tutorial):

cd ~/ros_ws/src
git clone https://github.com/LeoRover/leo_examples.git

Now, you need to install all the dependencies for the downloaded packages:

cd ~/ros_ws
rosdep update
rosdep install --from-paths src -i

Then, you need to source the directory and build the packages:

cd ~/ros_ws
source devel/setup.bash
catkin build
info

If your installation went without any errors, then you have successfully installed required software.

Examples

To run the example, you need to be connected to the rover via ssh. Once you do this, type in the terminal:

roslaunch leo_example_follow_ar_tag follow_ar_tag.launch

The rover will start following the ARTag once it detects it.

warning

The rover will follow only the ARTag with id 0, so it's important that you print the correct one - specified in the Mechanical Integration (Don't forget about the white border).

What next?

After completing this tutorial, you can try other examples from the leo_examples repository (line follower and object detection), or try other integration from our site.