UBlox EVK-M8N GPS module

This tutorial will guide you through the process of connecting a UBlox GPS module to your Leo Rover.





UBlox EVK-M8N GPS module

This tutorial will guide you through the process of connecting a UBlox GPS module to your Leo Rover.

EVK-7 / EVK-8 / EVK-M8 evaluation kits make evaluating the high performance u-blox 7, u-blox 8 and u-blox M8 positioning products simple. The built-in USB interface provides both power supply and high-speed data transfer, and eliminates the need for an external power supply. The u-blox evaluation kits are compact, and their user-friendly interface and power supply make them ideally suited for use in laboratories, vehicles and outdoor locations.

In this tutorial we will present the process of connecting a UBlox GPS module to your Leo Rover and integrating it with the system on the UBlox EVK-M8N GPS module example.

The steps might slightly differ for other UBlox models, but should be essentially similar.

What to expect?

After completing this tutorial, you should be able to gather the GPS data and get it published on ROS topics.


List of components

  1. UBlox GPS module (we have used the UBlox EVK-M8N GPS module)
  2. Any computer which you can connect to the rover via ssh.

Mechanical integration

When it comes to mounting the module, any solution that works for you is okay. You can 3D print a special mounting plate, use a velcro or even a tape.

Wiring and electronics connection

Wiring up the module is very simple, as it doesn't require external power supply. You just need to connect the module with a USB cable with the rover via the USB socket in the mounting plate. There is a micro-usb mounting hole with the USB sign on the module, and you need to plug in the USB cable there.

Software integration

The first thing you can do is to make sure your device has the correct permissions and is available at the fixed path on your system. To do this, you can add the following rule to the udev service. We will need idVendor and idProduct, to make the rules for the correct device. To get that information, you need to connect to the rover via ssh, and then, you can use the lsusb command. It will list all connected usb devices. In the output, you should look for something named like U-Blox AG [u-blox 8]

lsusb output

Now, our idVendor and idProduct are the two strings after ID divided by: sign. In our case, idVendor is 1546 and idProduct is 01a8.

After getting those two, the only thing that is left is the port that the device connects to. You can get it by running dmesg -w in the terminal, and then connecting the module to the rover. You should see that the new device is registered, and on what port (with this command, you can also get the idVendor and idProduct values).

dmesg -w output

Now, you need to make a udev rules file.


Paste these lines to /etc/udev/rules.d/ublox.rules file and reload udev rules by typing:

Your device should now be available at the /dev/ublox_gps path.

We want the sensor functionality to be available in the ROS ecosystem, so you should install a ROS package that provides a node for the sensor you are trying to integrate.

Now, create a launch file that would start the node with a fitting configuration.


Include your launch file in the robot.launch file (somewhere between <launch> tags), so that your node will start at boot.

In /etc/ros/robot.launch:

Your robot should be aware of where the module is located and what space it occupies. You can ensure it does that by creating a URDF model of the module.


Make sure that "frame_id" param in the launch file and "link name" in ublox.urdf.xacro file have the same value.

And including it in the description that is uploaded at boot.


The last step is to either reboot the robot

or restart the leo service


Checking the GPS module accuracy

Type this command into the console to check the data sent by GPS module:

You should see a lot of data flowing through the topic. Stop the data acquisition with CTRL+C and have a look on a usual data frame.

Using Google Maps you can easily evaluate the precision of your GPS module. Find the latitude and longitude data in the data frames send by the module. Copy and paste it into google maps search bar. When a pin appears, you should be able to see where the module thinks it is. Usually it is off by some factor. Depending on the amount of interferences and the quality of the GPS module, the difference between real location and the position gathered with GPS module may vary. Right click on the map location you believe you are at and use "Measure distance" option at the bottom of the list. Then, create another spot for the distance measuring tool right where the red marker is. Google will then do the math and show you the distance between your real location and where the GPS module thinks it is.

Data visualisation with Mapviz

Using Mapviz – a package similar to RVIZ, yet focused on visualization of 2D data- you can easily visualize the data gathered by the GPS module. Installing the package boils down to using this command:

Since Mapviz is a program using GUI you may want to connect to the Leo Rover via remote desktop. Follow this tutorial if you want to learn how: Connect via remote desktop.

Launch Mapviz with:

You'll be greeted by a blank screen with configuration window on the left. Using the Add button on the bottom of this window add tile_map and navsat plugins. Change the source of tile_map to Stamen (terrain) (Or any other available option) and the topic of navsat to the topic your GPS module is publishing data to (for us it’s /ublox_gps_node/fix).

Make sure the tile_map plugin is listed first and navsat second. Otherways, points created by navsat will be hidden behind the map tiles.

From now on a dot will appear on the map every time your GPS module publishes data at the topic you chose.

What next?

GPS modules are commonly used in projects involving outside autonomous navigation. As of right now, we have no tutorials on such a thing, however, our tutorial on indoor autonomous navigation you might be something you'll be interested int. You can also check our Knowledge Base for other instructions.


Need help? Contact us - contact@fictionlab.pl