parent
a457144357
commit
8fdbbdef73
|
@ -5,14 +5,12 @@ from selfdrive.hardware import TICI
|
|||
|
||||
## -- hardcoded hardware params --
|
||||
eon_f_focal_length = 910.0
|
||||
eon_d_focal_length = 860.0
|
||||
leon_d_focal_length = 650.0
|
||||
eon_d_focal_length = 650.0
|
||||
tici_f_focal_length = 2648.0
|
||||
tici_e_focal_length = tici_d_focal_length = 567.0 # probably wrong? magnification is not consistent across frame
|
||||
|
||||
eon_f_frame_size = (1164, 874)
|
||||
eon_d_frame_size = (1152, 864)
|
||||
leon_d_frame_size = (816, 612)
|
||||
eon_d_frame_size = (816, 612)
|
||||
tici_f_frame_size = tici_e_frame_size = tici_d_frame_size = (1928, 1208)
|
||||
|
||||
# aka 'K' aka camera_frame_from_view_frame
|
||||
|
@ -22,11 +20,6 @@ eon_fcam_intrinsics = np.array([
|
|||
[0.0, 0.0, 1.0]])
|
||||
eon_intrinsics = eon_fcam_intrinsics # xx
|
||||
|
||||
leon_dcam_intrinsics = np.array([
|
||||
[leon_d_focal_length, 0.0, float(leon_d_frame_size[0])/2],
|
||||
[0.0, leon_d_focal_length, float(leon_d_frame_size[1])/2],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
eon_dcam_intrinsics = np.array([
|
||||
[eon_d_focal_length, 0.0, float(eon_d_frame_size[0])/2],
|
||||
[0.0, eon_d_focal_length, float(eon_d_frame_size[1])/2],
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import os
|
||||
from smbus2 import SMBus
|
||||
|
||||
def setup_fan():
|
||||
os.system("echo 2 > /sys/module/dwc3_msm/parameters/otg_switch")
|
||||
|
||||
bus = SMBus(7, force=True)
|
||||
try:
|
||||
bus.write_byte_data(0x21, 0x10, 0xf) # mask all interrupts
|
||||
bus.write_byte_data(0x21, 0x03, 0x1) # set drive current and global interrupt disable
|
||||
bus.write_byte_data(0x21, 0x02, 0x2) # needed?
|
||||
bus.write_byte_data(0x21, 0x04, 0x4) # manual override source
|
||||
print("OP detected")
|
||||
ret = False
|
||||
except IOError:
|
||||
print("LEON detected")
|
||||
ret = True
|
||||
bus.close()
|
||||
return ret
|
||||
|
||||
def get_fan_type():
|
||||
if not setup_fan():
|
||||
return
|
||||
|
||||
bus = SMBus(7, force=True)
|
||||
try:
|
||||
# alternate type
|
||||
bus.write_i2c_block_data(0x3d, 0, [0x1])
|
||||
print("Alternate type detected")
|
||||
return
|
||||
except IOError:
|
||||
# tusb320 type
|
||||
print("tusb320 type detected")
|
||||
bus.close()
|
||||
|
||||
|
||||
def main(gctx=None):
|
||||
get_fan_type()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -10,7 +10,7 @@ from typing import List
|
|||
import cereal.messaging as messaging
|
||||
from common.params import Params
|
||||
from common.realtime import DT_MDL
|
||||
from common.transformations.camera import eon_f_frame_size, eon_d_frame_size, leon_d_frame_size, tici_f_frame_size
|
||||
from common.transformations.camera import eon_f_frame_size, eon_d_frame_size, tici_f_frame_size
|
||||
from selfdrive.hardware import TICI
|
||||
from selfdrive.controls.lib.alertmanager import set_offroad_alert
|
||||
from selfdrive.manager.process_config import managed_processes
|
||||
|
@ -39,7 +39,7 @@ def rois_in_focus(lapres: List[float]) -> float:
|
|||
|
||||
|
||||
def get_snapshots(frame="roadCameraState", front_frame="driverCameraState", focus_perc_threshold=0.):
|
||||
frame_sizes = [eon_f_frame_size, eon_d_frame_size, leon_d_frame_size, tici_f_frame_size]
|
||||
frame_sizes = [eon_f_frame_size, eon_d_frame_size, tici_f_frame_size]
|
||||
frame_sizes = {w * h: (w, h) for (w, h) in frame_sizes}
|
||||
|
||||
sockets = []
|
||||
|
|
Loading…
Reference in New Issue