Calib in settings (#1543)

* test test

* yo dawg

* yo dawg 2

* yo dawg 3

* calib in ui

* no pitch and yaw

* no more drive rating

* stricter

* param is no longer a vp

* less wall of test

* less is more

* better language

* cleaner
old-commit-hash: 7ffaff029f
commatwo_master
HaraldSchafer 5 years ago committed by GitHub
parent 2e0f9fe628
commit 54572b6f23
  1. 4
      apk/ai.comma.plus.offroad.apk
  2. 14
      selfdrive/locationd/calibrationd.py

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d7b79038dccaa97d84bd38544573d3a52929770b76a259b25a27311464230e22
size 13732809
oid sha256:695622033fe2a531a2e263f5a0d19ee1fee8aadbad781092f71a3448bddd48d5
size 13699616

@ -24,9 +24,8 @@ INPUTS_WANTED = 50 # We want a little bit more than we need for stability
WRITE_CYCLES = 10 # write every 1000 cycles
VP_INIT = np.array([W/2., H/2.])
# These validity corners were chosen by looking at 1000
# and taking most extreme cases with some margin.
VP_VALIDITY_CORNERS = np.array([[W//2 - 120, 300], [W//2 + 120, 520]])
# These values are needed to accomodate biggest modelframe
VP_VALIDITY_CORNERS = np.array([[W//2 - 63, 300], [W//2 + 63, 520]])
DEBUG = os.getenv("DEBUG") is not None
@ -38,8 +37,8 @@ def is_calibration_valid(vp):
def sanity_clip(vp):
if np.isnan(vp).any():
vp = VP_INIT
return np.array([np.clip(vp[0], VP_VALIDITY_CORNERS[0,0] - 20, VP_VALIDITY_CORNERS[1,0] + 20),
np.clip(vp[1], VP_VALIDITY_CORNERS[0,1] - 20, VP_VALIDITY_CORNERS[1,1] + 20)])
return np.array([np.clip(vp[0], VP_VALIDITY_CORNERS[0,0] - 5, VP_VALIDITY_CORNERS[1,0] + 5),
np.clip(vp[1], VP_VALIDITY_CORNERS[0,1] - 5, VP_VALIDITY_CORNERS[1,1] + 5)])
def intrinsics_from_vp(vp):
@ -69,10 +68,7 @@ class Calibrator():
if calibration_params:
try:
calibration_params = json.loads(calibration_params)
if 'calib_radians' in calibration_params:
self.vp = vp_from_rpy(calibration_params["calib_radians"])
else:
self.vp = np.array(calibration_params["vanishing_point"])
self.vp = vp_from_rpy(calibration_params["calib_radians"])
if not np.isfinite(self.vp).all():
self.vp = copy.copy(VP_INIT)
self.vps = np.tile(self.vp, (INPUTS_WANTED, 1))

Loading…
Cancel
Save