From 05479c4b7de666bb416893718443d27aa786e6f4 Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Thu, 22 Aug 2019 16:25:23 +1000 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AA=BF=E6=95=B4=E7=9B=B8?= =?UTF-8?q?=E6=A9=9F=E5=81=8F=E7=A7=BB=E8=B7=9D=E9=9B=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/params.py | 1 + selfdrive/controls/lib/lane_planner.py | 4 +++- selfdrive/dragonpilot/dragonconf/__init__.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/params.py b/common/params.py index becddc5eb..1e128db91 100755 --- a/common/params.py +++ b/common/params.py @@ -116,6 +116,7 @@ keys = { "DragonEnableMixplorer": [TxType.PERSISTENT], "DragonRunMixplorer": [TxType.PERSISTENT], "DragonSteeringMonitorTimer": [TxType.PERSISTENT], + "DragonCameraOffset": [TxType.PERSISTENT], } diff --git a/selfdrive/controls/lib/lane_planner.py b/selfdrive/controls/lib/lane_planner.py index 60a24b6d9..14d1ddf5e 100644 --- a/selfdrive/controls/lib/lane_planner.py +++ b/selfdrive/controls/lib/lane_planner.py @@ -1,8 +1,10 @@ from common.numpy_fast import interp import numpy as np from selfdrive.controls.lib.latcontrol_helpers import model_polyfit, compute_path_pinv +from common.params import Params +params = Params() -CAMERA_OFFSET = 0.06 # m from center car to camera +CAMERA_OFFSET = int(params.get("DragonCameraOffset")) def calc_d_poly(l_poly, r_poly, p_poly, l_prob, r_prob, lane_width): diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index d9a67fdc3..070e44810 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -36,6 +36,7 @@ default_conf = { 'DragonEnableMixplorer': '0', 'DragonRunMixplorer': '0', 'DragonSteeringMonitorTimer': '3', + 'DragonCameraOffset': '6', } deprecated_conf = {