Export a CommonRoad scenario from drawtonomy
Bu içerik henüz dilinizde mevcut değil.
There are three things you can do with CommonRoad in drawtonomy, and they share one canvas.
| What it does | Where | |
|---|---|---|
| Draw and export | any scene (hand-drawn, AI-generated, or an OpenSCENARIO file you opened) becomes a CommonRoad 2020a scenario with lanelets, dynamicObstacle trajectories and a planningProblem | Export ▸ .xml (CommonRoad) |
| Import and round-trip | a CommonRoad .xml opens on the canvas keeping lanelet ids and connectivity; elements drawtonomy does not draw are carried through, so an unedited re-export is the original file back | drop it on the canvas, or Import… |
| Replay and judge | your planner’s solution.xml replays as the ego, and the official checker’s verdict lands on the run badge | drop solution.xml (+ .verdict.json), or drawtonomy-cr open |
The rest of this page is the first row: what a CommonRoad export needs before it will write a file.
Two prerequisites
Section titled “Two prerequisites”A CommonRoad scenario without a planningProblem has nothing for a planner
to solve. So the export asks for exactly two things, and blocks with one line
until it has them:
- an ego: one vehicle marked as externally controlled, which becomes the planning problem’s initial state
- a goal lane: the lanelet the ego has to reach, which becomes the
<goalState><position>
Everything else (the road network, the other vehicles, their trajectories) is derived from what you drew.
1. Mark the ego
Section titled “1. Mark the ego”Until a vehicle is marked, the transport row says so, in the same place it shows the playback state:

No ego marked. Hovering it says where to fix it: select a vehicle and turn on “Ego (external control)” in the Attributes panel.
Select the vehicle, then tick the checkbox at the top of the Attributes panel:

One checkbox. It marks the vehicle as the system under test: the actor a planner (or an external simulator) drives instead of drawtonomy.
The mark is what makes the vehicle the ego everywhere: it becomes the planning problem on export, and it is the actor a replayed solution is applied to. Only one vehicle can carry it.
2. Pick the goal lane
Section titled “2. Pick the goal lane”The COMMONROAD group under the checkbox holds the goal. Press Pick lane and the canvas waits for you to click the lane where the goal starts:

Pick lane arms the canvas. Esc cancels without changing the goal.
Click the lane and a 50 m stretch starting at that point becomes the goal region: highlighted on the canvas, named in the panel:

The goal stretch, highlighted on the road and named in the panel. The two numbers next to the lane are its start and end along the lane in metres. The lane name is also the button that picks a different lane; the × clears the goal.
Two things about the goal are worth knowing:
- The range along the lane is adjustable. Pick lane puts down 50 m from
the point you clicked. Drag the handles on the highlighted band, or type
the start and end metres into the two fields (Enter or leaving the field
applies, one undo step). The two follow each other either way: the goal is
that stretch (
s0–s1) of the lanelet rather than its whole length. Values are kept inside the lane and at least 2 m apart. Setting the range to the whole lane (0 to its length) removes the range, and a lane shorter than 50 m becomes the goal as a whole from the start. - A goal speed interval is optional. Tick Goal speed limit under the
goal lane and the export writes
<velocity><intervalStart>0</intervalStart><intervalEnd>v</intervalEnd>, which is how you say “reach the goal at v or slower” (set v to 0 for “and be stopped”).
The ego does not drive to the goal during playback. The goal is a constraint handed to the planner, not a path.
Open an existing OpenSCENARIO file and export it as CommonRoad
Section titled “Open an existing OpenSCENARIO file and export it as CommonRoad”You do not have to draw the scene. A .xosc you already own becomes a
CommonRoad scenario through the same two prerequisites.
-
Open the OpenSCENARIO file. Drop the
.xoscand its.xodron the canvas together, or pick the.xoscin Import… and the.xodrwhen prompted. The road network becomes lanes and every actor becomes a vehicle with its trajectory. Full steps: Open and play a .xosc. -
Open it straight from GitHub instead, with no download: append the file’s GitHub URL to
?open=. The.xodrand catalogs next to it are resolved relative to that URL.https://drawtonomy.com/?open=https://github.com/esmini/esmini/blob/master/resources/xosc/cut-in.xosc -
Play it once. Trajectories come from a recorded run, so the export needs one. Without it the file has the other vehicles’ initial states but no trajectories, and the export says so.
-
Mark the ego and pick a goal lane, as above. An OpenSCENARIO ego is not automatically a CommonRoad planning problem: CommonRoad needs the goal too, and only you know which lane it is.
-
Export ▸
.xml (CommonRoad).
What crosses over: the road network as lanelets, each actor as a
dynamicObstacle with the trajectory it drove, the ego’s initial state, and
the goal lane you picked. What does not: the OpenSCENARIO storyboard itself.
CommonRoad has no triggers or actions, so the scenario a planner receives is
the outcome of your story, sampled at dt = 0.1 s, not the story.
Obstacles that appear and disappear
Section titled “Obstacles that appear and disappear”Every other vehicle in the scene becomes a dynamicObstacle with its
recorded trajectory. If an actor only exists for part of the scenario (added
at t = 4 s by an Add Entity action in the storyboard, removed by a
Delete Entity), the export writes exactly that interval as the
obstacle’s [initial, final] time steps, and outside it the obstacle does
not exist. Playback matches: the vehicle is not on the canvas before it is
added or after it is deleted. A planner reading the file therefore sees an
obstacle that ends, not one that keeps driving past the end of its recording.
Lanelet connectivity
Section titled “Lanelet connectivity”Each lane you drew becomes one lanelet, however long it is; the export does
not split a lane into a chain of shorter lanelets. adjacentLeft /
adjacentRight are written for lanes that sit side by side, and
successor / predecessor only where one lane’s end actually meets the
next lane’s start (both corners of the boundary, within 5 cm). A scene of
parallel through-lanes therefore exports with adjacency but with no
successor or predecessor at all.
Straight lanelets have only two vertices
Section titled “Straight lanelets have only two vertices”A boundary is exported with as many points as the drawn lane has. A straight
lane needs two, so leftBound / rightBound / centerVertices each get
exactly two vertices, however long the lanelet is. Points are not inflated to
a fixed spacing: a 120 m straight is two vertices 120 m apart.
Export
Section titled “Export”Both CommonRoad entries live in the same Export submenu:

| Entry | What it writes |
|---|---|
.xml (CommonRoad) | the scenario: lanelets, dynamicObstacle trajectories, and the planningProblem for your ego. This is the file your planner reads. |
.xml (CommonRoad solution) | a solution: the ego trajectory drawtonomy itself recorded, written in the official CommonRoadSolution format. Useful as a reference answer, and as a way to see what the checker says about a trajectory that is not a planner’s. |
Two things will stop an export, each with one line saying where to fix it:
- No ego, or no goal lane. The two prerequisites above.
Play the scenario first. The solution needs a recorded ego trajectory.Only for the solution export: there is nothing to write until a run has been recorded. Press play once, then export.
A scenario export with no recording still works, but says so: it writes the
other vehicles’ initial states without their trajectories
(Play the scenario first to include NPC trajectories). Play once and
export again for the full file.
- Bring your own planner: the loop from this file to a replayed solution and a verdict.
- Verdict reference: what the official checker tests and how to read its answer.
- CommonRoad overview: what the whole integration covers, and its status.