Skip to content

Behavioral Contracts: Regulatory Elements and Site Policy

A precise 3D map of Harbor Yard tells the robot where the pavement ends. It is silent on the most critical part of driving: the rules. Regulatory elements encode the law of the yard into the geometry.

5 min read

A point cloud of Harbor Yard shows every painted line on the pavement. It does not tell you that the line at the gatehouse means “stop and wait for authorization.” It does not tell you that the loop road is one-way, that the speed limit drops to 2 mph near the loading docks, or that the blind corner behind the container zone requires a full stop if anything is moving there.

Geometry tells the robot where the road is. Regulatory elements tell the robot what it is allowed to do on it. Together they form a behavioral contract: a set of rules encoded directly into the map that the planner reads as law.

Chapter 19 introduced the five regulatory element types. This chapter goes deeper: how regElems bind physical objects to abstract rules, and how that binding turns a geometric map into an executable one.

The stop line: anchoring the contract

A stop line in a point cloud is a set of high-intensity returns from white paint. A stop line in a Lanelet2 map is a linestring with type=stop_line. Neither one tells the robot to stop.

The behavioral contract is created when you attach a traffic sign regulatory element to the stop line. The regElem says: “This linestring is a refline. When the vehicle approaches it, longitudinal velocity must reach zero.” The physical paint anchors the rule. The rule gives the paint legal force. Without the regElem, the robot sees a line. It has no idea the line means stop.

Speed limits: the source of truth

A speed limit in a map is not advisory. It is the primary source of truth for the planner. The robot does not read signs. It reads the map. If the map says 5 mph on the loop road, the planner will not exceed 5 mph even if the road is empty, straight, and physically capable of 15.

At Harbor Yard, the main loop is 5 mph. The dock approach drops to 2 mph. The speed limit regElem is attached directly to the lanelets it governs. When the planner evaluates a candidate path, it checks the speed limit on every lanelet in the chain and constrains velocity accordingly. The map does not suggest a speed. It enforces it.

Detection areas: programming attention

A detection area is a regulatory element unique to Autoware. It defines a polygon in space that the vehicle must monitor. If a sensor return appears inside that polygon (a forklift, a person, another vehicle), the vehicle must stop at a designated stop line and wait until the area clears.

At Harbor Yard, the blind corner behind the container zone is a detection area. A cargo tug approaching the corner cannot see what is behind the containers. But the map can. The detection area tells the perception stack: “Watch this region. If anything is there, stop here.” It is attention programmed directly into the map geometry.

Detection areas are paired with stop lines. The stop line is where the vehicle waits. The detection area is what the vehicle watches while it waits. Together they create a reactive behavior: stop, watch, proceed when clear. No traffic light required. No stop sign. Just a polygon, a line, and a rule.

Try this

[10 min] Create the gatehouse stop line contract at Harbor Yard.

  1. Locate the painted stop line at the gatehouse entrance. Trace it as a linestring in the vector map.
  2. Create a traffic sign regulatory element. Assign the stop line linestring the role of refline, the reference line the vehicle must stop behind.
  3. Associate the regulatory element with the approach lanelet leading to the gatehouse.

You have just programmed the robot’s first legal requirement. The stop line is the anchor. The regElem is the rule. The lanelet is the scope. The cargo tug now knows: stop here, wait for the gate, proceed when authorized.

Found an error or have a suggestion?

Report an erratum or send feedback →

In this Part

Keep reading

Beyond the book

Build your own HD map.

Veer Studio is the spatial compiler this handbook teaches you to use. Download it and map a site, or tell us about your site and we will show you a validated map.

← Back to HD Map HandbookContinue to Topology and Intersections: Building the Navigable Graph →