This webpage has as fundamental goal to be a repository of the experience done during the Mobile Robots course: “Localization using Extended Kalman Filter in a Lego NXT”.

During the 5th year of Engineer Electrical and Computers the undergraduate students had the Mobile Robots Course where navigation and localization concepts where taught, particularly the Extended Kalman Filter (EKF).

The course Mobile Robots falls in the Engineer Electrical and Computers curricula from the Faculty of Engineering of the University of Porto (FEUP), Portugal.




During the navigation in this Website, it is possible to download: 1) The theoretical lessons’ slides. 2) An application where the EKF Algorithm is implemented. 3) A guide to do, aiming understand a little bit the EKF, with the help of the EKF Algorithm Application. 4) The simulation scenario. 5) The Java Code to run in the LegoNXT when the intended scenario is the real scenario.

In the EKF Algorithm, the simulator or the real NXT sends the sensors and the tachometer values, which are received by the EKF Algorithm ( written at Java Code). The algorithm written at Java for Mindstorms (that runs in your Pc) sends reference velocities to the simulator or the real Lego NXT. The interface UDPtest is only used as monitoring interface of the extended Kalman filter variables and to configure the algorithm parameters. This structure as the purpose of test the algorithm either in the simulation and reality, without difficult in the change of the scenario. The final algorithm that runs completely in the Lego NXT is similar to the last one referred (Java Code that runs in your PC). This Code is also available.

Theoretical Lesson Slides Portuguese


Theoretical Lesson Slides English


EKF Algorithm: The EKF Algorithm Application allows configure the Filter covariance to reach a good performance either in the simulation either in the real Lego NXT.

How To Use the EKF Algorithm Application: To run EKF algorithm you need to follow this guide.


Exercises with the EKF Algorithm Application: To understand a little bit about the EKF do this guide of six exercises.


Lego NXT Bluetooth Communication: Java Code that need to be downloaded to the Lego NXT, when the intention is to run the EKF Algorithm in the real Scenario.

Version that runs entirely in the NXT BRICK: This version does not communicate with the user interface

How to build the LEGO FEUP–Pictures

Video 1: Project Implemented at the simulation scenario. Interface where the EKF covariance, state variables, and covariance ellipses could be seen.

Video 2: Project Implemented at the real scenario, seven turns, without loose its localization.

Video 3: Project Implemented at the real scenario, without 2 walls. The vehicle, as expected, loose its localization.

How Install the Lejos NXJ, the IDE Eclipse and its Configuration, run and compile programs.


Personal Tools