Declarative Scenario-based Testing with RoadLogic

This paper introduces RoadLogic, an open-source framework that bridges declarative OpenSCENARIO specifications and executable simulations by combining Answer Set Programming, motion planning, and specification-based monitoring to automatically generate diverse, realistic, and compliant autonomous vehicle testing scenarios.

Ezio Bartocci, Alessio Gambi, Felix Gigler, Cristinel Mateis, Dejan Ničkovic

Published Wed, 11 Ma
📖 4 min read☕ Coffee break read

Imagine you are a director trying to film a complex car chase scene for a movie.

The Problem:
In the old days, to get the perfect shot, you would have to write a very specific, step-by-step script for every single car. "Car A moves 5 feet left, then Car B speeds up, then Car A turns right." If you wanted to see 100 different versions of this chase to make sure the actors (the autonomous cars) could handle it, you'd have to write 100 different scripts. That takes forever and is incredibly boring.

Then, someone invented a new way of writing scripts called OpenSCENARIO DSL (OS2). Instead of writing every tiny move, you just write the story: "Car A starts behind Car B, then Car A speeds up and passes Car B, then Car A ends up in front." It's like giving the director a plot summary instead of a shot-by-shot storyboard.

The Catch:
While this new "plot summary" style is great for humans, computers don't know how to act it out. They need the step-by-step instructions. Until now, there was no free, open tool that could take that high-level story and automatically turn it into a realistic, working movie (simulation) where the cars actually drive themselves safely.

The Solution: RoadLogic
This paper introduces RoadLogic, a new open-source tool that acts as the ultimate "AI Director's Assistant." It bridges the gap between the high-level story and the actual driving simulation.

Here is how RoadLogic works, using a simple analogy:

1. The Translator (OS2 to Symbolic Automata)

Imagine the OS2 story is written in a foreign language. RoadLogic first translates this story into a flowchart (called a "Symbolic Automaton").

  • Analogy: Think of this as turning the plot summary into a "Choose Your Own Adventure" book. It maps out all the possible checkpoints: "Start here," "Pass the other car," "End up in front." It doesn't say how to drive, just what needs to happen.

2. The Puzzle Solver (Answer Set Programming)

Next, RoadLogic uses a powerful logic engine called ASP (Answer Set Programming). This is like a super-smart puzzle solver.

  • Analogy: Imagine you have a jigsaw puzzle where the pieces are "drive forward," "change lane," or "slow down." The puzzle solver looks at the flowchart and tries to fit the pieces together to find a valid path. It asks, "If I move Car A here, can Car B still pass safely?" It finds a high-level plan that satisfies the story without worrying about the physics yet.

3. The Choreographer (Motion Planning)

Now that we have a plan, we need to make it look real. RoadLogic passes the plan to a Motion Planner (FrenetiX).

  • Analogy: The puzzle solver gave the choreographer a list of dance moves. The choreographer now figures out the exact footwork. How fast should the car turn? How hard should it brake? It turns the abstract "change lane" instruction into a smooth, realistic curve that a real car could actually drive without crashing.

4. The Critic (Runtime Monitoring)

Finally, as the simulation runs, RoadLogic has a "Critic" watching the whole time.

  • Analogy: This is like a strict film critic sitting in the theater. If the actors (cars) deviate from the story—for example, if Car A passes Car B but then immediately crashes into a tree—the Critic yells "Cut!" and rejects that version. Only the simulations that perfectly match the original story get to stay in the final movie.

Why is this a big deal?

  • Safety: It allows engineers to test self-driving cars in thousands of different "what-if" scenarios (like bad weather, sudden obstacles, or tricky lane changes) without ever risking a real car on the road.
  • Variety: Because the tool is smart, it can generate many different versions of the same story. One time, the car might pass slowly; another time, it might pass quickly. This helps find hidden bugs that a human might miss.
  • Open Source: Unlike expensive, secret tools used by big car companies, RoadLogic is free for anyone to use and improve.

In a nutshell:
RoadLogic takes a simple, human-readable story about a car driving, uses logic puzzles to figure out the steps, uses physics to make the driving look real, and double-checks the result to ensure it matches the story. It turns a "what if" idea into a "let's test it" reality, making self-driving cars safer and faster to develop.