Embedded Systems Group (ES)

Polygon Processing for Safety-Critical Embedded Systems

Modern industrial embedded systems in the automotive industry integrate a steadily growing functional range. In the past years, all these systems were restricted to only monitor components of the own car as done e.g. by fuel injection and anti-lock braking systems. Current and future embedded systems, however, are also aware of the environment of the car. Radar and optical sensors are already available in many cars to observe the objects in the environment of the car. These systems can now be used to analyse the situation, to assist the driver and even to actively take over some of his tasks, similar to the adaptive cruise control (ACC), which has now been well-established for a long time.

Whenever the spatial behaviour of vehicles has to be taken into account, physical objects and situations are naturally modelled as geometric objects and properties. In many cases, it is thereby sufficient to model the environment as a two-dimensional plane, and the objects can be approximated by polygons on that plane. A lot of algorithms for dynamic motion planning or collision detection follow this approach. For the manipulation of these objects, well-known geometry algorithms are used. In particular, algorithms for manipulating polygons, i.e. to triangulate a polygon, to determine its convex hull, and to compute the intersection, union or difference of a given set of polygons are fundamental algorithms to solve difficult motion planning and collision detection problems.

Although these algorithms are not new, their use in upcoming safety-critical embedded systems, used e.g.~in automobiles, calls for a more rigorous treatment to guarantee the correctness for all possible inputs. To this end, formal definitions of geometric objects and primitives are required to specify and verify fundamental algorithms of computational geometry. At a first glance, the definition of geometric primitives appears to be easy, since they can be depicted in a natural and intuitive way. As a consequence, geometric algorithms are often only informally given by means of pictures. However, at a second glance, even simple definitions turn out to be more complicated than expected: For example, what is the intersection point of two lines, if both are identical? For this reason, most algorithms work under certain precondition like all points are pairwise distinct or no three points are collinear.

In order to guarantee that all possible cases are consistently handled and that the used algorithms work as expected in all possible cases, we recommend the use of interactive theorem provers to reason about required definitions and algorithms. However, finding consistent definitions that also hold for degenerate input data is surprisingly difficult. In fact, we found that for many predicates, no definition reflects the intuitive understanding in all cases. For example, to decide whether a point on the edge of a polygon belongs to the interior or not, yields essential problems when used in one or the other algorithm. This makes it inherently difficult to develop a software library for safety-critical embedded systems that process geometric data.

We implemented a software library for the class of algorithms. In contrast to other software libraries like CGAL, our software library was designed to meet the following requirements, which come from the embedded systems area:

Further Reading