Tutorial: constraint programming for robotics

This tutorial is about Constraint Programming (CP), Interval Analysis (IA) and their applications to mobile robotics.

Interval analysis yields methods to compute intervals in place of real numbers, enclosing uncertainties in the mean time.
Constraint Programming aims at solving a complex problem by defining it in terms of constraints coming from the equations or the measurements.
Both concepts match perfectly for a large number of applications including Robotics, which is the subject of this tutorial.

Constraint programming?

There are several ways to deal with state estimation in mobile robotics. The constraint programming approach consists in defining a problem as a set of rules and letting a solver perform the estimation. For mobile robotics, rules are constraints coming from state equations.

Efforts have been done to propose operators and solvers to apply these constraints. The goal of this tutorial is to learn how to use them and understand the efficiency of the approach on realistic robotic applications. We will see that some problems that are difficult to solve with conventional methods (Kalman filters, particle approaches) can be easily dealt with by constraint programming. This is for instance the case of poor observation measurements, time uncertainties, delays, or when the initial conditions of the system are not known.

The tutorial will stand on the Codac library, that provides tools for computations over sets of reals and trajectories. It has been designed to deal with dynamical systems defined by non-linear differential equations and involving constraints such as trajectory evaluations, time uncertainties or delays. These computations stand on interval analysis, a well suited tool that reliably propagates uncertainties.


Prerequisite for attending the tutorial are:

  • basic knowledge of Python or C++ (the exercises are available in both languages);

  • although the tutorial is about state estimation, you do not need skills in Kalman or particle filters.

Codac is fully supported on Linux systems (C++ and Python3) and Windows (Python3).
We are currently working on making Codac available for macOS (any help is welcome!). Meanwhile, we propose a Codac-online solution: this will allow you to use Codac in Python without having to install the library on your machine.

Content of the tutorial

A list of exercises is proposed with realistic robotic applications:

Step 0: (installation)

Before starting the tutorial, you can read some words about the concepts of Constraint Programming and Interval Analysis. This will give you a first glimpse of the philosophy of this tutorial.

To get ready, you need to install the Codac library on your computer. Please follow the related page of the manual to see how to do it:

Then, depending on your preference between C++ or Python, you can run some Hello World! program to be sure everything is working well so far:



In case you encounter difficulties to install Codac on your computer, an alternative solution is to try Codac online with Repl.it. You will find more information on the following page:

Step 1:

During this first step, we will install the library and perform the state estimation of a static robot between some landmarks. For the moment, we will assume that the robot does not move and is only receiving range-only data from the landmarks.
This will be an introduction to intervals, constraints and networks of contractors.

Step 2:


We will go a step further: now the landmarks are perceived with both range and bearing data. The resolution will involve new constraints, and a decomposition will be achieved. In the second part, we will tackle the problem of indistinguishable landmarks. We still assume that we know their position, but the robot is not able to make the association between the map and the observations. The goal of this exercise is to develop our own contractor to solve this problem.

Step 3:


Now, we will make the robot move and see how we can handle uncertainties on trajectories. This will be done by solving the range-only problem of Lesson B, now in a dynamical context with asynchronous measurements.

Step 4:

We will use the tubes to solve the problem Set-membership state estimation by solving data association, that has been presented during the ICRA 2020 conference (see logo_youtube_small the video presenting the paper.
We will end this tutorial with a range-only SLAM problem and see how Codac can be used for online missions.

The following video illustrates the result of Lesson H:

Organizers and technical support

For any question, do not hesitate to use the MOOC platform of this tutorial, so that other participants can reply or see posted answers.


logo_ensta logo_labsticc logo_rts logo_hannover

logo_contredo logo_gdrmacs logo_gdrrob

logo_intcomp logo_dga