mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-23 15:02:06 +08:00
Make the DSP work everywhere (#2621)
* Use DSP again * 20 Hz Co-authored-by: Willem Melching <willem.melching@gmail.com>
This commit is contained in:
+7
-2
@@ -4,16 +4,21 @@ import os
|
||||
import time
|
||||
import multiprocessing
|
||||
|
||||
from common.hardware import PC
|
||||
from common.hardware import PC, TICI
|
||||
from common.clock import sec_since_boot # pylint: disable=no-name-in-module, import-error
|
||||
|
||||
|
||||
# time step for each process
|
||||
DT_CTRL = 0.01 # controlsd
|
||||
DT_MDL = 0.05 # model
|
||||
DT_DMON = 0.1 # driver monitoring
|
||||
DT_TRML = 0.5 # thermald and manager
|
||||
|
||||
# driver monitoring
|
||||
if TICI:
|
||||
DT_DMON = 0.05
|
||||
else:
|
||||
DT_DMON = 0.1
|
||||
|
||||
|
||||
class Priority:
|
||||
MIN_REALTIME = 52 # highest android process priority is 51
|
||||
|
||||
@@ -26,10 +26,6 @@ int main(int argc, char **argv) {
|
||||
int err;
|
||||
setpriority(PRIO_PROCESS, 0, -15);
|
||||
|
||||
#ifdef QCOM2
|
||||
set_core_affinity(5);
|
||||
#endif
|
||||
|
||||
signal(SIGINT, (sighandler_t)set_do_exit);
|
||||
signal(SIGTERM, (sighandler_t)set_do_exit);
|
||||
|
||||
@@ -70,11 +66,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
LOGD("dmonitoring process: %.2fms, from last %.2fms", t2-t1, t1-last);
|
||||
last = t1;
|
||||
#ifdef QCOM2
|
||||
// this makes it run at about 2.7Hz on tici CPU to deal with modeld lags
|
||||
// TODO: DSP needs to be freed (again)
|
||||
usleep(250000);
|
||||
#endif
|
||||
}
|
||||
visionstream_destroy(&stream);
|
||||
}
|
||||
|
||||
@@ -22,11 +22,8 @@ void dmonitoring_init(DMonitoringModelState* s) {
|
||||
#else
|
||||
const char* model_path = "../../models/dmonitoring_model.dlc";
|
||||
#endif
|
||||
#ifdef QCOM2
|
||||
int runtime = USE_CPU_RUNTIME;
|
||||
#else
|
||||
|
||||
int runtime = USE_DSP_RUNTIME;
|
||||
#endif
|
||||
s->m = new DefaultRunModel(model_path, (float*)&s->output, OUTPUT_SIZE, runtime);
|
||||
s->is_rhd = Params().read_db_bool("IsRHD");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user