Dear Community:
The Openpilot Community needs your help to continue to keep opc.ai's lights on and support the path to Workbench v0.2. With only a one person crew and without commercial funding it's not always financially feasible to fund these services out of pocket. Please consider becoming a Patreon supporter of the Openpilot Community project and receive exclusive perks and benefits!
Become a patreon Learn more Maybe Later

Thomas Pichard
Jan 04·1 min read

How to modify the default road size

Image

If you need to modify the roads size because your country have tinier or bigger roads, this tutorial is for you.

First, make sure of the size of your road, for example in France it’s about 3.5 meters for departmental roads but you can write the size that you want.

SSH into your EON or open your openpilot project on your computer.

Go to the openpilot/blob/devel/selfdrive/controls/lib/pathplanner.py
In this file you have to modify the lines 15, 17 and 38

  • L15 | self.lane_width_estimate = 3.7
    • L15 | self.lane_width_estimate = 3.5
  • L17 | self.lane_width = 3.7
    • L17 | self.lane_width = 3.5
  • L38 | speed_lane_width = interp(v_ego, [0., 31.], [3., 3.8])
    • L38 | speed_lane_width = interp(v_ego, [0., 31.], [3., 3.5])

Go to the openpilot/blob/devel/selfdrive/controls/lib/latcontrols_helpers.py
In this file you have to modify the line 9

  • L9 | _LANE_WIDTH_V = [3., 3.8]
    • L9 | _LANE_WIDTH_V = [3., 3.5]

Commit and push to your fork.
Reboot your EON.

Drive carefuly.