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 = {