mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-17 15:22:10 +08:00
build
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,25 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
|
||||
source "$DIR/launch_env.sh"
|
||||
|
||||
export SP_BOOT_TIMING_LOG="${SP_BOOT_TIMING_LOG:-/tmp/starpilot_boot_timing.log}"
|
||||
: > "$SP_BOOT_TIMING_LOG" 2>/dev/null || true
|
||||
SP_LAUNCH_LAST_SECONDS=$SECONDS
|
||||
|
||||
function sp_boot_timing_line {
|
||||
echo "$1"
|
||||
printf '%s\n' "$1" >> "$SP_BOOT_TIMING_LOG" 2>/dev/null || true
|
||||
}
|
||||
|
||||
function sp_launch_timing {
|
||||
local now=$SECONDS
|
||||
local delta=$((now - SP_LAUNCH_LAST_SECONDS))
|
||||
sp_boot_timing_line "SP_BOOT_TIMING launch $1 +${delta}s total=${now}s"
|
||||
SP_LAUNCH_LAST_SECONDS=$now
|
||||
}
|
||||
|
||||
function agnos_init {
|
||||
sp_launch_timing "agnos_init_start"
|
||||
|
||||
# TODO: move this to agnos
|
||||
sudo rm -f /data/etc/NetworkManager/system-connections/*.nmmeta
|
||||
|
||||
@@ -44,9 +62,13 @@ function agnos_init {
|
||||
fi
|
||||
$DIR/system/hardware/tici/updater $AGNOS_PY $MANIFEST
|
||||
fi
|
||||
|
||||
sp_launch_timing "agnos_init_done"
|
||||
}
|
||||
|
||||
function launch {
|
||||
sp_launch_timing "launch_start"
|
||||
|
||||
# Remove orphaned git lock if it exists on boot
|
||||
[ -f "$DIR/.git/index.lock" ] && rm -f $DIR/.git/index.lock
|
||||
|
||||
@@ -83,30 +105,37 @@ function launch {
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
sp_launch_timing "overlay_check_done"
|
||||
|
||||
# handle pythonpath
|
||||
ln -sfn $(pwd) /data/pythonpath
|
||||
export BASEDIR="$DIR"
|
||||
export PYTHONPATH="$DIR/starpilot/third_party:$PWD"
|
||||
sp_launch_timing "pythonpath_done"
|
||||
|
||||
# hardware specific init
|
||||
if [ -f /AGNOS ]; then
|
||||
agnos_init
|
||||
fi
|
||||
sp_launch_timing "hardware_init_done"
|
||||
|
||||
# write tmux scrollback to a file
|
||||
tmux capture-pane -pq -S-1000 > /tmp/launch_log
|
||||
sp_launch_timing "capture_launch_log_done"
|
||||
|
||||
# start manager
|
||||
cd system/manager
|
||||
|
||||
sp_launch_timing "launch_param_migrations_start"
|
||||
if ! python3 ./launch_param_migrations.py; then
|
||||
echo "Launch param migrations failed; continuing boot."
|
||||
fi
|
||||
sp_launch_timing "launch_param_migrations_done"
|
||||
|
||||
# Bootstrap runtime (e.g. /usr/comma after reset/uninstall) must go straight
|
||||
# to manager/setup flow. Do not run StarPilot prebuilt checks/builds here.
|
||||
if [ "$DIR" = "/usr/comma" ] || [ ! -d "$DIR/.git" ]; then
|
||||
sp_launch_timing "bootstrap_manager_start"
|
||||
./manager.py
|
||||
while true; do sleep 1; done
|
||||
fi
|
||||
@@ -114,8 +143,29 @@ function launch {
|
||||
function prebuilt_runtime_compatible {
|
||||
python3 - <<'PY'
|
||||
import importlib
|
||||
import os
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import time
|
||||
|
||||
start = time.monotonic()
|
||||
last = start
|
||||
log_path = os.environ.get("SP_BOOT_TIMING_LOG")
|
||||
|
||||
def emit(line):
|
||||
print(line, flush=True)
|
||||
if log_path:
|
||||
try:
|
||||
with open(log_path, "a") as f:
|
||||
f.write(line + "\n")
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def log_step(label):
|
||||
global last
|
||||
now = time.monotonic()
|
||||
emit(f"SP_BOOT_TIMING prebuilt_compat {label} +{now - last:.3f}s total={now - start:.3f}s")
|
||||
last = now
|
||||
|
||||
mods = [
|
||||
"openpilot.common.params_pyx",
|
||||
@@ -133,6 +183,7 @@ for mod in mods:
|
||||
except Exception as e:
|
||||
print(f"Prebuilt compatibility failure in {mod}: {e}", file=sys.stderr)
|
||||
raise
|
||||
log_step(f"import:{mod}")
|
||||
|
||||
repo_root = Path.cwd().parents[1]
|
||||
required_files = [
|
||||
@@ -152,6 +203,7 @@ required_files = [
|
||||
for path in required_files:
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"Missing prebuilt runtime artifact: {path}")
|
||||
log_step("required_files")
|
||||
PY
|
||||
}
|
||||
|
||||
@@ -160,14 +212,19 @@ PY
|
||||
USE_PREBUILT=$(tr -d '\n' < /data/params/d/UsePrebuilt)
|
||||
fi
|
||||
|
||||
sp_launch_timing "prebuilt_decision_done"
|
||||
if [ "$USE_PREBUILT" = "1" ] && [ -f $DIR/prebuilt ] && ! prebuilt_runtime_compatible; then
|
||||
echo "Prebuilt runtime artifacts are incompatible on this device; rebuilding locally."
|
||||
USE_PREBUILT=0
|
||||
fi
|
||||
sp_launch_timing "prebuilt_compat_done"
|
||||
|
||||
if [ "$USE_PREBUILT" != "1" ] || [ ! -f $DIR/prebuilt ]; then
|
||||
sp_launch_timing "build_start"
|
||||
./build.py
|
||||
sp_launch_timing "build_done"
|
||||
fi
|
||||
sp_launch_timing "manager_start"
|
||||
./manager.py
|
||||
|
||||
# if broken, keep on screen error
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
extern const uint8_t gitversion[19];
|
||||
const uint8_t gitversion[19] = "DEV-d5e40d3b-DEBUG";
|
||||
const uint8_t gitversion[19] = "DEV-9d2149d4-DEBUG";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
DEV-d5e40d3b-DEBUG
|
||||
DEV-9d2149d4-DEBUG
|
||||
@@ -45,326 +45,326 @@ const static double MAHA_THRESH_31 = 3.8414588206941227;
|
||||
* *
|
||||
* This file is part of 'ekf' *
|
||||
******************************************************************************/
|
||||
void err_fun(double *nom_x, double *delta_x, double *out_6318981254884856825) {
|
||||
out_6318981254884856825[0] = delta_x[0] + nom_x[0];
|
||||
out_6318981254884856825[1] = delta_x[1] + nom_x[1];
|
||||
out_6318981254884856825[2] = delta_x[2] + nom_x[2];
|
||||
out_6318981254884856825[3] = delta_x[3] + nom_x[3];
|
||||
out_6318981254884856825[4] = delta_x[4] + nom_x[4];
|
||||
out_6318981254884856825[5] = delta_x[5] + nom_x[5];
|
||||
out_6318981254884856825[6] = delta_x[6] + nom_x[6];
|
||||
out_6318981254884856825[7] = delta_x[7] + nom_x[7];
|
||||
out_6318981254884856825[8] = delta_x[8] + nom_x[8];
|
||||
void err_fun(double *nom_x, double *delta_x, double *out_5572165619661696722) {
|
||||
out_5572165619661696722[0] = delta_x[0] + nom_x[0];
|
||||
out_5572165619661696722[1] = delta_x[1] + nom_x[1];
|
||||
out_5572165619661696722[2] = delta_x[2] + nom_x[2];
|
||||
out_5572165619661696722[3] = delta_x[3] + nom_x[3];
|
||||
out_5572165619661696722[4] = delta_x[4] + nom_x[4];
|
||||
out_5572165619661696722[5] = delta_x[5] + nom_x[5];
|
||||
out_5572165619661696722[6] = delta_x[6] + nom_x[6];
|
||||
out_5572165619661696722[7] = delta_x[7] + nom_x[7];
|
||||
out_5572165619661696722[8] = delta_x[8] + nom_x[8];
|
||||
}
|
||||
void inv_err_fun(double *nom_x, double *true_x, double *out_6625913990707465652) {
|
||||
out_6625913990707465652[0] = -nom_x[0] + true_x[0];
|
||||
out_6625913990707465652[1] = -nom_x[1] + true_x[1];
|
||||
out_6625913990707465652[2] = -nom_x[2] + true_x[2];
|
||||
out_6625913990707465652[3] = -nom_x[3] + true_x[3];
|
||||
out_6625913990707465652[4] = -nom_x[4] + true_x[4];
|
||||
out_6625913990707465652[5] = -nom_x[5] + true_x[5];
|
||||
out_6625913990707465652[6] = -nom_x[6] + true_x[6];
|
||||
out_6625913990707465652[7] = -nom_x[7] + true_x[7];
|
||||
out_6625913990707465652[8] = -nom_x[8] + true_x[8];
|
||||
void inv_err_fun(double *nom_x, double *true_x, double *out_1924778118840772208) {
|
||||
out_1924778118840772208[0] = -nom_x[0] + true_x[0];
|
||||
out_1924778118840772208[1] = -nom_x[1] + true_x[1];
|
||||
out_1924778118840772208[2] = -nom_x[2] + true_x[2];
|
||||
out_1924778118840772208[3] = -nom_x[3] + true_x[3];
|
||||
out_1924778118840772208[4] = -nom_x[4] + true_x[4];
|
||||
out_1924778118840772208[5] = -nom_x[5] + true_x[5];
|
||||
out_1924778118840772208[6] = -nom_x[6] + true_x[6];
|
||||
out_1924778118840772208[7] = -nom_x[7] + true_x[7];
|
||||
out_1924778118840772208[8] = -nom_x[8] + true_x[8];
|
||||
}
|
||||
void H_mod_fun(double *state, double *out_6152129630444976452) {
|
||||
out_6152129630444976452[0] = 1.0;
|
||||
out_6152129630444976452[1] = 0.0;
|
||||
out_6152129630444976452[2] = 0.0;
|
||||
out_6152129630444976452[3] = 0.0;
|
||||
out_6152129630444976452[4] = 0.0;
|
||||
out_6152129630444976452[5] = 0.0;
|
||||
out_6152129630444976452[6] = 0.0;
|
||||
out_6152129630444976452[7] = 0.0;
|
||||
out_6152129630444976452[8] = 0.0;
|
||||
out_6152129630444976452[9] = 0.0;
|
||||
out_6152129630444976452[10] = 1.0;
|
||||
out_6152129630444976452[11] = 0.0;
|
||||
out_6152129630444976452[12] = 0.0;
|
||||
out_6152129630444976452[13] = 0.0;
|
||||
out_6152129630444976452[14] = 0.0;
|
||||
out_6152129630444976452[15] = 0.0;
|
||||
out_6152129630444976452[16] = 0.0;
|
||||
out_6152129630444976452[17] = 0.0;
|
||||
out_6152129630444976452[18] = 0.0;
|
||||
out_6152129630444976452[19] = 0.0;
|
||||
out_6152129630444976452[20] = 1.0;
|
||||
out_6152129630444976452[21] = 0.0;
|
||||
out_6152129630444976452[22] = 0.0;
|
||||
out_6152129630444976452[23] = 0.0;
|
||||
out_6152129630444976452[24] = 0.0;
|
||||
out_6152129630444976452[25] = 0.0;
|
||||
out_6152129630444976452[26] = 0.0;
|
||||
out_6152129630444976452[27] = 0.0;
|
||||
out_6152129630444976452[28] = 0.0;
|
||||
out_6152129630444976452[29] = 0.0;
|
||||
out_6152129630444976452[30] = 1.0;
|
||||
out_6152129630444976452[31] = 0.0;
|
||||
out_6152129630444976452[32] = 0.0;
|
||||
out_6152129630444976452[33] = 0.0;
|
||||
out_6152129630444976452[34] = 0.0;
|
||||
out_6152129630444976452[35] = 0.0;
|
||||
out_6152129630444976452[36] = 0.0;
|
||||
out_6152129630444976452[37] = 0.0;
|
||||
out_6152129630444976452[38] = 0.0;
|
||||
out_6152129630444976452[39] = 0.0;
|
||||
out_6152129630444976452[40] = 1.0;
|
||||
out_6152129630444976452[41] = 0.0;
|
||||
out_6152129630444976452[42] = 0.0;
|
||||
out_6152129630444976452[43] = 0.0;
|
||||
out_6152129630444976452[44] = 0.0;
|
||||
out_6152129630444976452[45] = 0.0;
|
||||
out_6152129630444976452[46] = 0.0;
|
||||
out_6152129630444976452[47] = 0.0;
|
||||
out_6152129630444976452[48] = 0.0;
|
||||
out_6152129630444976452[49] = 0.0;
|
||||
out_6152129630444976452[50] = 1.0;
|
||||
out_6152129630444976452[51] = 0.0;
|
||||
out_6152129630444976452[52] = 0.0;
|
||||
out_6152129630444976452[53] = 0.0;
|
||||
out_6152129630444976452[54] = 0.0;
|
||||
out_6152129630444976452[55] = 0.0;
|
||||
out_6152129630444976452[56] = 0.0;
|
||||
out_6152129630444976452[57] = 0.0;
|
||||
out_6152129630444976452[58] = 0.0;
|
||||
out_6152129630444976452[59] = 0.0;
|
||||
out_6152129630444976452[60] = 1.0;
|
||||
out_6152129630444976452[61] = 0.0;
|
||||
out_6152129630444976452[62] = 0.0;
|
||||
out_6152129630444976452[63] = 0.0;
|
||||
out_6152129630444976452[64] = 0.0;
|
||||
out_6152129630444976452[65] = 0.0;
|
||||
out_6152129630444976452[66] = 0.0;
|
||||
out_6152129630444976452[67] = 0.0;
|
||||
out_6152129630444976452[68] = 0.0;
|
||||
out_6152129630444976452[69] = 0.0;
|
||||
out_6152129630444976452[70] = 1.0;
|
||||
out_6152129630444976452[71] = 0.0;
|
||||
out_6152129630444976452[72] = 0.0;
|
||||
out_6152129630444976452[73] = 0.0;
|
||||
out_6152129630444976452[74] = 0.0;
|
||||
out_6152129630444976452[75] = 0.0;
|
||||
out_6152129630444976452[76] = 0.0;
|
||||
out_6152129630444976452[77] = 0.0;
|
||||
out_6152129630444976452[78] = 0.0;
|
||||
out_6152129630444976452[79] = 0.0;
|
||||
out_6152129630444976452[80] = 1.0;
|
||||
void H_mod_fun(double *state, double *out_5209558866032184805) {
|
||||
out_5209558866032184805[0] = 1.0;
|
||||
out_5209558866032184805[1] = 0.0;
|
||||
out_5209558866032184805[2] = 0.0;
|
||||
out_5209558866032184805[3] = 0.0;
|
||||
out_5209558866032184805[4] = 0.0;
|
||||
out_5209558866032184805[5] = 0.0;
|
||||
out_5209558866032184805[6] = 0.0;
|
||||
out_5209558866032184805[7] = 0.0;
|
||||
out_5209558866032184805[8] = 0.0;
|
||||
out_5209558866032184805[9] = 0.0;
|
||||
out_5209558866032184805[10] = 1.0;
|
||||
out_5209558866032184805[11] = 0.0;
|
||||
out_5209558866032184805[12] = 0.0;
|
||||
out_5209558866032184805[13] = 0.0;
|
||||
out_5209558866032184805[14] = 0.0;
|
||||
out_5209558866032184805[15] = 0.0;
|
||||
out_5209558866032184805[16] = 0.0;
|
||||
out_5209558866032184805[17] = 0.0;
|
||||
out_5209558866032184805[18] = 0.0;
|
||||
out_5209558866032184805[19] = 0.0;
|
||||
out_5209558866032184805[20] = 1.0;
|
||||
out_5209558866032184805[21] = 0.0;
|
||||
out_5209558866032184805[22] = 0.0;
|
||||
out_5209558866032184805[23] = 0.0;
|
||||
out_5209558866032184805[24] = 0.0;
|
||||
out_5209558866032184805[25] = 0.0;
|
||||
out_5209558866032184805[26] = 0.0;
|
||||
out_5209558866032184805[27] = 0.0;
|
||||
out_5209558866032184805[28] = 0.0;
|
||||
out_5209558866032184805[29] = 0.0;
|
||||
out_5209558866032184805[30] = 1.0;
|
||||
out_5209558866032184805[31] = 0.0;
|
||||
out_5209558866032184805[32] = 0.0;
|
||||
out_5209558866032184805[33] = 0.0;
|
||||
out_5209558866032184805[34] = 0.0;
|
||||
out_5209558866032184805[35] = 0.0;
|
||||
out_5209558866032184805[36] = 0.0;
|
||||
out_5209558866032184805[37] = 0.0;
|
||||
out_5209558866032184805[38] = 0.0;
|
||||
out_5209558866032184805[39] = 0.0;
|
||||
out_5209558866032184805[40] = 1.0;
|
||||
out_5209558866032184805[41] = 0.0;
|
||||
out_5209558866032184805[42] = 0.0;
|
||||
out_5209558866032184805[43] = 0.0;
|
||||
out_5209558866032184805[44] = 0.0;
|
||||
out_5209558866032184805[45] = 0.0;
|
||||
out_5209558866032184805[46] = 0.0;
|
||||
out_5209558866032184805[47] = 0.0;
|
||||
out_5209558866032184805[48] = 0.0;
|
||||
out_5209558866032184805[49] = 0.0;
|
||||
out_5209558866032184805[50] = 1.0;
|
||||
out_5209558866032184805[51] = 0.0;
|
||||
out_5209558866032184805[52] = 0.0;
|
||||
out_5209558866032184805[53] = 0.0;
|
||||
out_5209558866032184805[54] = 0.0;
|
||||
out_5209558866032184805[55] = 0.0;
|
||||
out_5209558866032184805[56] = 0.0;
|
||||
out_5209558866032184805[57] = 0.0;
|
||||
out_5209558866032184805[58] = 0.0;
|
||||
out_5209558866032184805[59] = 0.0;
|
||||
out_5209558866032184805[60] = 1.0;
|
||||
out_5209558866032184805[61] = 0.0;
|
||||
out_5209558866032184805[62] = 0.0;
|
||||
out_5209558866032184805[63] = 0.0;
|
||||
out_5209558866032184805[64] = 0.0;
|
||||
out_5209558866032184805[65] = 0.0;
|
||||
out_5209558866032184805[66] = 0.0;
|
||||
out_5209558866032184805[67] = 0.0;
|
||||
out_5209558866032184805[68] = 0.0;
|
||||
out_5209558866032184805[69] = 0.0;
|
||||
out_5209558866032184805[70] = 1.0;
|
||||
out_5209558866032184805[71] = 0.0;
|
||||
out_5209558866032184805[72] = 0.0;
|
||||
out_5209558866032184805[73] = 0.0;
|
||||
out_5209558866032184805[74] = 0.0;
|
||||
out_5209558866032184805[75] = 0.0;
|
||||
out_5209558866032184805[76] = 0.0;
|
||||
out_5209558866032184805[77] = 0.0;
|
||||
out_5209558866032184805[78] = 0.0;
|
||||
out_5209558866032184805[79] = 0.0;
|
||||
out_5209558866032184805[80] = 1.0;
|
||||
}
|
||||
void f_fun(double *state, double dt, double *out_6830787204701444163) {
|
||||
out_6830787204701444163[0] = state[0];
|
||||
out_6830787204701444163[1] = state[1];
|
||||
out_6830787204701444163[2] = state[2];
|
||||
out_6830787204701444163[3] = state[3];
|
||||
out_6830787204701444163[4] = state[4];
|
||||
out_6830787204701444163[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8100000000000005*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5];
|
||||
out_6830787204701444163[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6];
|
||||
out_6830787204701444163[7] = state[7];
|
||||
out_6830787204701444163[8] = state[8];
|
||||
void f_fun(double *state, double dt, double *out_8731244167447695934) {
|
||||
out_8731244167447695934[0] = state[0];
|
||||
out_8731244167447695934[1] = state[1];
|
||||
out_8731244167447695934[2] = state[2];
|
||||
out_8731244167447695934[3] = state[3];
|
||||
out_8731244167447695934[4] = state[4];
|
||||
out_8731244167447695934[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8100000000000005*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5];
|
||||
out_8731244167447695934[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6];
|
||||
out_8731244167447695934[7] = state[7];
|
||||
out_8731244167447695934[8] = state[8];
|
||||
}
|
||||
void F_fun(double *state, double dt, double *out_2889206061873137605) {
|
||||
out_2889206061873137605[0] = 1;
|
||||
out_2889206061873137605[1] = 0;
|
||||
out_2889206061873137605[2] = 0;
|
||||
out_2889206061873137605[3] = 0;
|
||||
out_2889206061873137605[4] = 0;
|
||||
out_2889206061873137605[5] = 0;
|
||||
out_2889206061873137605[6] = 0;
|
||||
out_2889206061873137605[7] = 0;
|
||||
out_2889206061873137605[8] = 0;
|
||||
out_2889206061873137605[9] = 0;
|
||||
out_2889206061873137605[10] = 1;
|
||||
out_2889206061873137605[11] = 0;
|
||||
out_2889206061873137605[12] = 0;
|
||||
out_2889206061873137605[13] = 0;
|
||||
out_2889206061873137605[14] = 0;
|
||||
out_2889206061873137605[15] = 0;
|
||||
out_2889206061873137605[16] = 0;
|
||||
out_2889206061873137605[17] = 0;
|
||||
out_2889206061873137605[18] = 0;
|
||||
out_2889206061873137605[19] = 0;
|
||||
out_2889206061873137605[20] = 1;
|
||||
out_2889206061873137605[21] = 0;
|
||||
out_2889206061873137605[22] = 0;
|
||||
out_2889206061873137605[23] = 0;
|
||||
out_2889206061873137605[24] = 0;
|
||||
out_2889206061873137605[25] = 0;
|
||||
out_2889206061873137605[26] = 0;
|
||||
out_2889206061873137605[27] = 0;
|
||||
out_2889206061873137605[28] = 0;
|
||||
out_2889206061873137605[29] = 0;
|
||||
out_2889206061873137605[30] = 1;
|
||||
out_2889206061873137605[31] = 0;
|
||||
out_2889206061873137605[32] = 0;
|
||||
out_2889206061873137605[33] = 0;
|
||||
out_2889206061873137605[34] = 0;
|
||||
out_2889206061873137605[35] = 0;
|
||||
out_2889206061873137605[36] = 0;
|
||||
out_2889206061873137605[37] = 0;
|
||||
out_2889206061873137605[38] = 0;
|
||||
out_2889206061873137605[39] = 0;
|
||||
out_2889206061873137605[40] = 1;
|
||||
out_2889206061873137605[41] = 0;
|
||||
out_2889206061873137605[42] = 0;
|
||||
out_2889206061873137605[43] = 0;
|
||||
out_2889206061873137605[44] = 0;
|
||||
out_2889206061873137605[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4]));
|
||||
out_2889206061873137605[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2));
|
||||
out_2889206061873137605[47] = -dt*stiffness_front*state[0]/(mass*state[1]);
|
||||
out_2889206061873137605[48] = -dt*stiffness_front*state[0]/(mass*state[1]);
|
||||
out_2889206061873137605[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2)));
|
||||
out_2889206061873137605[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1;
|
||||
out_2889206061873137605[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]));
|
||||
out_2889206061873137605[52] = dt*stiffness_front*state[0]/(mass*state[1]);
|
||||
out_2889206061873137605[53] = -9.8100000000000005*dt;
|
||||
out_2889206061873137605[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4]));
|
||||
out_2889206061873137605[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
|
||||
out_2889206061873137605[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_2889206061873137605[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_2889206061873137605[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2)));
|
||||
out_2889206061873137605[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
|
||||
out_2889206061873137605[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1;
|
||||
out_2889206061873137605[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_2889206061873137605[62] = 0;
|
||||
out_2889206061873137605[63] = 0;
|
||||
out_2889206061873137605[64] = 0;
|
||||
out_2889206061873137605[65] = 0;
|
||||
out_2889206061873137605[66] = 0;
|
||||
out_2889206061873137605[67] = 0;
|
||||
out_2889206061873137605[68] = 0;
|
||||
out_2889206061873137605[69] = 0;
|
||||
out_2889206061873137605[70] = 1;
|
||||
out_2889206061873137605[71] = 0;
|
||||
out_2889206061873137605[72] = 0;
|
||||
out_2889206061873137605[73] = 0;
|
||||
out_2889206061873137605[74] = 0;
|
||||
out_2889206061873137605[75] = 0;
|
||||
out_2889206061873137605[76] = 0;
|
||||
out_2889206061873137605[77] = 0;
|
||||
out_2889206061873137605[78] = 0;
|
||||
out_2889206061873137605[79] = 0;
|
||||
out_2889206061873137605[80] = 1;
|
||||
void F_fun(double *state, double dt, double *out_5438267541501267753) {
|
||||
out_5438267541501267753[0] = 1;
|
||||
out_5438267541501267753[1] = 0;
|
||||
out_5438267541501267753[2] = 0;
|
||||
out_5438267541501267753[3] = 0;
|
||||
out_5438267541501267753[4] = 0;
|
||||
out_5438267541501267753[5] = 0;
|
||||
out_5438267541501267753[6] = 0;
|
||||
out_5438267541501267753[7] = 0;
|
||||
out_5438267541501267753[8] = 0;
|
||||
out_5438267541501267753[9] = 0;
|
||||
out_5438267541501267753[10] = 1;
|
||||
out_5438267541501267753[11] = 0;
|
||||
out_5438267541501267753[12] = 0;
|
||||
out_5438267541501267753[13] = 0;
|
||||
out_5438267541501267753[14] = 0;
|
||||
out_5438267541501267753[15] = 0;
|
||||
out_5438267541501267753[16] = 0;
|
||||
out_5438267541501267753[17] = 0;
|
||||
out_5438267541501267753[18] = 0;
|
||||
out_5438267541501267753[19] = 0;
|
||||
out_5438267541501267753[20] = 1;
|
||||
out_5438267541501267753[21] = 0;
|
||||
out_5438267541501267753[22] = 0;
|
||||
out_5438267541501267753[23] = 0;
|
||||
out_5438267541501267753[24] = 0;
|
||||
out_5438267541501267753[25] = 0;
|
||||
out_5438267541501267753[26] = 0;
|
||||
out_5438267541501267753[27] = 0;
|
||||
out_5438267541501267753[28] = 0;
|
||||
out_5438267541501267753[29] = 0;
|
||||
out_5438267541501267753[30] = 1;
|
||||
out_5438267541501267753[31] = 0;
|
||||
out_5438267541501267753[32] = 0;
|
||||
out_5438267541501267753[33] = 0;
|
||||
out_5438267541501267753[34] = 0;
|
||||
out_5438267541501267753[35] = 0;
|
||||
out_5438267541501267753[36] = 0;
|
||||
out_5438267541501267753[37] = 0;
|
||||
out_5438267541501267753[38] = 0;
|
||||
out_5438267541501267753[39] = 0;
|
||||
out_5438267541501267753[40] = 1;
|
||||
out_5438267541501267753[41] = 0;
|
||||
out_5438267541501267753[42] = 0;
|
||||
out_5438267541501267753[43] = 0;
|
||||
out_5438267541501267753[44] = 0;
|
||||
out_5438267541501267753[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4]));
|
||||
out_5438267541501267753[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2));
|
||||
out_5438267541501267753[47] = -dt*stiffness_front*state[0]/(mass*state[1]);
|
||||
out_5438267541501267753[48] = -dt*stiffness_front*state[0]/(mass*state[1]);
|
||||
out_5438267541501267753[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2)));
|
||||
out_5438267541501267753[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1;
|
||||
out_5438267541501267753[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]));
|
||||
out_5438267541501267753[52] = dt*stiffness_front*state[0]/(mass*state[1]);
|
||||
out_5438267541501267753[53] = -9.8100000000000005*dt;
|
||||
out_5438267541501267753[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4]));
|
||||
out_5438267541501267753[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
|
||||
out_5438267541501267753[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_5438267541501267753[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_5438267541501267753[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2)));
|
||||
out_5438267541501267753[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
|
||||
out_5438267541501267753[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1;
|
||||
out_5438267541501267753[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_5438267541501267753[62] = 0;
|
||||
out_5438267541501267753[63] = 0;
|
||||
out_5438267541501267753[64] = 0;
|
||||
out_5438267541501267753[65] = 0;
|
||||
out_5438267541501267753[66] = 0;
|
||||
out_5438267541501267753[67] = 0;
|
||||
out_5438267541501267753[68] = 0;
|
||||
out_5438267541501267753[69] = 0;
|
||||
out_5438267541501267753[70] = 1;
|
||||
out_5438267541501267753[71] = 0;
|
||||
out_5438267541501267753[72] = 0;
|
||||
out_5438267541501267753[73] = 0;
|
||||
out_5438267541501267753[74] = 0;
|
||||
out_5438267541501267753[75] = 0;
|
||||
out_5438267541501267753[76] = 0;
|
||||
out_5438267541501267753[77] = 0;
|
||||
out_5438267541501267753[78] = 0;
|
||||
out_5438267541501267753[79] = 0;
|
||||
out_5438267541501267753[80] = 1;
|
||||
}
|
||||
void h_25(double *state, double *unused, double *out_489826982790321982) {
|
||||
out_489826982790321982[0] = state[6];
|
||||
void h_25(double *state, double *unused, double *out_4244982229226314297) {
|
||||
out_4244982229226314297[0] = state[6];
|
||||
}
|
||||
void H_25(double *state, double *unused, double *out_3101426217352337927) {
|
||||
out_3101426217352337927[0] = 0;
|
||||
out_3101426217352337927[1] = 0;
|
||||
out_3101426217352337927[2] = 0;
|
||||
out_3101426217352337927[3] = 0;
|
||||
out_3101426217352337927[4] = 0;
|
||||
out_3101426217352337927[5] = 0;
|
||||
out_3101426217352337927[6] = 1;
|
||||
out_3101426217352337927[7] = 0;
|
||||
out_3101426217352337927[8] = 0;
|
||||
void H_25(double *state, double *unused, double *out_1686578216042693128) {
|
||||
out_1686578216042693128[0] = 0;
|
||||
out_1686578216042693128[1] = 0;
|
||||
out_1686578216042693128[2] = 0;
|
||||
out_1686578216042693128[3] = 0;
|
||||
out_1686578216042693128[4] = 0;
|
||||
out_1686578216042693128[5] = 0;
|
||||
out_1686578216042693128[6] = 1;
|
||||
out_1686578216042693128[7] = 0;
|
||||
out_1686578216042693128[8] = 0;
|
||||
}
|
||||
void h_24(double *state, double *unused, double *out_8333585936499166595) {
|
||||
out_8333585936499166595[0] = state[4];
|
||||
out_8333585936499166595[1] = state[5];
|
||||
void h_24(double *state, double *unused, double *out_197553727547805858) {
|
||||
out_197553727547805858[0] = state[4];
|
||||
out_197553727547805858[1] = state[5];
|
||||
}
|
||||
void H_24(double *state, double *unused, double *out_8374920500265350521) {
|
||||
out_8374920500265350521[0] = 0;
|
||||
out_8374920500265350521[1] = 0;
|
||||
out_8374920500265350521[2] = 0;
|
||||
out_8374920500265350521[3] = 0;
|
||||
out_8374920500265350521[4] = 1;
|
||||
out_8374920500265350521[5] = 0;
|
||||
out_8374920500265350521[6] = 0;
|
||||
out_8374920500265350521[7] = 0;
|
||||
out_8374920500265350521[8] = 0;
|
||||
out_8374920500265350521[9] = 0;
|
||||
out_8374920500265350521[10] = 0;
|
||||
out_8374920500265350521[11] = 0;
|
||||
out_8374920500265350521[12] = 0;
|
||||
out_8374920500265350521[13] = 0;
|
||||
out_8374920500265350521[14] = 1;
|
||||
out_8374920500265350521[15] = 0;
|
||||
out_8374920500265350521[16] = 0;
|
||||
out_8374920500265350521[17] = 0;
|
||||
void H_24(double *state, double *unused, double *out_6506899720698681391) {
|
||||
out_6506899720698681391[0] = 0;
|
||||
out_6506899720698681391[1] = 0;
|
||||
out_6506899720698681391[2] = 0;
|
||||
out_6506899720698681391[3] = 0;
|
||||
out_6506899720698681391[4] = 1;
|
||||
out_6506899720698681391[5] = 0;
|
||||
out_6506899720698681391[6] = 0;
|
||||
out_6506899720698681391[7] = 0;
|
||||
out_6506899720698681391[8] = 0;
|
||||
out_6506899720698681391[9] = 0;
|
||||
out_6506899720698681391[10] = 0;
|
||||
out_6506899720698681391[11] = 0;
|
||||
out_6506899720698681391[12] = 0;
|
||||
out_6506899720698681391[13] = 0;
|
||||
out_6506899720698681391[14] = 1;
|
||||
out_6506899720698681391[15] = 0;
|
||||
out_6506899720698681391[16] = 0;
|
||||
out_6506899720698681391[17] = 0;
|
||||
}
|
||||
void h_30(double *state, double *unused, double *out_7403112512094201377) {
|
||||
out_7403112512094201377[0] = state[4];
|
||||
void h_30(double *state, double *unused, double *out_4099462405005659326) {
|
||||
out_4099462405005659326[0] = state[4];
|
||||
}
|
||||
void H_30(double *state, double *unused, double *out_5619759175859586554) {
|
||||
out_5619759175859586554[0] = 0;
|
||||
out_5619759175859586554[1] = 0;
|
||||
out_5619759175859586554[2] = 0;
|
||||
out_5619759175859586554[3] = 0;
|
||||
out_5619759175859586554[4] = 1;
|
||||
out_5619759175859586554[5] = 0;
|
||||
out_5619759175859586554[6] = 0;
|
||||
out_5619759175859586554[7] = 0;
|
||||
out_5619759175859586554[8] = 0;
|
||||
void H_30(double *state, double *unused, double *out_1815917163185933198) {
|
||||
out_1815917163185933198[0] = 0;
|
||||
out_1815917163185933198[1] = 0;
|
||||
out_1815917163185933198[2] = 0;
|
||||
out_1815917163185933198[3] = 0;
|
||||
out_1815917163185933198[4] = 1;
|
||||
out_1815917163185933198[5] = 0;
|
||||
out_1815917163185933198[6] = 0;
|
||||
out_1815917163185933198[7] = 0;
|
||||
out_1815917163185933198[8] = 0;
|
||||
}
|
||||
void h_26(double *state, double *unused, double *out_6041958293954504594) {
|
||||
out_6041958293954504594[0] = state[7];
|
||||
void h_26(double *state, double *unused, double *out_9101135672666504971) {
|
||||
out_9101135672666504971[0] = state[7];
|
||||
}
|
||||
void H_26(double *state, double *unused, double *out_640077101521718297) {
|
||||
out_640077101521718297[0] = 0;
|
||||
out_640077101521718297[1] = 0;
|
||||
out_640077101521718297[2] = 0;
|
||||
out_640077101521718297[3] = 0;
|
||||
out_640077101521718297[4] = 0;
|
||||
out_640077101521718297[5] = 0;
|
||||
out_640077101521718297[6] = 0;
|
||||
out_640077101521718297[7] = 1;
|
||||
out_640077101521718297[8] = 0;
|
||||
void H_26(double *state, double *unused, double *out_5428081534916749352) {
|
||||
out_5428081534916749352[0] = 0;
|
||||
out_5428081534916749352[1] = 0;
|
||||
out_5428081534916749352[2] = 0;
|
||||
out_5428081534916749352[3] = 0;
|
||||
out_5428081534916749352[4] = 0;
|
||||
out_5428081534916749352[5] = 0;
|
||||
out_5428081534916749352[6] = 0;
|
||||
out_5428081534916749352[7] = 1;
|
||||
out_5428081534916749352[8] = 0;
|
||||
}
|
||||
void h_27(double *state, double *unused, double *out_8492142189216518783) {
|
||||
out_8492142189216518783[0] = state[3];
|
||||
void h_27(double *state, double *unused, double *out_756691038434531348) {
|
||||
out_756691038434531348[0] = state[3];
|
||||
}
|
||||
void H_27(double *state, double *unused, double *out_3444995864059161643) {
|
||||
out_3444995864059161643[0] = 0;
|
||||
out_3444995864059161643[1] = 0;
|
||||
out_3444995864059161643[2] = 0;
|
||||
out_3444995864059161643[3] = 1;
|
||||
out_3444995864059161643[4] = 0;
|
||||
out_3444995864059161643[5] = 0;
|
||||
out_3444995864059161643[6] = 0;
|
||||
out_3444995864059161643[7] = 0;
|
||||
out_3444995864059161643[8] = 0;
|
||||
void H_27(double *state, double *unused, double *out_3990680474986358109) {
|
||||
out_3990680474986358109[0] = 0;
|
||||
out_3990680474986358109[1] = 0;
|
||||
out_3990680474986358109[2] = 0;
|
||||
out_3990680474986358109[3] = 1;
|
||||
out_3990680474986358109[4] = 0;
|
||||
out_3990680474986358109[5] = 0;
|
||||
out_3990680474986358109[6] = 0;
|
||||
out_3990680474986358109[7] = 0;
|
||||
out_3990680474986358109[8] = 0;
|
||||
}
|
||||
void h_29(double *state, double *unused, double *out_610869538462469598) {
|
||||
out_610869538462469598[0] = state[1];
|
||||
void h_29(double *state, double *unused, double *out_7739969642829208644) {
|
||||
out_7739969642829208644[0] = state[1];
|
||||
}
|
||||
void H_29(double *state, double *unused, double *out_6129990520173978738) {
|
||||
out_6129990520173978738[0] = 0;
|
||||
out_6129990520173978738[1] = 1;
|
||||
out_6129990520173978738[2] = 0;
|
||||
out_6129990520173978738[3] = 0;
|
||||
out_6129990520173978738[4] = 0;
|
||||
out_6129990520173978738[5] = 0;
|
||||
out_6129990520173978738[6] = 0;
|
||||
out_6129990520173978738[7] = 0;
|
||||
out_6129990520173978738[8] = 0;
|
||||
void H_29(double *state, double *unused, double *out_1305685818871541014) {
|
||||
out_1305685818871541014[0] = 0;
|
||||
out_1305685818871541014[1] = 1;
|
||||
out_1305685818871541014[2] = 0;
|
||||
out_1305685818871541014[3] = 0;
|
||||
out_1305685818871541014[4] = 0;
|
||||
out_1305685818871541014[5] = 0;
|
||||
out_1305685818871541014[6] = 0;
|
||||
out_1305685818871541014[7] = 0;
|
||||
out_1305685818871541014[8] = 0;
|
||||
}
|
||||
void h_28(double *state, double *unused, double *out_3490468921555673138) {
|
||||
out_3490468921555673138[0] = state[0];
|
||||
void h_28(double *state, double *unused, double *out_186818814467131087) {
|
||||
out_186818814467131087[0] = state[0];
|
||||
}
|
||||
void H_28(double *state, double *unused, double *out_1047591503104448164) {
|
||||
out_1047591503104448164[0] = 1;
|
||||
out_1047591503104448164[1] = 0;
|
||||
out_1047591503104448164[2] = 0;
|
||||
out_1047591503104448164[3] = 0;
|
||||
out_1047591503104448164[4] = 0;
|
||||
out_1047591503104448164[5] = 0;
|
||||
out_1047591503104448164[6] = 0;
|
||||
out_1047591503104448164[7] = 0;
|
||||
out_1047591503104448164[8] = 0;
|
||||
void H_28(double *state, double *unused, double *out_7660301854784111900) {
|
||||
out_7660301854784111900[0] = 1;
|
||||
out_7660301854784111900[1] = 0;
|
||||
out_7660301854784111900[2] = 0;
|
||||
out_7660301854784111900[3] = 0;
|
||||
out_7660301854784111900[4] = 0;
|
||||
out_7660301854784111900[5] = 0;
|
||||
out_7660301854784111900[6] = 0;
|
||||
out_7660301854784111900[7] = 0;
|
||||
out_7660301854784111900[8] = 0;
|
||||
}
|
||||
void h_31(double *state, double *unused, double *out_1315479088578164838) {
|
||||
out_1315479088578164838[0] = state[8];
|
||||
void h_31(double *state, double *unused, double *out_3518283027594358144) {
|
||||
out_3518283027594358144[0] = state[8];
|
||||
}
|
||||
void H_31(double *state, double *unused, double *out_1266285203755069773) {
|
||||
out_1266285203755069773[0] = 0;
|
||||
out_1266285203755069773[1] = 0;
|
||||
out_1266285203755069773[2] = 0;
|
||||
out_1266285203755069773[3] = 0;
|
||||
out_1266285203755069773[4] = 0;
|
||||
out_1266285203755069773[5] = 0;
|
||||
out_1266285203755069773[6] = 0;
|
||||
out_1266285203755069773[7] = 0;
|
||||
out_1266285203755069773[8] = 1;
|
||||
void H_31(double *state, double *unused, double *out_1655932254165732700) {
|
||||
out_1655932254165732700[0] = 0;
|
||||
out_1655932254165732700[1] = 0;
|
||||
out_1655932254165732700[2] = 0;
|
||||
out_1655932254165732700[3] = 0;
|
||||
out_1655932254165732700[4] = 0;
|
||||
out_1655932254165732700[5] = 0;
|
||||
out_1655932254165732700[6] = 0;
|
||||
out_1655932254165732700[7] = 0;
|
||||
out_1655932254165732700[8] = 1;
|
||||
}
|
||||
#include <eigen3/Eigen/Dense>
|
||||
#include <iostream>
|
||||
@@ -518,68 +518,68 @@ void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, doubl
|
||||
void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
|
||||
update<1, 3, 0>(in_x, in_P, h_31, H_31, NULL, in_z, in_R, in_ea, MAHA_THRESH_31);
|
||||
}
|
||||
void car_err_fun(double *nom_x, double *delta_x, double *out_6318981254884856825) {
|
||||
err_fun(nom_x, delta_x, out_6318981254884856825);
|
||||
void car_err_fun(double *nom_x, double *delta_x, double *out_5572165619661696722) {
|
||||
err_fun(nom_x, delta_x, out_5572165619661696722);
|
||||
}
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_6625913990707465652) {
|
||||
inv_err_fun(nom_x, true_x, out_6625913990707465652);
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_1924778118840772208) {
|
||||
inv_err_fun(nom_x, true_x, out_1924778118840772208);
|
||||
}
|
||||
void car_H_mod_fun(double *state, double *out_6152129630444976452) {
|
||||
H_mod_fun(state, out_6152129630444976452);
|
||||
void car_H_mod_fun(double *state, double *out_5209558866032184805) {
|
||||
H_mod_fun(state, out_5209558866032184805);
|
||||
}
|
||||
void car_f_fun(double *state, double dt, double *out_6830787204701444163) {
|
||||
f_fun(state, dt, out_6830787204701444163);
|
||||
void car_f_fun(double *state, double dt, double *out_8731244167447695934) {
|
||||
f_fun(state, dt, out_8731244167447695934);
|
||||
}
|
||||
void car_F_fun(double *state, double dt, double *out_2889206061873137605) {
|
||||
F_fun(state, dt, out_2889206061873137605);
|
||||
void car_F_fun(double *state, double dt, double *out_5438267541501267753) {
|
||||
F_fun(state, dt, out_5438267541501267753);
|
||||
}
|
||||
void car_h_25(double *state, double *unused, double *out_489826982790321982) {
|
||||
h_25(state, unused, out_489826982790321982);
|
||||
void car_h_25(double *state, double *unused, double *out_4244982229226314297) {
|
||||
h_25(state, unused, out_4244982229226314297);
|
||||
}
|
||||
void car_H_25(double *state, double *unused, double *out_3101426217352337927) {
|
||||
H_25(state, unused, out_3101426217352337927);
|
||||
void car_H_25(double *state, double *unused, double *out_1686578216042693128) {
|
||||
H_25(state, unused, out_1686578216042693128);
|
||||
}
|
||||
void car_h_24(double *state, double *unused, double *out_8333585936499166595) {
|
||||
h_24(state, unused, out_8333585936499166595);
|
||||
void car_h_24(double *state, double *unused, double *out_197553727547805858) {
|
||||
h_24(state, unused, out_197553727547805858);
|
||||
}
|
||||
void car_H_24(double *state, double *unused, double *out_8374920500265350521) {
|
||||
H_24(state, unused, out_8374920500265350521);
|
||||
void car_H_24(double *state, double *unused, double *out_6506899720698681391) {
|
||||
H_24(state, unused, out_6506899720698681391);
|
||||
}
|
||||
void car_h_30(double *state, double *unused, double *out_7403112512094201377) {
|
||||
h_30(state, unused, out_7403112512094201377);
|
||||
void car_h_30(double *state, double *unused, double *out_4099462405005659326) {
|
||||
h_30(state, unused, out_4099462405005659326);
|
||||
}
|
||||
void car_H_30(double *state, double *unused, double *out_5619759175859586554) {
|
||||
H_30(state, unused, out_5619759175859586554);
|
||||
void car_H_30(double *state, double *unused, double *out_1815917163185933198) {
|
||||
H_30(state, unused, out_1815917163185933198);
|
||||
}
|
||||
void car_h_26(double *state, double *unused, double *out_6041958293954504594) {
|
||||
h_26(state, unused, out_6041958293954504594);
|
||||
void car_h_26(double *state, double *unused, double *out_9101135672666504971) {
|
||||
h_26(state, unused, out_9101135672666504971);
|
||||
}
|
||||
void car_H_26(double *state, double *unused, double *out_640077101521718297) {
|
||||
H_26(state, unused, out_640077101521718297);
|
||||
void car_H_26(double *state, double *unused, double *out_5428081534916749352) {
|
||||
H_26(state, unused, out_5428081534916749352);
|
||||
}
|
||||
void car_h_27(double *state, double *unused, double *out_8492142189216518783) {
|
||||
h_27(state, unused, out_8492142189216518783);
|
||||
void car_h_27(double *state, double *unused, double *out_756691038434531348) {
|
||||
h_27(state, unused, out_756691038434531348);
|
||||
}
|
||||
void car_H_27(double *state, double *unused, double *out_3444995864059161643) {
|
||||
H_27(state, unused, out_3444995864059161643);
|
||||
void car_H_27(double *state, double *unused, double *out_3990680474986358109) {
|
||||
H_27(state, unused, out_3990680474986358109);
|
||||
}
|
||||
void car_h_29(double *state, double *unused, double *out_610869538462469598) {
|
||||
h_29(state, unused, out_610869538462469598);
|
||||
void car_h_29(double *state, double *unused, double *out_7739969642829208644) {
|
||||
h_29(state, unused, out_7739969642829208644);
|
||||
}
|
||||
void car_H_29(double *state, double *unused, double *out_6129990520173978738) {
|
||||
H_29(state, unused, out_6129990520173978738);
|
||||
void car_H_29(double *state, double *unused, double *out_1305685818871541014) {
|
||||
H_29(state, unused, out_1305685818871541014);
|
||||
}
|
||||
void car_h_28(double *state, double *unused, double *out_3490468921555673138) {
|
||||
h_28(state, unused, out_3490468921555673138);
|
||||
void car_h_28(double *state, double *unused, double *out_186818814467131087) {
|
||||
h_28(state, unused, out_186818814467131087);
|
||||
}
|
||||
void car_H_28(double *state, double *unused, double *out_1047591503104448164) {
|
||||
H_28(state, unused, out_1047591503104448164);
|
||||
void car_H_28(double *state, double *unused, double *out_7660301854784111900) {
|
||||
H_28(state, unused, out_7660301854784111900);
|
||||
}
|
||||
void car_h_31(double *state, double *unused, double *out_1315479088578164838) {
|
||||
h_31(state, unused, out_1315479088578164838);
|
||||
void car_h_31(double *state, double *unused, double *out_3518283027594358144) {
|
||||
h_31(state, unused, out_3518283027594358144);
|
||||
}
|
||||
void car_H_31(double *state, double *unused, double *out_1266285203755069773) {
|
||||
H_31(state, unused, out_1266285203755069773);
|
||||
void car_H_31(double *state, double *unused, double *out_1655932254165732700) {
|
||||
H_31(state, unused, out_1655932254165732700);
|
||||
}
|
||||
void car_predict(double *in_x, double *in_P, double *in_Q, double dt) {
|
||||
predict(in_x, in_P, in_Q, dt);
|
||||
|
||||
@@ -9,27 +9,27 @@ void car_update_27(double *in_x, double *in_P, double *in_z, double *in_R, doubl
|
||||
void car_update_29(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void car_err_fun(double *nom_x, double *delta_x, double *out_6318981254884856825);
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_6625913990707465652);
|
||||
void car_H_mod_fun(double *state, double *out_6152129630444976452);
|
||||
void car_f_fun(double *state, double dt, double *out_6830787204701444163);
|
||||
void car_F_fun(double *state, double dt, double *out_2889206061873137605);
|
||||
void car_h_25(double *state, double *unused, double *out_489826982790321982);
|
||||
void car_H_25(double *state, double *unused, double *out_3101426217352337927);
|
||||
void car_h_24(double *state, double *unused, double *out_8333585936499166595);
|
||||
void car_H_24(double *state, double *unused, double *out_8374920500265350521);
|
||||
void car_h_30(double *state, double *unused, double *out_7403112512094201377);
|
||||
void car_H_30(double *state, double *unused, double *out_5619759175859586554);
|
||||
void car_h_26(double *state, double *unused, double *out_6041958293954504594);
|
||||
void car_H_26(double *state, double *unused, double *out_640077101521718297);
|
||||
void car_h_27(double *state, double *unused, double *out_8492142189216518783);
|
||||
void car_H_27(double *state, double *unused, double *out_3444995864059161643);
|
||||
void car_h_29(double *state, double *unused, double *out_610869538462469598);
|
||||
void car_H_29(double *state, double *unused, double *out_6129990520173978738);
|
||||
void car_h_28(double *state, double *unused, double *out_3490468921555673138);
|
||||
void car_H_28(double *state, double *unused, double *out_1047591503104448164);
|
||||
void car_h_31(double *state, double *unused, double *out_1315479088578164838);
|
||||
void car_H_31(double *state, double *unused, double *out_1266285203755069773);
|
||||
void car_err_fun(double *nom_x, double *delta_x, double *out_5572165619661696722);
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_1924778118840772208);
|
||||
void car_H_mod_fun(double *state, double *out_5209558866032184805);
|
||||
void car_f_fun(double *state, double dt, double *out_8731244167447695934);
|
||||
void car_F_fun(double *state, double dt, double *out_5438267541501267753);
|
||||
void car_h_25(double *state, double *unused, double *out_4244982229226314297);
|
||||
void car_H_25(double *state, double *unused, double *out_1686578216042693128);
|
||||
void car_h_24(double *state, double *unused, double *out_197553727547805858);
|
||||
void car_H_24(double *state, double *unused, double *out_6506899720698681391);
|
||||
void car_h_30(double *state, double *unused, double *out_4099462405005659326);
|
||||
void car_H_30(double *state, double *unused, double *out_1815917163185933198);
|
||||
void car_h_26(double *state, double *unused, double *out_9101135672666504971);
|
||||
void car_H_26(double *state, double *unused, double *out_5428081534916749352);
|
||||
void car_h_27(double *state, double *unused, double *out_756691038434531348);
|
||||
void car_H_27(double *state, double *unused, double *out_3990680474986358109);
|
||||
void car_h_29(double *state, double *unused, double *out_7739969642829208644);
|
||||
void car_H_29(double *state, double *unused, double *out_1305685818871541014);
|
||||
void car_h_28(double *state, double *unused, double *out_186818814467131087);
|
||||
void car_H_28(double *state, double *unused, double *out_7660301854784111900);
|
||||
void car_h_31(double *state, double *unused, double *out_3518283027594358144);
|
||||
void car_H_31(double *state, double *unused, double *out_1655932254165732700);
|
||||
void car_predict(double *in_x, double *in_P, double *in_Q, double dt);
|
||||
void car_set_mass(double x);
|
||||
void car_set_rotational_inertia(double x);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,18 +5,18 @@ void pose_update_4(double *in_x, double *in_P, double *in_z, double *in_R, doubl
|
||||
void pose_update_10(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void pose_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void pose_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void pose_err_fun(double *nom_x, double *delta_x, double *out_5567810526154209734);
|
||||
void pose_inv_err_fun(double *nom_x, double *true_x, double *out_7908491346196944566);
|
||||
void pose_H_mod_fun(double *state, double *out_1058329813454059053);
|
||||
void pose_f_fun(double *state, double dt, double *out_6164632031260569200);
|
||||
void pose_F_fun(double *state, double dt, double *out_2115210801735647822);
|
||||
void pose_h_4(double *state, double *unused, double *out_5340316977089833419);
|
||||
void pose_H_4(double *state, double *unused, double *out_4789751993297899668);
|
||||
void pose_h_10(double *state, double *unused, double *out_4503836725223465124);
|
||||
void pose_H_10(double *state, double *unused, double *out_8320315452592553094);
|
||||
void pose_h_13(double *state, double *unused, double *out_743896610209905980);
|
||||
void pose_H_13(double *state, double *unused, double *out_1577478167965566867);
|
||||
void pose_h_14(double *state, double *unused, double *out_2801914335576561864);
|
||||
void pose_H_14(double *state, double *unused, double *out_826511136958415139);
|
||||
void pose_err_fun(double *nom_x, double *delta_x, double *out_7636423458425794019);
|
||||
void pose_inv_err_fun(double *nom_x, double *true_x, double *out_4233815579108349573);
|
||||
void pose_H_mod_fun(double *state, double *out_534131660440936662);
|
||||
void pose_f_fun(double *state, double dt, double *out_2390572541081456385);
|
||||
void pose_F_fun(double *state, double dt, double *out_1513223696750910511);
|
||||
void pose_h_4(double *state, double *unused, double *out_7543652368314576620);
|
||||
void pose_H_4(double *state, double *unused, double *out_4618386724598144073);
|
||||
void pose_h_10(double *state, double *unused, double *out_1260309873169513594);
|
||||
void pose_H_10(double *state, double *unused, double *out_3724360775848728158);
|
||||
void pose_h_13(double *state, double *unused, double *out_7136718217250129115);
|
||||
void pose_H_13(double *state, double *unused, double *out_7830660549930476874);
|
||||
void pose_h_14(double *state, double *unused, double *out_5010661569828504853);
|
||||
void pose_H_14(double *state, double *unused, double *out_8581627580937628602);
|
||||
void pose_predict(double *in_x, double *in_P, double *in_Q, double dt);
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,6 +9,18 @@ import sys
|
||||
import time
|
||||
import traceback
|
||||
|
||||
_MANAGER_IMPORT_START = time.monotonic()
|
||||
_BOOT_TIMING_LOG_PATH = os.environ.get("SP_BOOT_TIMING_LOG", "/tmp/starpilot_boot_timing.log")
|
||||
|
||||
|
||||
def _append_boot_timing_line(line: str) -> None:
|
||||
try:
|
||||
with open(_BOOT_TIMING_LOG_PATH, "a") as f:
|
||||
f.write(line + "\n")
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
from cereal import car, log
|
||||
import cereal.messaging as messaging
|
||||
import openpilot.system.sentry as sentry
|
||||
@@ -24,6 +36,8 @@ from openpilot.common.swaglog import cloudlog, add_file_handler
|
||||
from openpilot.system.version import get_build_metadata, terms_version, training_version
|
||||
from openpilot.system.hardware.hw import Paths
|
||||
|
||||
_MANAGER_CORE_IMPORT_DONE = time.monotonic()
|
||||
|
||||
from openpilot.starpilot.common.starpilot_functions import starpilot_boot_functions, install_starpilot, uninstall_starpilot
|
||||
from openpilot.starpilot.common.starpilot_variables import (
|
||||
LEGACY_STARPILOT_PARAM_RENAMES,
|
||||
@@ -31,6 +45,16 @@ from openpilot.starpilot.common.starpilot_variables import (
|
||||
get_starpilot_toggles,
|
||||
)
|
||||
|
||||
_MANAGER_IMPORT_DONE = time.monotonic()
|
||||
_manager_import_timing_line = (
|
||||
"SP_BOOT_TIMING manager_import "
|
||||
f"core={_MANAGER_CORE_IMPORT_DONE - _MANAGER_IMPORT_START:.3f}s "
|
||||
f"starpilot={_MANAGER_IMPORT_DONE - _MANAGER_CORE_IMPORT_DONE:.3f}s "
|
||||
f"total={_MANAGER_IMPORT_DONE - _MANAGER_IMPORT_START:.3f}s"
|
||||
)
|
||||
print(_manager_import_timing_line, flush=True)
|
||||
_append_boot_timing_line(_manager_import_timing_line)
|
||||
|
||||
|
||||
LEGACY_BOLT_FP_MIGRATION_FLAG = Path("/data") / "legacy_bolt_fp_migration_v1"
|
||||
STARPILOT_DEFAULTS_PARITY_MIGRATION_FLAG = Path("/data") / "starpilot_defaults_parity_v1"
|
||||
@@ -50,6 +74,15 @@ STARPILOT_STATS_DROP_KEYS = {"CurrentMonthsKilometers", "ResetStats"}
|
||||
STARPILOT_STATS_MAX_KEYS = {"LongestDistanceWithoutOverride", "MaxAcceleration"}
|
||||
|
||||
|
||||
def _log_boot_timing(scope: str, label: str, start: float, previous: float | None = None) -> float:
|
||||
now = time.monotonic()
|
||||
base = previous if previous is not None else start
|
||||
line = f"SP_BOOT_TIMING {scope} {label} +{now - base:.3f}s total={now - start:.3f}s"
|
||||
_append_boot_timing_line(line)
|
||||
cloudlog.warning(line)
|
||||
return now
|
||||
|
||||
|
||||
def _to_text(value):
|
||||
if value is None:
|
||||
return None
|
||||
@@ -727,18 +760,25 @@ def migrate_legacy_experimental_longitudinal(params: Params, params_cache: Param
|
||||
|
||||
|
||||
def manager_init() -> None:
|
||||
manager_init_start = time.monotonic()
|
||||
last_timing = _log_boot_timing("manager_init", "start", manager_init_start, manager_init_start)
|
||||
|
||||
save_bootlog()
|
||||
last_timing = _log_boot_timing("manager_init", "save_bootlog", manager_init_start, last_timing)
|
||||
|
||||
build_metadata = get_build_metadata()
|
||||
last_timing = _log_boot_timing("manager_init", "build_metadata", manager_init_start, last_timing)
|
||||
|
||||
params = Params()
|
||||
cache_params_path = Paths.params_cache_root()
|
||||
migrate_legacy_starpilot_params_cache(params, Paths.legacy_params_cache_root(), cache_params_path)
|
||||
params_cache = Params(cache_params_path, return_defaults=True)
|
||||
last_timing = _log_boot_timing("manager_init", "params_cache", manager_init_start, last_timing)
|
||||
|
||||
# Legacy FrogPilot params are unknown to the renamed schema and would be
|
||||
# deleted by clear_all() if we do not migrate them first.
|
||||
migrate_starpilot_param_renames(params, params_cache)
|
||||
last_timing = _log_boot_timing("manager_init", "param_renames", manager_init_start, last_timing)
|
||||
|
||||
params.clear_all(ParamKeyFlag.CLEAR_ON_MANAGER_START)
|
||||
params.clear_all(ParamKeyFlag.CLEAR_ON_ONROAD_TRANSITION)
|
||||
@@ -746,8 +786,10 @@ def manager_init() -> None:
|
||||
params.clear_all(ParamKeyFlag.CLEAR_ON_IGNITION_ON)
|
||||
if build_metadata.release_channel:
|
||||
params.clear_all(ParamKeyFlag.DEVELOPMENT_ONLY)
|
||||
last_timing = _log_boot_timing("manager_init", "clear_params", manager_init_start, last_timing)
|
||||
|
||||
migrate_starpilot_pc_root()
|
||||
last_timing = _log_boot_timing("manager_init", "pc_root_migration", manager_init_start, last_timing)
|
||||
|
||||
if params.get_bool("RecordFrontLock"):
|
||||
params.put_bool("RecordFront", True)
|
||||
@@ -765,6 +807,7 @@ def manager_init() -> None:
|
||||
migrate_disable_humanlike_defaults(params, params_cache)
|
||||
migrate_cluster_offset_default(params, params_cache)
|
||||
migrate_prioritize_smooth_following_default(params, params_cache)
|
||||
last_timing = _log_boot_timing("manager_init", "starpilot_migrations", manager_init_start, last_timing)
|
||||
|
||||
# set unset params to their default value
|
||||
for k in params.all_keys():
|
||||
@@ -775,6 +818,7 @@ def manager_init() -> None:
|
||||
params.put(k, cached_value)
|
||||
else:
|
||||
params_cache.put(k, current_value)
|
||||
last_timing = _log_boot_timing("manager_init", "params_defaults_cache_sync", manager_init_start, last_timing)
|
||||
|
||||
# Create folders needed for msgq
|
||||
try:
|
||||
@@ -783,6 +827,7 @@ def manager_init() -> None:
|
||||
pass
|
||||
except PermissionError:
|
||||
print(f"WARNING: failed to make {Paths.shm_path()}")
|
||||
last_timing = _log_boot_timing("manager_init", "shm_path", manager_init_start, last_timing)
|
||||
|
||||
# set params
|
||||
serial = HARDWARE.get_serial()
|
||||
@@ -799,6 +844,7 @@ def manager_init() -> None:
|
||||
|
||||
# Branch migration: rename legacy Bolt fingerprint persisted in CarParams.
|
||||
migrate_legacy_bolt_fingerprint(params)
|
||||
last_timing = _log_boot_timing("manager_init", "version_params", manager_init_start, last_timing)
|
||||
|
||||
# set dongle id
|
||||
reg_res = register(show_spinner=True)
|
||||
@@ -806,6 +852,7 @@ def manager_init() -> None:
|
||||
dongle_id = reg_res
|
||||
else:
|
||||
raise Exception(f"Registration failed for device {serial}")
|
||||
last_timing = _log_boot_timing("manager_init", "register", manager_init_start, last_timing)
|
||||
os.environ['DONGLE_ID'] = dongle_id # Needed for swaglog
|
||||
os.environ['GIT_ORIGIN'] = build_metadata.openpilot.git_normalized_origin # Needed for swaglog
|
||||
os.environ['GIT_BRANCH'] = build_metadata.channel # Needed for swaglog
|
||||
@@ -823,14 +870,18 @@ def manager_init() -> None:
|
||||
commit=build_metadata.openpilot.git_commit,
|
||||
dirty=build_metadata.openpilot.is_dirty,
|
||||
device=HARDWARE.get_device_type())
|
||||
last_timing = _log_boot_timing("manager_init", "logging_ready", manager_init_start, last_timing)
|
||||
|
||||
# preimport all processes
|
||||
for p in managed_processes.values():
|
||||
p.prepare()
|
||||
last_timing = _log_boot_timing("manager_init", "preimport_processes", manager_init_start, last_timing)
|
||||
|
||||
# StarPilot variables
|
||||
install_starpilot(build_metadata, params)
|
||||
last_timing = _log_boot_timing("manager_init", "install_starpilot", manager_init_start, last_timing)
|
||||
starpilot_boot_functions(build_metadata, params)
|
||||
_log_boot_timing("manager_init", "starpilot_boot_functions", manager_init_start, last_timing)
|
||||
|
||||
|
||||
def manager_cleanup() -> None:
|
||||
@@ -846,11 +897,14 @@ def manager_cleanup() -> None:
|
||||
|
||||
|
||||
def manager_thread() -> None:
|
||||
manager_thread_start = time.monotonic()
|
||||
last_timing = _log_boot_timing("manager_thread", "start", manager_thread_start, manager_thread_start)
|
||||
cloudlog.bind(daemon="manager")
|
||||
cloudlog.info("manager start")
|
||||
cloudlog.info({"environ": os.environ})
|
||||
|
||||
params = Params()
|
||||
last_timing = _log_boot_timing("manager_thread", "params", manager_thread_start, last_timing)
|
||||
|
||||
ignore: list[str] = []
|
||||
if params.get("DongleId") in (None, UNREGISTERED_DONGLE_ID):
|
||||
@@ -858,12 +912,17 @@ def manager_thread() -> None:
|
||||
if os.getenv("NOBOARD") is not None:
|
||||
ignore.append("pandad")
|
||||
ignore += [x for x in os.getenv("BLOCK", "").split(",") if len(x) > 0]
|
||||
last_timing = _log_boot_timing("manager_thread", "ignore_list", manager_thread_start, last_timing)
|
||||
|
||||
sm = messaging.SubMaster(['deviceState', 'carParams', 'pandaStates'], poll='deviceState')
|
||||
pm = messaging.PubMaster(['managerState'])
|
||||
last_timing = _log_boot_timing("manager_thread", "messaging", manager_thread_start, last_timing)
|
||||
|
||||
write_onroad_params(False, params)
|
||||
ensure_running(managed_processes.values(), False, params=params, CP=sm['carParams'], not_run=ignore, starpilot_toggles=get_starpilot_toggles())
|
||||
initial_toggles = get_starpilot_toggles()
|
||||
last_timing = _log_boot_timing("manager_thread", "initial_toggles", manager_thread_start, last_timing)
|
||||
ensure_running(managed_processes.values(), False, params=params, CP=sm['carParams'], not_run=ignore, starpilot_toggles=initial_toggles)
|
||||
last_timing = _log_boot_timing("manager_thread", "initial_ensure_running", manager_thread_start, last_timing)
|
||||
|
||||
started_prev = False
|
||||
ignition_prev = False
|
||||
@@ -877,6 +936,8 @@ def manager_thread() -> None:
|
||||
params_memory = Params(memory=True)
|
||||
|
||||
starpilot_toggles = get_starpilot_toggles()
|
||||
last_timing = _log_boot_timing("manager_thread", "loop_toggles", manager_thread_start, last_timing)
|
||||
_log_boot_timing("manager_thread", "loop_ready", manager_thread_start, last_timing)
|
||||
|
||||
while True:
|
||||
sm.update(1000)
|
||||
|
||||
@@ -628,7 +628,17 @@ class PythonProcess(ManagerProcess):
|
||||
def prepare(self) -> None:
|
||||
if self.enabled:
|
||||
cloudlog.info(f"preimporting {self.module}")
|
||||
importlib.import_module(self.module)
|
||||
start = time.monotonic()
|
||||
try:
|
||||
importlib.import_module(self.module)
|
||||
finally:
|
||||
line = f"SP_BOOT_TIMING preimport {self.name} module={self.module} +{time.monotonic() - start:.3f}s"
|
||||
try:
|
||||
with open(os.environ.get("SP_BOOT_TIMING_LOG", "/tmp/starpilot_boot_timing.log"), "a") as f:
|
||||
f.write(line + "\n")
|
||||
except OSError:
|
||||
pass
|
||||
cloudlog.warning(line)
|
||||
|
||||
def start(self) -> None:
|
||||
# In case we only tried a non blocking stop we need to stop it before restarting
|
||||
|
||||
Reference in New Issue
Block a user