mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 20:03:53 +08:00
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule "panda"]
|
||||
path = panda
|
||||
url = git@github.com:commaai/panda.git
|
||||
url = https://github.com/commaai/panda.git
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24fcc5e7b728675f4fe5b4da4a13793d20ac66fc0eb37f8ffc294bcea03014d7
|
||||
size 8987137
|
||||
oid sha256:84da6150714d2069367c3cc9591b795cd33b218635000e79e1c031e9c0232039
|
||||
size 8987577
|
||||
|
||||
@@ -22,7 +22,6 @@ class CANParser(object):
|
||||
self.msgs_ck = [check[0] for check in checks]
|
||||
self.frqs = [check[1] for check in checks]
|
||||
self.can_valid = False # start with False CAN assumption
|
||||
self.msgs_upd = [] # list of updated messages
|
||||
# list of received msg we want to monitor counter and checksum for
|
||||
# read dbc file
|
||||
self.can_dbc = dbc(os.path.join(dbcs.DBC_PATH, dbc_f))
|
||||
@@ -55,14 +54,14 @@ class CANParser(object):
|
||||
self._message_indices[x].append(i)
|
||||
|
||||
def update_can(self, can_recv):
|
||||
self.msgs_upd = []
|
||||
msgs_upd = []
|
||||
cn_vl_max = 5 # no more than 5 wrong counter checks
|
||||
|
||||
# we are subscribing to PID_XXX, else data from USB
|
||||
for msg, ts, cdat, _ in can_recv:
|
||||
idxs = self._message_indices[msg]
|
||||
if idxs:
|
||||
self.msgs_upd.append(msg)
|
||||
msgs_upd.append(msg)
|
||||
# read the entire message
|
||||
out = self.can_dbc.decode((msg, 0, cdat))[1]
|
||||
# checksum check
|
||||
@@ -107,7 +106,7 @@ class CANParser(object):
|
||||
sg = self._sgs[ii]
|
||||
self.vl[msg][sg] = out[sg]
|
||||
|
||||
# for each message, check if it's too long since last time we received it
|
||||
# for each message, check if it's too long since last time we received it
|
||||
self._check_dead_msgs()
|
||||
|
||||
# assess overall can validity: if there is one relevant message invalid, then set can validity flag to False
|
||||
@@ -116,6 +115,8 @@ class CANParser(object):
|
||||
#print "CAN INVALID!"
|
||||
self.can_valid = False
|
||||
|
||||
return msgs_upd
|
||||
|
||||
def _check_dead_msgs(self):
|
||||
### input:
|
||||
## simple stuff for now: msg is not valid if a message isn't received for 10 consecutive steps
|
||||
|
||||
@@ -1 +1 @@
|
||||
const char *openpilot_version = "0.3.0-devel";
|
||||
const char *openpilot_version = "0.3.0";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import numpy as np
|
||||
from common.numpy_fast import clip
|
||||
|
||||
def rate_limit(new_value, last_value, dw_step, up_step):
|
||||
|
||||
@@ -160,9 +160,11 @@ baseui_running = False
|
||||
def manage_baseui(start):
|
||||
global baseui_running
|
||||
if start and not baseui_running:
|
||||
cloudlog.info("starting baseui")
|
||||
os.system("am start -n com.baseui/.MainActivity")
|
||||
baseui_running = True
|
||||
elif not start and baseui_running:
|
||||
cloudlog.info("stopping baseui")
|
||||
os.system("am force-stop com.baseui")
|
||||
baseui_running = False
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class RadarInterface(object):
|
||||
if any(x[0] == 0x445 for x in can_pub_radar):
|
||||
break
|
||||
|
||||
self.rcp.update_can(can_pub_radar)
|
||||
updated_messages = self.rcp.update_can(can_pub_radar)
|
||||
|
||||
ret = car.RadarState.new_message()
|
||||
errors = []
|
||||
@@ -54,7 +54,7 @@ class RadarInterface(object):
|
||||
ret.errors = errors
|
||||
ret.canMonoTimes = canMonoTimes
|
||||
|
||||
for ii in self.rcp.msgs_upd:
|
||||
for ii in updated_messages:
|
||||
cpt = self.rcp.vl[ii]
|
||||
if cpt['LONG_DIST'] < 255:
|
||||
if ii not in self.pts or cpt['NEW_TRACK']:
|
||||
|
||||
@@ -8,13 +8,7 @@ from common.api import api_get
|
||||
from common.params import Params
|
||||
|
||||
def get_imei():
|
||||
# Telephony.getDeviceId()
|
||||
result = subprocess.check_output(["service", "call", "phone", "130"]).strip().split("\n")
|
||||
hex_data = ''.join(l[14:49] for l in result[1:]).replace(" ", "")
|
||||
data = hex_data.decode("hex")
|
||||
|
||||
imei_str = data[8:-4].replace("\x00", "")
|
||||
return imei_str
|
||||
return subprocess.check_output(["getprop", "oem.device.imeicache"]).strip()
|
||||
|
||||
def get_serial():
|
||||
return subprocess.check_output(["getprop", "ro.serialno"]).strip()
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bb6d9abbef0be0d91c425402a9d85b0192ba691ae80bcbf180ec946d73160068
|
||||
size 16364248
|
||||
oid sha256:3933af9e64edf655b75cef06fc40c44254fe674c226277869b74c4714feab3b6
|
||||
size 16373432
|
||||
|
||||
Reference in New Issue
Block a user