Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en

This commit is contained in:
dragonpilot
2019-11-11 10:48:03 +10:00
7 changed files with 109 additions and 14 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ def main():
msgs = [(address, msg_name, msg_size, sorted(msg_sigs, key=lambda s: s.name not in ("COUNTER", "CHECKSUM"))) # process counter and checksums first
for address, ((msg_name, msg_size), msg_sigs) in sorted(can_dbc.msgs.items()) if msg_sigs]
def_vals = {a: set(b) for a,b in can_dbc.def_vals.items()} #remove duplicates
def_vals = {a: sorted(set(b)) for a, b in can_dbc.def_vals.items()} # remove duplicates
def_vals = sorted(def_vals.items())
if can_dbc.name.startswith(("honda_", "acura_")):
+6 -1
View File
@@ -198,7 +198,12 @@ FINGERPRINTS = {
# 2019 Taiwan Altis Hybrid
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 765: 8, 800: 8, 810: 2, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 885: 8, 896: 8, 898: 8, 918: 7, 921: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 987: 8, 993: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1082: 8, 1112: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1172: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1745: 8, 1775: 8, 1779: 8
}],
},
# 2019 Chinese Levin Hybrid
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 765: 8, 800: 8, 810: 2, 812: 8, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 885: 8, 896: 8, 898: 8, 921: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 993: 8, 1002: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1172: 8, 1235: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1600: 8, 1649: 8, 1745: 8, 1775: 8, 1779: 8
}
],
CAR.LEXUS_ES_TSS2: [
{
# 2019 Lexus ES200 from Shell
+89
View File
@@ -0,0 +1,89 @@
#include "visionbuf.h"
#include <fcntl.h>
#include <assert.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
VisionBuf visionbuf_allocate(size_t len) {
// const size_t alignment = 4096;
// void* addr = aligned_alloc(alignment, alignment * ((len - 1) / alignment + 1));
void* addr = calloc(1, len);
return (VisionBuf){
.len = len, .addr = addr, .handle = 1, .fd = -1,
};
}
cl_mem visionbuf_to_cl(const VisionBuf* buf, cl_device_id device_id, cl_context ctx) {
// HACK because this platform is just for convenience
VisionBuf *w_buf = (VisionBuf*)buf;
cl_mem ret;
*w_buf = visionbuf_allocate_cl(buf->len, device_id, ctx, &ret);
return ret;
}
VisionBuf visionbuf_allocate_cl(size_t len, cl_device_id device_id, cl_context ctx, cl_mem *out_mem) {
int err;
assert(out_mem);
#if __OPENCL_VERSION__ >= 200
void* host_ptr =
clSVMAlloc(ctx, CL_MEM_READ_WRITE | CL_MEM_SVM_FINE_GRAIN_BUFFER, len, 0);
assert(host_ptr);
#else
void* host_ptr = calloc(1, len);
cl_command_queue q = clCreateCommandQueue(ctx, device_id, 0, &err);
assert(err == 0);
#endif
cl_mem mem = clCreateBuffer(ctx, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, len, host_ptr, &err);
assert(err == 0);
*out_mem = mem;
return (VisionBuf){
.len = len, .addr = host_ptr, .handle = 0, .fd = -1,
.device_id = device_id, .ctx = ctx, .buf_cl = mem,
#if __OPENCL_VERSION__ < 200
.copy_q = q,
#endif
};
}
void visionbuf_sync(const VisionBuf* buf, int dir) {
int err = 0;
if (!buf->buf_cl) return;
#if __OPENCL_VERSION__ < 200
if (dir == VISIONBUF_SYNC_FROM_DEVICE) {
err = clEnqueueReadBuffer(buf->copy_q, buf->buf_cl, CL_FALSE, 0, buf->len, buf->addr, 0, NULL, NULL);
} else {
err = clEnqueueWriteBuffer(buf->copy_q, buf->buf_cl, CL_FALSE, 0, buf->len, buf->addr, 0, NULL, NULL);
}
assert(err == 0);
clFinish(buf->copy_q);
#endif
}
void visionbuf_free(const VisionBuf* buf) {
if (buf->handle) {
free(buf->addr);
} else {
int err = clReleaseMemObject(buf->buf_cl);
assert(err == 0);
#if __OPENCL_VERSION__ >= 200
clSVMFree(buf->ctx, buf->addr);
#else
free(buf->addr);
#endif
}
}
+3 -3
View File
@@ -385,8 +385,8 @@ def manager_thread():
running_list = [" running %s %s" % (p, running[p]) for p in running]
cloudlog.debug('\n'.join(running_list))
# is this still needed?
if params.get("DoUninstall") == "1":
# Exit main loop when uninstall is needed
if params.get("DoUninstall", encoding='utf8') == "1":
break
def get_installed_apks():
@@ -572,7 +572,7 @@ def main():
finally:
cleanup_all_processes(None, None)
if params.get("DoUninstall") == "1":
if params.get("DoUninstall", encoding='utf8') == "1":
uninstall()
if __name__ == "__main__":
+4 -5
View File
@@ -217,11 +217,10 @@ def thermald_thread():
max_comp_temp = max(max_cpu_temp, msg.thermal.mem / 10., msg.thermal.gpu / 10.)
bat_temp = msg.thermal.bat/1000.
if health is not None:
if health.health.hwType == log.HealthData.HwType.uno:
fan_speed = handle_fan_uno(max_cpu_temp, bat_temp, fan_speed)
else:
fan_speed = handle_fan_eon(max_cpu_temp, bat_temp, fan_speed)
if health is not None and health.health.hwType == log.HealthData.HwType.uno:
fan_speed = handle_fan_uno(max_cpu_temp, bat_temp, fan_speed)
else:
fan_speed = handle_fan_eon(max_cpu_temp, bat_temp, fan_speed)
msg.thermal.fanSpeed = fan_speed
+4 -4
View File
@@ -54,9 +54,9 @@ else
OPENCL_LIBS = -lOpenCL
TF_FLAGS = -I$(EXTERNAL)/tensorflow/include
TF_LIBS = -L$(EXTERNAL)/tensorflow/lib -ltensorflow \
-Wl,-rpath $(EXTERNAL)/tensorflow/lib
#TF_FLAGS = -I$(EXTERNAL)/tensorflow/include
#TF_LIBS = -L$(EXTERNAL)/tensorflow/lib -ltensorflow \
# -Wl,-rpath $(EXTERNAL)/tensorflow/lib
SNPE_FLAGS = -I$(PHONELIBS)/snpe/include/
SNPE_LIBS = -L$(PHONELIBS)/snpe/x86_64-linux-clang/ \
@@ -69,7 +69,7 @@ else
PLATFORM_OBJS = cameras/camera_frame_stream.o \
../common/visionbuf_cl.o \
../common/visionimg.o \
runners/tfmodel.o
# runners/tfmodel.o
endif
SSL_FLAGS = -I/usr/include/openssl/
@@ -33,6 +33,8 @@ typedef struct CameraState {
int fps;
float digital_gain;
float cur_gain_frac;
mat3 transform;
} CameraState;