Skip to content

Commit

Permalink
merging branches
Browse files Browse the repository at this point in the history
  • Loading branch information
BogGyver committed Apr 8, 2020
1 parent 2013400 commit 9143f52
Show file tree
Hide file tree
Showing 166 changed files with 15,011 additions and 1,191 deletions.
33 changes: 20 additions & 13 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ is_tbp = os.path.isfile('/data/tinkla_buddy_pro')
if platform.system() == "Darwin":
arch = "Darwin"

webcam = bool(ARGUMENTS.get("use_webcam", 0))

if arch == "aarch64":
if is_tbp:
webcam=True
lenv = {
"LD_LIBRARY_PATH": '/usr/lib',
"PATH": os.environ['PATH'],
Expand Down Expand Up @@ -47,28 +50,32 @@ if arch == "aarch64":
]

if is_tbp:
cflags = ["-mcpu=cortex-a57"]
cxxflags = ["-mcpu=cortex-a57"]
cflags = []
cxxflags = []
cpppath = [
"#phonelibs/opencl/include",
"/data/op_rk3399_setup/support_files/include",
"/data/op_rk3399_setup/external/snpe/include",
"/usr/local/include",
"/usr/local/include/opencv4",
"/usr/include/khronos-api",
"/usr/include",
"#phonelibs/snpe/include",
"/usr/include/aarch64-linux-gnu",
]
libpath = [
"/data/op_rk3399_setup/external/snpe/lib/lib",
"/usr/local/lib",
"/usr/lib/aarch64-linux-gnu",
"/usr/lib",
"/data/op_rk3399_setup/external/snpe/lib/lib",
"/data/data/com.termux/files/usr/lib",
"/system/vendor/lib64",
"/system/comma/usr/lib",
"#phonelibs/nanovg",
"/data/op_rk3399_setup/support_files/lib",
]
rpath = ["/system/vendor/lib64",
"/usr/local/lib",
"/usr/lib/aarch64-linux-gnu",
"/usr/lib",
"/data/op_rk3399_setup/external/snpe/lib/lib",
"/data/op_rk3399_setup/support_files/lib",
"external/tensorflow/lib",
"cereal",
"/usr/lib",
"selfdrive/common",
]
else:
Expand Down Expand Up @@ -152,7 +159,7 @@ env = Environment(
"#phonelibs/json11",
"#phonelibs/eigen",
"#phonelibs/curl/include",
"#phonelibs/opencv/include",
#"#phonelibs/opencv/include",
"#phonelibs/libgralloc/include",
"#phonelibs/android_frameworks_native/include",
"#phonelibs/android_hardware_libhardware/include",
Expand Down Expand Up @@ -211,8 +218,8 @@ def abspath(x):

#zmq = 'zmq'
# still needed for apks
zmq = FindFile("libzmq.a", libpath)
Export('env', 'arch', 'zmq', 'SHARED', 'is_tbp')
zmq = FindFile("libzmq.so", libpath)
Export('env', 'arch', 'zmq', 'SHARED', 'webcam', 'is_tbp')

# cereal and messaging are shared with the system
SConscript(['cereal/SConscript'])
Expand Down
Binary file added models/models/dmonitoring_model.keras
Binary file not shown.
Binary file added models/models/dmonitoring_model_q.dlc
Binary file not shown.
Binary file added models/models/driving_bigmodel.dlc
Binary file not shown.
Binary file added models/models/supercombo.dlc
Binary file not shown.
Binary file added models/models/supercombo.keras
Binary file not shown.
32 changes: 24 additions & 8 deletions selfdrive/camerad/SConscript
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
Import('env', 'arch', 'is_tbp', 'messaging', 'common', 'gpucommon', 'visionipc', 'cereal')
Import('env', 'arch', 'messaging', 'is_tbp', 'common', 'gpucommon', 'visionipc', 'cereal', 'webcam')

libs = ['m', 'pthread', common, 'jpeg', 'json', cereal, 'OpenCL', messaging, 'czmq', 'zmq', 'capnp', 'kj', 'capnp_c', visionipc, gpucommon]

if is_tbp:
arch = "aarch64_TBP"
if arch == "aarch64":
if is_tbp:
libs += ['gsl', 'CB', 'adreno_utils', 'EGL', 'GLESv3', 'cutils', 'ui']
cameras = ['cameras/camera_qcom.c']
elif arch == "larch64":
libs += []
cameras = ['cameras/camera_qcom2.c']
elif arch == "aarch64_TBP":
libs += ['opencv_core', 'opencv_highgui', 'opencv_video', 'opencv_imgproc', 'opencv_videoio']
cameras = ['cameras/camera_webcam.cc']
env = env.Clone()
env.Append(CXXFLAGS = '-DWEBCAM')
env.Append(CFLAGS = '-DWEBCAM')
#env.Append(CPPPATH = '/usr/local/include/opencv4')
else:
if webcam:
libs += ['opencv_core', 'opencv_highgui', 'opencv_imgproc', 'opencv_videoio']
cameras = ['cameras/camera_webcam.cc']
env = env.Clone()
env.Append(CXXFLAGS = '-DWEBCAM')
env.Append(CFLAGS = '-DWEBCAM')
env.Append(CPPPATH = '/usr/local/include/opencv4')
else:
libs += []
cameras = ['cameras/camera_frame_stream.cc']
else:
libs += ['gsl', 'CB', 'adreno_utils', 'EGL', 'GLESv3', 'cutils', 'ui']
cameras = ['cameras/camera_qcom.c']
else:
libs += []
cameras = ['cameras/camera_frame_stream.cc']

env.SharedLibrary('snapshot/visionipc',
["#selfdrive/common/visionipc.c", "#selfdrive/common/ipc.c"])
Expand Down
Empty file added selfdrive/camerad/__init__.py
Empty file.
5 changes: 4 additions & 1 deletion selfdrive/camerad/cameras/camera_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
#define CAMERA_ID_OV8865 3
#define CAMERA_ID_IMX298_FLIPPED 4
#define CAMERA_ID_OV10640 5
#define CAMERA_ID_MAX 6
#define CAMERA_ID_LGC920 6
#define CAMERA_ID_LGC615 7
#define CAMERA_ID_AR0231 8
#define CAMERA_ID_MAX 9

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/camerad/cameras/camera_frame_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ CameraInfo cameras_supported[CAMERA_ID_MAX] = {
.frame_width = 1632,
.frame_height = 1224,
.frame_stride = 2040, // seems right
.bayer = false,
.bayer = true,
.bayer_flip = 3,
.hdr = false
},
Expand Down
Loading

0 comments on commit 9143f52

Please sign in to comment.