mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-15 01:42:05 +08:00
dp v0.7.2 init update
* migrate to v0.7.2 * increase mini dev bar font size * update APKs * system APKs updated to v0.7.2 * autonavi updated to v4.5.0.600053 * use old updated * Add missing auto start Aegis app option.
This commit is contained in:
+1
-1
@@ -292,7 +292,7 @@ struct ThermalData {
|
||||
memUsedPercent @19 :Int8;
|
||||
cpuPerc @20 :Int8;
|
||||
|
||||
ipAddr @22 :Text; # dragonpilot
|
||||
ipAddr @23 :Text; # dragonpilot
|
||||
|
||||
enum ThermalStatus {
|
||||
green @0; # all processes run
|
||||
|
||||
+3
-3
@@ -113,6 +113,8 @@ keys = {
|
||||
"DragonCachedModel": [TxType.PERSISTENT],
|
||||
"DragonCachedFP": [TxType.PERSISTENT],
|
||||
"DragonCachedVIN": [TxType.PERSISTENT],
|
||||
"DragonCachedCarFW": [TxType.PERSISTENT],
|
||||
"DragonCachedSource": [TxType.PERSISTENT],
|
||||
"DragonAllowGas": [TxType.PERSISTENT],
|
||||
"DragonToyotaStockDSU": [TxType.PERSISTENT],
|
||||
"DragonLatCtrl": [TxType.PERSISTENT],
|
||||
@@ -149,12 +151,10 @@ keys = {
|
||||
"DragonUIBlinker": [TxType.PERSISTENT],
|
||||
"DragonEnableDriverMonitoring": [TxType.PERSISTENT],
|
||||
"DragonCarModel": [TxType.PERSISTENT],
|
||||
"DragonCarVIN": [TxType.PERSISTENT],
|
||||
"DragonCarVIN": [TxType.PERSISTENT], #deprecated
|
||||
"DragonEnableSlowOnCurve": [TxType.PERSISTENT],
|
||||
"DragonEnableLeadCarMovingAlert": [TxType.PERSISTENT],
|
||||
"DragonToyotaSnGMod": [TxType.PERSISTENT],
|
||||
"DragonIsEON": [TxType.PERSISTENT], # deprecated
|
||||
"DragonHWChecked": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableSRLearner": [TxType.PERSISTENT],
|
||||
"DragonWazeMode": [TxType.PERSISTENT],
|
||||
"DragonRunWaze": [TxType.PERSISTENT],
|
||||
|
||||
+1
-2
@@ -3,5 +3,4 @@
|
||||
export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
|
||||
export HOME=/data/data/com.termux/files/home
|
||||
export PATH=/usr/local/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/sbin:/data/data/com.termux/files/usr/bin/applets:/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.termux/files/usr/bin/git
|
||||
|
||||
cd /data/openpilot && git reset --hard && git pull && reboot
|
||||
cd /data/openpilot && git reset --hard @{u} && git clean -xdf && git pull && reboot
|
||||
@@ -64,6 +64,42 @@ def only_toyota_left(candidate_cars):
|
||||
|
||||
# **** for use live only ****
|
||||
def fingerprint(logcan, sendcan, has_relay):
|
||||
params = Params()
|
||||
dragon_cache_car = params.get("DragonCacheCar", encoding='utf8')
|
||||
dragon_car_fingerprint = None
|
||||
dragon_finger = None
|
||||
dragon_vin = VIN_UNKNOWN
|
||||
dragon_car_fw = []
|
||||
dragon_source = car.CarParams.FingerprintSource.can
|
||||
|
||||
dragon_has_cache = False
|
||||
if dragon_cache_car == "1":
|
||||
cached_source = params.get("DragonCachedSource", encoding='utf8')
|
||||
|
||||
dragon_source = car.CarParams.FingerprintSource.can if cached_source == "" else pickle.loads(cached_source)
|
||||
|
||||
cached_finger = params.get("DragonCachedFP")
|
||||
cached_model = params.get("DragonCachedModel")
|
||||
if cached_finger != "" and cached_model != "":
|
||||
dragon_car_fingerprint = pickle.loads(cached_model)
|
||||
dragon_finger = pickle.loads(cached_finger)
|
||||
|
||||
# car_fw and vin are only available if relay is used.
|
||||
if dragon_source == car.CarParams.FingerprintSource.fw:
|
||||
# load car_fw
|
||||
cached_car_fw = params.get("DragonCachedCarFW")
|
||||
if cached_car_fw != "":
|
||||
dragon_car_fw = pickle.loads(cached_car_fw)
|
||||
|
||||
# load vin
|
||||
cached_vin = params.get("DragonCachedVIN")
|
||||
if cached_vin != "":
|
||||
dragon_vin = pickle.loads(cached_vin)
|
||||
|
||||
# set relay to false if cache is right
|
||||
has_relay = False
|
||||
dragon_has_cache = True
|
||||
|
||||
if has_relay:
|
||||
# Vin query only reliably works thorugh OBDII
|
||||
bus = 1
|
||||
@@ -93,15 +129,8 @@ def fingerprint(logcan, sendcan, has_relay):
|
||||
car_fingerprint = None
|
||||
done = False
|
||||
|
||||
params = Params()
|
||||
dragon_cache_car = params.get("DragonCacheCar", encoding='utf8')
|
||||
dragon_cached_fp = params.get("DragonCachedFP")
|
||||
dragon_cached_model = params.get("DragonCachedModel")
|
||||
|
||||
if dragon_cache_car == "1" and dragon_cached_fp != "" and dragon_cached_model != "":
|
||||
car_fingerprint = pickle.loads(dragon_cached_model)
|
||||
finger = pickle.loads(dragon_cached_fp)
|
||||
vin = pickle.loads(params.get("DragonCachedVIN"))
|
||||
# dp, skip loop if cach is on
|
||||
if dragon_has_cache:
|
||||
done = True
|
||||
|
||||
while not done:
|
||||
@@ -138,19 +167,29 @@ def fingerprint(logcan, sendcan, has_relay):
|
||||
|
||||
frame += 1
|
||||
|
||||
if succeeded:
|
||||
put_nonblocking("DragonCachedModel", pickle.dumps(car_fingerprint))
|
||||
put_nonblocking("DragonCachedFP", pickle.dumps(finger))
|
||||
put_nonblocking("DragonCachedVIN", pickle.dumps(vin))
|
||||
put_nonblocking("DragonCarModel", car_fingerprint)
|
||||
put_nonblocking("DragonCarVIN", vin)
|
||||
if dragon_has_cache:
|
||||
car_fingerprint = dragon_car_fingerprint
|
||||
finger = dragon_finger
|
||||
vin = dragon_vin
|
||||
car_fw = dragon_car_fw
|
||||
source = dragon_source
|
||||
|
||||
source = car.CarParams.FingerprintSource.can
|
||||
else:
|
||||
source = car.CarParams.FingerprintSource.can
|
||||
|
||||
# If FW query returns exactly 1 candidate, use it
|
||||
if len(fw_candidates) == 1:
|
||||
car_fingerprint = list(fw_candidates)[0]
|
||||
source = car.CarParams.FingerprintSource.fw
|
||||
# If FW query returns exactly 1 candidate, use it
|
||||
if len(fw_candidates) == 1:
|
||||
car_fingerprint = list(fw_candidates)[0]
|
||||
source = car.CarParams.FingerprintSource.fw
|
||||
|
||||
# dp, store values if cache is off
|
||||
put_nonblocking("DragonCachedModel", pickle.dumps(car_fingerprint))
|
||||
put_nonblocking("DragonCachedFP", pickle.dumps(finger))
|
||||
put_nonblocking("DragonCachedVIN", pickle.dumps(vin))
|
||||
put_nonblocking("DragonCachedCarFW", pickle.dumps(car_fw))
|
||||
put_nonblocking("DragonCachedSource", pickle.dumps(source))
|
||||
# these are for display only
|
||||
put_nonblocking("DragonCarModel", car_fingerprint)
|
||||
|
||||
cloudlog.warning("fingerprinted %s", car_fingerprint)
|
||||
return car_fingerprint, finger, vin, car_fw, source
|
||||
|
||||
@@ -183,7 +183,7 @@ def init_apps(apps):
|
||||
]
|
||||
))
|
||||
apps.append(App(
|
||||
# v4.3.0.600310 R2098NSLAE
|
||||
# v4.5.0.600053
|
||||
"com.autonavi.amapauto",
|
||||
"com.autonavi.amapauto.MainMapActivity",
|
||||
"DragonEnableAutonavi",
|
||||
|
||||
@@ -13,6 +13,8 @@ default_conf = {
|
||||
'DragonCachedModel': '', # for cache car
|
||||
'DragonCachedFP': '', # for cache car
|
||||
'DragonCachedVIN': '', # for cache car
|
||||
'DragonCachedCarFW': '', # for cache car
|
||||
'DragonCachedSource': '', # for cache car
|
||||
'DragonAllowGas': '0',
|
||||
'DragonToyotaStockDSU': '0',
|
||||
'DragonLatCtrl': '1',
|
||||
@@ -50,7 +52,6 @@ default_conf = {
|
||||
'DragonUIBlinker': '0',
|
||||
'DragonEnableDriverMonitoring': '1',
|
||||
'DragonCarModel': '',
|
||||
'DragonCarVIN': '',
|
||||
'DragonEnableSlowOnCurve': '1',
|
||||
'DragonEnableLeadCarMovingAlert': '0',
|
||||
'DragonToyotaSnGMod': '0',
|
||||
@@ -67,8 +68,7 @@ default_conf = {
|
||||
}
|
||||
|
||||
deprecated_conf = {
|
||||
'DragonIsEON': '',
|
||||
'DragonHWChecked': '',
|
||||
'DragonCarVIN': '',
|
||||
}
|
||||
|
||||
deprecated_conf_invert = {
|
||||
|
||||
@@ -807,26 +807,26 @@ static void ui_draw_infobar(UIState *s) {
|
||||
|
||||
char infobar[100];
|
||||
// create time string
|
||||
char date_time[17];
|
||||
char date_time[20];
|
||||
time_t rawtime = time(NULL);
|
||||
struct tm timeinfo;
|
||||
localtime_r(&rawtime, &timeinfo);
|
||||
strftime(date_time, sizeof(date_time),"%D %T", &timeinfo);
|
||||
strftime(date_time, sizeof(date_time),"%F %T", &timeinfo);
|
||||
|
||||
if (s->dragon_ui_dev_mini) {
|
||||
char rel_steer[9];
|
||||
snprintf(rel_steer, sizeof(rel_steer), "%s% 5.1f°", s->scene.angleSteers < 0? "-" : "+", fabs(s->scene.angleSteers));
|
||||
snprintf(rel_steer, sizeof(rel_steer), "%s%05.1f°", s->scene.angleSteers < 0? "-" : "+", fabs(s->scene.angleSteers));
|
||||
|
||||
char des_steer[9];
|
||||
if (s->scene.engaged) {
|
||||
snprintf(des_steer, sizeof(des_steer), "%s% 5.1f°", s->scene.angleSteersDes < 0? "-" : "+", fabs(s->scene.angleSteersDes));
|
||||
snprintf(des_steer, sizeof(des_steer), "%s%05.1f°", s->scene.angleSteersDes < 0? "-" : "+", fabs(s->scene.angleSteersDes));
|
||||
} else {
|
||||
snprintf(des_steer, sizeof(des_steer), "%7s", "-");
|
||||
}
|
||||
|
||||
char lead_dist[8];
|
||||
if (s->scene.lead_status) {
|
||||
snprintf(lead_dist, sizeof(lead_dist), "% 6.2fm", s->scene.lead_d_rel);
|
||||
snprintf(lead_dist, sizeof(lead_dist), "%06.2fm", s->scene.lead_d_rel);
|
||||
} else {
|
||||
snprintf(lead_dist, sizeof(lead_dist), "%7s", "-");
|
||||
}
|
||||
@@ -854,7 +854,7 @@ static void ui_draw_infobar(UIState *s) {
|
||||
nvgFillColor(s->vg, nvgRGBA(0, 0, 0, 180));
|
||||
nvgFill(s->vg);
|
||||
|
||||
nvgFontSize(s->vg, hasSidebar? 35:42);
|
||||
nvgFontSize(s->vg, hasSidebar? 43:50);
|
||||
nvgFontFace(s->vg, "courbd");
|
||||
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 180));
|
||||
nvgTextAlign(s->vg, NVG_ALIGN_CENTER);
|
||||
|
||||
Binary file not shown.
+42
-12
@@ -116,20 +116,13 @@ def set_update_available_params(new_version=False):
|
||||
params.put("LastUpdateTime", t.encode('utf8'))
|
||||
|
||||
if new_version:
|
||||
# Write latest release notes to param
|
||||
try:
|
||||
r = subprocess.check_output(["curl", "-H", "'Cache-Control: no-cache'", "-s", "https://raw.githubusercontent.com/dragonpilot-community/dragonpilot/docs/CHANGELOG.md"])
|
||||
r = r[:r.find(b'\n\n')] # Slice latest release notes
|
||||
with open(os.path.join(FINALIZED, "RELEASES.md"), "rb") as f:
|
||||
r = f.read()
|
||||
r = r[:r.find(b'\n\n')] # Slice latest release notes
|
||||
params.put("ReleaseNotes", r + b"\n")
|
||||
except:
|
||||
except Exception:
|
||||
params.put("ReleaseNotes", "")
|
||||
#try:
|
||||
# with open(os.path.join(FINALIZED, "RELEASES.md"), "rb") as f:
|
||||
# r = f.read()
|
||||
# r = r[:r.find(b'\n\n')] # Slice latest release notes
|
||||
# params.put("ReleaseNotes", r + b"\n")
|
||||
#except Exception:
|
||||
# params.put("ReleaseNotes", "")
|
||||
params.put("UpdateAvailable", "1")
|
||||
|
||||
|
||||
@@ -299,7 +292,7 @@ def attempt_update():
|
||||
set_update_available_params(new_version=new_version)
|
||||
|
||||
|
||||
def main(gctx=None):
|
||||
def main_bak(gctx=None):
|
||||
overlay_init_done = False
|
||||
wait_helper = WaitTimeHelper()
|
||||
params = Params()
|
||||
@@ -364,5 +357,42 @@ def main(gctx=None):
|
||||
# We've been signaled to shut down
|
||||
dismount_ovfs()
|
||||
|
||||
def main(gctx=None):
|
||||
wait_helper = WaitTimeHelper()
|
||||
params = Params()
|
||||
|
||||
while True:
|
||||
# try network
|
||||
ping_failed = subprocess.call(["ping", "-W", "4", "-c", "1", "8.8.8.8"])
|
||||
|
||||
if not ping_failed:
|
||||
# download application update
|
||||
git_fetch_output = run(NICE_LOW_PRIORITY + ["git", "fetch"])
|
||||
cloudlog.info("git fetch success: %s", git_fetch_output)
|
||||
|
||||
# Write update available param
|
||||
cur_hash = run(["git", "rev-parse", "HEAD"]).rstrip()
|
||||
upstream_hash = run(["git", "rev-parse", "@{u}"]).rstrip()
|
||||
cloudlog.info("comparing %s to %s" % (cur_hash, upstream_hash))
|
||||
params.put("UpdateAvailable", str(int(cur_hash != upstream_hash)))
|
||||
|
||||
# Write latest release notes to param
|
||||
try:
|
||||
# r = subprocess.check_output(["git", "--no-pager", "show", "@{u}:RELEASES.md"])
|
||||
r = subprocess.check_output(["curl", "-H", "'Cache-Control: no-cache'", "-s", "https://raw.githubusercontent.com/dragonpilot-community/dragonpilot/docs/CHANGELOG.md"])
|
||||
r = r[:r.find(b'\n\n')] # Slice latest release notes
|
||||
params.put("ReleaseNotes", r + b"\n")
|
||||
except:
|
||||
params.put("ReleaseNotes", "")
|
||||
|
||||
t = datetime.datetime.now().isoformat()
|
||||
params.put("LastUpdateTime", t.encode('utf8'))
|
||||
|
||||
wait_between_updates(wait_helper.ready_event)
|
||||
if wait_helper.shutdown:
|
||||
break
|
||||
# We've been signaled to shut down
|
||||
dismount_ovfs()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user