Compare commits

..

1 Commits

Author SHA1 Message Date
DevTekVE 7354dd53a9 Enhance the LFS sync script in release pipeline
This commit significantly extends the `sync-lfs.sh` script used in the release process. Rather than just switching LFS configurations and pulling/pushing, it now incorporates operations like creating a clone for branch, resetting changes, trapping exit signals and cleaning up.

This improvement enhances the reliability of synchronizing Large File Storage (LFS) objects between repositories by incorporating additional safety checks and informative echo statements. The shell script now also handles situations such as exiting in the midway more gracefully. This enhanced script is expected to provide a smoother and more reliable release process.
2024-09-01 13:56:11 +02:00
24 changed files with 111 additions and 159 deletions
-2
View File
@@ -32,8 +32,6 @@ enum ModelGeneration {
three @3;
four @4;
five @5;
six @6;
seven @7;
}
struct ControlsStateSP @0x81c2f05a394cf4af {
-3
View File
@@ -871,7 +871,6 @@ struct DrivingModelData {
frameId @0 :UInt32;
frameIdExtra @1 :UInt32;
frameDropPerc @6 :Float32;
modelExecutionTime @7 :Float32;
action @2 :ModelDataV2.Action;
@@ -1011,8 +1010,6 @@ struct ModelDataV2 {
brake3MetersPerSecondSquaredProbs @4 :List(Float32);
brake4MetersPerSecondSquaredProbs @5 :List(Float32);
brake5MetersPerSecondSquaredProbs @6 :List(Float32);
gasPressProbs @7 :List(Float32);
brakePressProbs @8 :List(Float32);
}
struct Pose {
-1
View File
@@ -239,7 +239,6 @@ std::unordered_map<std::string, uint32_t> keys = {
{"DrivingModelGeneration", PERSISTENT},
{"DrivingModelMetadataText", PERSISTENT},
{"DrivingModelName", PERSISTENT},
{"DrivingModelSelectorVersion", CLEAR_ON_MANAGER_START},
{"DrivingModelText", PERSISTENT},
{"DrivingModelUrl", PERSISTENT},
{"DynamicExperimentalControl", PERSISTENT | BACKUP},
+50 -6
View File
@@ -1,7 +1,51 @@
#!/usr/bin/env bash
mv .lfsconfig .lfsconfig.bak
mv .lfsconfig-comma .lfsconfig
git lfs fetch --all; git lfs pull
mv .lfsconfig .lfsconfig-comma
mv .lfsconfig.bak .lfsconfig
git lfs fetch --all; git lfs push --all origin
# How to use: run from the root of the openpilot repository with the following command: ./release/ci/sync-lfs.sh
# Set variables
export their_repo="https://github.com/commaai/openpilot.git"
export their_branch="master"
export current_branch=$(git rev-parse --abbrev-ref HEAD)
export our_lfs_url=${LFS_URL:-"https://gitlab.com/sunnypilot/public/sunnypilot-lfs.git/info/lfs"}
export our_lfs_push_url=${LFS_PUSH_URL:-"ssh://git@gitlab.com/sunnypilot/public/sunnypilot-lfs.git"}
echo "Syncing LFS objects from $their_repo:$their_branch to $our_lfs_url"
echo "Pushing LFS objects to $our_lfs_push_url"
# Function to reset to the current branch and perform a hard reset
function reset_hard {
exit_status=$?
echo "Resetting to the current branch and performing a hard reset..."
git reset --hard
git switch $current_branch
exit $exit_status
}
# Set trap to ensure reset on exit
trap reset_hard SIGINT SIGTERM EXIT
# Add remote if it does not exist
git remote add comma $their_repo 2>/dev/null || echo "Remote 'comma' already exists."
# Fetch the specified branch from the remote
git fetch comma $their_branch
# Clean up old branch if it exists
git branch -D ${their_branch}-upstream 2>/dev/null || echo "No old branch to clean up."
# Checkout new branch based on the upstream branch
git checkout -b ${their_branch}-upstream comma/$their_branch
# Write the .lfsconfig directly
cat <<EOL > .lfsconfig
[lfs]
url = $our_lfs_url
pushurl = $our_lfs_push_url
locksverify = false
EOL
# Fetch all LFS objects and push them to the specified pushurl
git lfs fetch --all
git lfs push --all $our_lfs_push_url
git restore .lfsconfig
# Switch back to the current branch (handled by trap)
+2 -2
View File
@@ -255,8 +255,8 @@ class RadarD:
self.radar_state.radarErrors = list(radar_errors)
self.radar_state.carStateMonoTime = sm.logMonoTime['carState']
if len(sm['modelV2'].velocity.x):
model_v_ego = sm['modelV2'].velocity.x[0]
if len(sm['modelV2'].temporalPose.trans):
model_v_ego = sm['modelV2'].temporalPose.trans[0]
else:
model_v_ego = self.v_ego
leads_v3 = sm['modelV2'].leadsV3
+9 -10
View File
@@ -76,14 +76,13 @@ class Plan:
class Meta:
ENGAGED = slice(0, 1)
# next 2, 4, 6, 8, 10 seconds
GAS_DISENGAGE = slice(1, 31, 6)
BRAKE_DISENGAGE = slice(2, 31, 6)
STEER_OVERRIDE = slice(3, 31, 6)
HARD_BRAKE_3 = slice(4, 31, 6)
HARD_BRAKE_4 = slice(5, 31, 6)
HARD_BRAKE_5 = slice(6, 31, 6)
GAS_DISENGAGE = slice(1, 36, 7)
BRAKE_DISENGAGE = slice(2, 36, 7)
STEER_OVERRIDE = slice(3, 36, 7)
HARD_BRAKE_3 = slice(4, 36, 7)
HARD_BRAKE_4 = slice(5, 36, 7)
HARD_BRAKE_5 = slice(6, 36, 7)
GAS_PRESS = slice(7, 36, 7)
# next 0, 2, 4, 6, 8, 10 seconds
GAS_PRESS = slice(31, 55, 4)
BRAKE_PRESS = slice(32, 55, 4)
LEFT_BLINKER = slice(33, 55, 4)
RIGHT_BLINKER = slice(34, 55, 4)
LEFT_BLINKER = slice(36, 48, 2)
RIGHT_BLINKER = slice(37, 48, 2)
+2 -39
View File
@@ -1,10 +1,9 @@
from enum import IntFlag
import os, sys
import os
from cereal import custom
from openpilot.common.params import Params
DRIVING_MODEL_SELECTOR_VERSION = 6
SIMULATION = "SIMULATION" in os.environ
ModelGeneration = custom.ModelGeneration
@@ -34,10 +33,6 @@ class ModelCapabilities(IntFlag):
In V2, 'prev_desired_curv' (no plural) is used as the input for the same 'desired_curvature' output.
"""
PlanVelocity = 2 ** 5
ModelOutputSlicesV1 = 2 ** 6
class CustomModelMetadata:
def __init__(self, params=None, init_only=False) -> None:
@@ -50,19 +45,13 @@ class CustomModelMetadata:
self.capabilities: ModelCapabilities = self.get_model_capabilities()
self.valid: bool = self.params.get_bool("CustomDrivingModel") and not SIMULATION and \
self.capabilities != ModelCapabilities.Default
self.initialized = False
def read_model_generation_param(self) -> ModelGeneration:
return int(self.params.get('DrivingModelGeneration') or ModelGeneration.default)
def get_model_capabilities(self) -> ModelCapabilities:
"""Returns the model capabilities for a given generation."""
if self.generation == ModelGeneration.seven:
return ModelCapabilities.DesiredCurvatureV2 | ModelCapabilities.PlanVelocity | \
ModelCapabilities.ModelOutputSlicesV1
elif self.generation == ModelGeneration.six:
return ModelCapabilities.DesiredCurvatureV2 | ModelCapabilities.PlanVelocity
elif self.generation == ModelGeneration.five:
if self.generation == ModelGeneration.five:
return ModelCapabilities.DesiredCurvatureV2
elif self.generation == ModelGeneration.four:
return ModelCapabilities.DesiredCurvatureV2
@@ -75,29 +64,3 @@ class CustomModelMetadata:
else:
# Default model is meant to represent the capabilities of the prebuilt model
return ModelCapabilities.Default
def custom_meta(self):
if not self.initialized:
if self.capabilities & ModelCapabilities.ModelOutputSlicesV1:
class Meta:
ENGAGED = slice(0, 1)
# next 2, 4, 6, 8, 10 seconds
GAS_DISENGAGE = slice(1, 41, 8)
BRAKE_DISENGAGE = slice(2, 41, 8)
STEER_OVERRIDE = slice(3, 41, 8)
HARD_BRAKE_3 = slice(4, 41, 8)
HARD_BRAKE_4 = slice(5, 41, 8)
HARD_BRAKE_5 = slice(6, 41, 8)
GAS_PRESS = slice(7, 41, 8)
BRAKE_PRESS = slice(8, 41, 8)
# next 0, 2, 4, 6, 8, 10 seconds
LEFT_BLINKER = slice(41, 53, 2)
RIGHT_BLINKER = slice(42, 53, 2)
module = 'openpilot.selfdrive.modeld.constants'
if module in sys.modules:
sys.modules[module].Meta = Meta
else:
raise ImportError(f"The module '{module}' is not imported yet or does not exist.")
self.initialized = True
+12 -12
View File
@@ -14,7 +14,7 @@ from openpilot.common.swaglog import cloudlog
from openpilot.common.params import Params
from openpilot.common.realtime import set_realtime_priority
from openpilot.selfdrive.modeld.runners import ModelRunner, Runtime
from openpilot.selfdrive.modeld.parse_model_outputs import sigmoid
from openpilot.selfdrive.modeld.models.commonmodel_pyx import sigmoid
CALIB_LEN = 3
REG_SCALE = 0.25
@@ -88,15 +88,15 @@ def fill_driver_state(msg, ds_result: DriverStateResult):
msg.faceOrientationStd = [math.exp(x) for x in ds_result.face_orientation_std]
msg.facePosition = [x * REG_SCALE for x in ds_result.face_position[:2]]
msg.facePositionStd = [math.exp(x) for x in ds_result.face_position_std[:2]]
msg.faceProb = float(sigmoid(ds_result.face_prob))
msg.leftEyeProb = float(sigmoid(ds_result.left_eye_prob))
msg.rightEyeProb = float(sigmoid(ds_result.right_eye_prob))
msg.leftBlinkProb = float(sigmoid(ds_result.left_blink_prob))
msg.rightBlinkProb = float(sigmoid(ds_result.right_blink_prob))
msg.sunglassesProb = float(sigmoid(ds_result.sunglasses_prob))
msg.occludedProb = float(sigmoid(ds_result.occluded_prob))
msg.readyProb = [float(sigmoid(x)) for x in ds_result.ready_prob]
msg.notReadyProb = [float(sigmoid(x)) for x in ds_result.not_ready_prob]
msg.faceProb = sigmoid(ds_result.face_prob)
msg.leftEyeProb = sigmoid(ds_result.left_eye_prob)
msg.rightEyeProb = sigmoid(ds_result.right_eye_prob)
msg.leftBlinkProb = sigmoid(ds_result.left_blink_prob)
msg.rightBlinkProb = sigmoid(ds_result.right_blink_prob)
msg.sunglassesProb = sigmoid(ds_result.sunglasses_prob)
msg.occludedProb = sigmoid(ds_result.occluded_prob)
msg.readyProb = [sigmoid(x) for x in ds_result.ready_prob]
msg.notReadyProb = [sigmoid(x) for x in ds_result.not_ready_prob]
def get_driverstate_packet(model_output: np.ndarray, frame_id: int, location_ts: int, execution_time: float, dsp_execution_time: float):
model_result = ctypes.cast(model_output.ctypes.data, ctypes.POINTER(DMonitoringModelResult)).contents
@@ -105,8 +105,8 @@ def get_driverstate_packet(model_output: np.ndarray, frame_id: int, location_ts:
ds.frameId = frame_id
ds.modelExecutionTime = execution_time
ds.dspExecutionTime = dsp_execution_time
ds.poorVisionProb = float(sigmoid(model_result.poor_vision_prob))
ds.wheelOnRightProb = float(sigmoid(model_result.wheel_on_right_prob))
ds.poorVisionProb = sigmoid(model_result.poor_vision_prob)
ds.wheelOnRightProb = sigmoid(model_result.wheel_on_right_prob)
ds.rawPredictions = model_output.tobytes() if SEND_RAW_PRED else b''
fill_driver_state(ds.leftDriverData, model_result.driver_state_lhd)
fill_driver_state(ds.rightDriverData, model_result.driver_state_rhd)
+8 -24
View File
@@ -3,7 +3,7 @@ import capnp
import numpy as np
from cereal import log
from openpilot.selfdrive.modeld.constants import ModelConstants, Plan, Meta
from openpilot.selfdrive.modeld.custom_model_metadata import CustomModelMetadata, ModelCapabilities
from openpilot.selfdrive.modeld.custom_model_metadata import ModelCapabilities
SEND_RAW_PRED = os.getenv('SEND_RAW_PRED')
@@ -55,8 +55,7 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D
vipc_frame_id: int, vipc_frame_id_extra: int, frame_id: int, frame_drop: float,
timestamp_eof: int, timestamp_llk: int, model_execution_time: float,
nav_enabled: bool, valid: bool,
custom_model: CustomModelMetadata) -> None:
custom_model.custom_meta()
custom_model_valid: bool, custom_model_capabilities: ModelCapabilities) -> None:
frame_age = frame_id - vipc_frame_id if frame_id > vipc_frame_id else 0
frame_drop_perc = frame_drop * 100
extended_msg.valid = valid
@@ -67,10 +66,9 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D
driving_model_data.frameId = vipc_frame_id
driving_model_data.frameIdExtra = vipc_frame_id_extra
driving_model_data.frameDropPerc = frame_drop_perc
driving_model_data.modelExecutionTime = model_execution_time
action = driving_model_data.action
model_use_lateral_planner = custom_model.valid and custom_model.capabilities & ModelCapabilities.LateralPlannerSolution
model_use_lateral_planner = custom_model_valid and custom_model_capabilities & ModelCapabilities.LateralPlannerSolution
if not model_use_lateral_planner:
action.desiredCurvature = float(net_output_data['desired_curvature'][0,0])
@@ -80,7 +78,7 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D
modelV2.frameAge = frame_age
modelV2.frameDropPerc = frame_drop_perc
modelV2.timestampEof = timestamp_eof
model_use_nav = custom_model.valid and custom_model.capabilities & ModelCapabilities.NoO
model_use_nav = custom_model_valid and custom_model_capabilities & ModelCapabilities.NoO
if model_use_nav:
modelV2.locationMonoTimeDEPRECATED = timestamp_llk
modelV2.modelExecutionTime = model_execution_time
@@ -174,8 +172,6 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D
disengage_predictions.brake3MetersPerSecondSquaredProbs = net_output_data['meta'][0,Meta.HARD_BRAKE_3].tolist()
disengage_predictions.brake4MetersPerSecondSquaredProbs = net_output_data['meta'][0,Meta.HARD_BRAKE_4].tolist()
disengage_predictions.brake5MetersPerSecondSquaredProbs = net_output_data['meta'][0,Meta.HARD_BRAKE_5].tolist()
disengage_predictions.gasPressProbs = net_output_data['meta'][0,Meta.GAS_PRESS].tolist()
disengage_predictions.brakePressProbs = net_output_data['meta'][0,Meta.BRAKE_PRESS].tolist()
publish_state.prev_brake_5ms2_probs[:-1] = publish_state.prev_brake_5ms2_probs[1:]
publish_state.prev_brake_5ms2_probs[-1] = net_output_data['meta'][0,Meta.HARD_BRAKE_5][0]
@@ -187,22 +183,10 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D
# temporal pose
temporal_pose = modelV2.temporalPose
if custom_model.valid:
if custom_model.capabilities & ModelCapabilities.PlanVelocity:
temporal_pose.trans = net_output_data['plan'][0,0,Plan.VELOCITY].tolist()
temporal_pose.transStd = net_output_data['plan_stds'][0,0,Plan.VELOCITY].tolist()
temporal_pose.rot = net_output_data['plan'][0,0,Plan.ORIENTATION_RATE].tolist()
temporal_pose.rotStd = net_output_data['plan_stds'][0,0,Plan.ORIENTATION_RATE].tolist()
else:
temporal_pose.trans = net_output_data['sim_pose'][0,:3].tolist()
temporal_pose.transStd = net_output_data['sim_pose_stds'][0,:3].tolist()
temporal_pose.rot = net_output_data['sim_pose'][0,3:].tolist()
temporal_pose.rotStd = net_output_data['sim_pose_stds'][0,3:].tolist()
else:
temporal_pose.trans = net_output_data['plan'][0,0,Plan.VELOCITY].tolist()
temporal_pose.transStd = net_output_data['plan_stds'][0,0,Plan.VELOCITY].tolist()
temporal_pose.rot = net_output_data['plan'][0,0,Plan.ORIENTATION_RATE].tolist()
temporal_pose.rotStd = net_output_data['plan_stds'][0,0,Plan.ORIENTATION_RATE].tolist()
temporal_pose.trans = net_output_data['sim_pose'][0,:3].tolist()
temporal_pose.transStd = net_output_data['sim_pose_stds'][0,:3].tolist()
temporal_pose.rot = net_output_data['sim_pose'][0,3:].tolist()
temporal_pose.rotStd = net_output_data['sim_pose_stds'][0,3:].tolist()
# confidence
if vipc_frame_id % (2*ModelConstants.MODEL_FREQ) == 0:
+1 -1
View File
@@ -377,7 +377,7 @@ def main(demo=False):
posenet_send = messaging.new_message('cameraOdometry')
fill_model_msg(drivingdata_send, modelv2_send, model_output, publish_state, meta_main.frame_id, meta_extra.frame_id, frame_id,
frame_drop_ratio, meta_main.timestamp_eof, timestamp_llk, model_execution_time, nav_enabled, live_calib_seen,
custom_model_metadata)
custom_model_metadata.valid, custom_model_metadata.capabilities)
if not (custom_model_metadata.valid and custom_model_metadata.capabilities & ModelCapabilities.LateralPlannerSolution):
desire_state = modelv2_send.modelV2.meta.desireState
+5 -1
View File
@@ -47,4 +47,8 @@ ModelFrame::~ModelFrame() {
CL_CHECK(clReleaseMemObject(u_cl));
CL_CHECK(clReleaseMemObject(y_cl));
CL_CHECK(clReleaseCommandQueue(q));
}
}
float sigmoid(float input) {
return 1 / (1 + expf(-input));
}
+2
View File
@@ -16,6 +16,8 @@
#include "selfdrive/modeld/transforms/loadyuv.h"
#include "selfdrive/modeld/transforms/transform.h"
float sigmoid(float input);
class ModelFrame {
public:
ModelFrame(cl_device_id device_id, cl_context context);
+2
View File
@@ -12,6 +12,8 @@ cdef extern from "common/clutil.h":
cl_context cl_create_context(cl_device_id)
cdef extern from "selfdrive/modeld/models/commonmodel.h":
float sigmoid(float)
cppclass ModelFrame:
int buf_size
ModelFrame(cl_device_id, cl_context)
+3 -1
View File
@@ -8,8 +8,10 @@ from libc.string cimport memcpy
from msgq.visionipc.visionipc cimport cl_mem
from msgq.visionipc.visionipc_pyx cimport VisionBuf, CLContext as BaseCLContext
from .commonmodel cimport CL_DEVICE_TYPE_DEFAULT, cl_get_device_id, cl_create_context
from .commonmodel cimport mat3, ModelFrame as cppModelFrame
from .commonmodel cimport mat3, sigmoid as cppSigmoid, ModelFrame as cppModelFrame
def sigmoid(x):
return cppSigmoid(x)
cdef class CLContext(BaseCLContext):
def __cinit__(self):
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0dab94dc94db5e372f56d26f9dda98bd31fd76e4c16027da611132263848d0c1
size 62486347
oid sha256:39786068cae1ed8c0dc34ef80c281dfcc67ed18a50e06b90765c49bcfdbf7db4
size 51453312
+5 -10
View File
@@ -1,19 +1,15 @@
import numpy as np
from openpilot.selfdrive.modeld.constants import ModelConstants
def safe_exp(x, out=None):
# -11 is around 10**14, more causes float16 overflow
return np.exp(np.clip(x, -np.inf, 11), out=out)
def sigmoid(x):
return 1. / (1. + safe_exp(-x))
return 1. / (1. + np.exp(-x))
def softmax(x, axis=-1):
x -= np.max(x, axis=axis, keepdims=True)
if x.dtype == np.float32 or x.dtype == np.float64:
safe_exp(x, out=x)
np.exp(x, out=x)
else:
x = safe_exp(x)
x = np.exp(x)
x /= np.sum(x, axis=axis, keepdims=True)
return x
@@ -48,7 +44,7 @@ class Parser:
n_values = (raw.shape[2] - out_N)//2
pred_mu = raw[:,:,:n_values]
pred_std = safe_exp(raw[:,:,n_values: 2*n_values])
pred_std = np.exp(raw[:,:,n_values: 2*n_values])
if in_N > 1:
weights = np.zeros((raw.shape[0], in_N, out_N), dtype=raw.dtype)
@@ -91,8 +87,7 @@ class Parser:
self.parse_mdn('road_edges', outs, in_N=0, out_N=0, out_shape=(ModelConstants.NUM_ROAD_EDGES,ModelConstants.IDX_N,ModelConstants.LANE_LINES_WIDTH))
self.parse_mdn('pose', outs, in_N=0, out_N=0, out_shape=(ModelConstants.POSE_WIDTH,))
self.parse_mdn('road_transform', outs, in_N=0, out_N=0, out_shape=(ModelConstants.POSE_WIDTH,))
if 'sim_pose' in outs:
self.parse_mdn('sim_pose', outs, in_N=0, out_N=0, out_shape=(ModelConstants.POSE_WIDTH,))
self.parse_mdn('sim_pose', outs, in_N=0, out_N=0, out_shape=(ModelConstants.POSE_WIDTH,))
self.parse_mdn('wide_from_device_euler', outs, in_N=0, out_N=0, out_shape=(ModelConstants.WIDE_FROM_DEVICE_WIDTH,))
self.parse_mdn('lead', outs, in_N=ModelConstants.LEAD_MHP_N, out_N=ModelConstants.LEAD_MHP_SELECTION,
out_shape=(ModelConstants.LEAD_TRAJ_LEN,ModelConstants.LEAD_WIDTH))
+2 -8
View File
@@ -14,12 +14,8 @@ def attributeproto_fp16_to_fp32(attr):
attr.data_type = 1
attr.raw_data = float32_list.astype(np.float32).tobytes()
def convert_fp16_to_fp32(onnx_path_or_bytes):
if isinstance(onnx_path_or_bytes, bytes):
model = onnx.load_from_string(onnx_path_or_bytes)
elif isinstance(onnx_path_or_bytes, str):
model = onnx.load(onnx_path_or_bytes)
def convert_fp16_to_fp32(path):
model = onnx.load(path)
for i in model.graph.initializer:
if i.data_type == 10:
attributeproto_fp16_to_fp32(i)
@@ -27,8 +23,6 @@ def convert_fp16_to_fp32(onnx_path_or_bytes):
if i.type.tensor_type.elem_type == 10:
i.type.tensor_type.elem_type = 1
for i in model.graph.node:
if i.op_type == 'Cast' and i.attribute[0].i == 10:
i.attribute[0].i = 1
for a in i.attribute:
if hasattr(a, 't'):
if a.t.data_type == 10:
@@ -130,7 +130,6 @@ if __name__ == "__main__":
ignore = [
'logMonoTime',
'drivingModelData.frameDropPerc',
'drivingModelData.modelExecutionTime',
'modelV2.frameDropPerc',
'modelV2.modelExecutionTime',
'driverStateV2.modelExecutionTime',
@@ -1 +1 @@
9d4d653d8cc361fe2ba53f74fd8fcfe1f1d559ed
01e8432830805165527d1dbadd5f009d19430b39
@@ -566,7 +566,7 @@ CONFIGS = [
proc_name="modeld",
pubs=["deviceState", "roadCameraState", "wideRoadCameraState", "liveCalibration", "driverMonitoringState"],
subs=["modelV2", "drivingModelData", "cameraOdometry"],
ignore=["logMonoTime", "modelV2.frameDropPerc", "modelV2.modelExecutionTime", "drivingModelData.frameDropPerc", "drivingModelData.modelExecutionTime"],
ignore=["logMonoTime", "modelV2.frameDropPerc", "modelV2.modelExecutionTime"],
should_recv_callback=ModeldCameraSyncRcvCallback(),
tolerance=NUMPY_TOLERANCE,
processing_time=0.020,
@@ -177,18 +177,5 @@ std::vector<Model> ModelsFetcher::getModelsFromURL(const QString&url) {
}
std::vector<Model> ModelsFetcher::getModelsFromURL() {
return getModelsFromURL("https://docs.sunnypilot.ai/driving_models.json");
}
std::vector<Model> ModelsFetcher::getCompatibleModels(const QString &selector_version) {
std::vector<Model> allModels = getModelsFromURL();
std::vector<Model> compatibleModels;
for (const auto &model : allModels) {
if (model.isCompatible(selector_version)) {
compatibleModels.push_back(model);
}
}
return compatibleModels;
return getModelsFromURL("https://docs.sunnypilot.ai/models_v5.json");
}
@@ -34,7 +34,6 @@ Last updated: July 29, 2024
#include <QDir>
#include <QJsonObject>
#include <QTimer>
#include <QVersionNumber>
#include "common/swaglog.h"
#include "common/util.h"
@@ -87,8 +86,6 @@ public:
index = json["index"].toString();
environment = json["environment"].toString();
generation = json["generation"].toString();
minDrivingModelSelectorVersion = json["minimum_selector_version"].toString();
}
// Method to convert model back to QJsonObject, if needed
@@ -120,9 +117,6 @@ public:
json["index"] = index;
json["environment"] = environment;
json["generation"] = generation;
json["minimum_selector_version"] = minDrivingModelSelectorVersion;
return json;
}
@@ -140,13 +134,6 @@ public:
QString index;
QString environment;
QString generation;
QString minDrivingModelSelectorVersion;
bool isCompatible(const QString &selector_version) const {
return QVersionNumber::fromString(selector_version) >=
QVersionNumber::fromString(minDrivingModelSelectorVersion);
}
};
class ModelsFetcher : public QObject {
@@ -158,7 +145,6 @@ public:
static std::vector<Model> getModelsFromURL(const QUrl&url);
static std::vector<Model> getModelsFromURL(const QString&url);
static std::vector<Model> getModelsFromURL();
static std::vector<Model> getCompatibleModels(const QString &selector_version);
signals:
void downloadProgress(double percentage);
@@ -210,13 +210,12 @@ void SoftwarePanelSP::handleCurrentModelLblBtnClicked() {
checkNetwork();
const auto currentModelName = QString::fromStdString(params.get("DrivingModelName"));
const bool is_release_sp = params.getBool("IsReleaseSPBranch");
const QString selector_version = QString::fromStdString(params.get("DrivingModelSelectorVersion"));
const auto compatible_models = ModelsFetcher::getCompatibleModels(selector_version);
const auto models = ModelsFetcher::getModelsFromURL();
QMap<QString, QString> index_to_model;
// Collecting indices with display names
for (const auto &model : compatible_models) {
for (const auto &model : models) {
if ((is_release_sp && model.environment == "release") || !is_release_sp) {
index_to_model.insert(model.index, model.displayName);
}
@@ -244,7 +243,7 @@ void SoftwarePanelSP::handleCurrentModelLblBtnClicked() {
}
// Finding and setting the selected model
for (auto &model : compatible_models) {
for (auto &model : models) {
if (model.displayName == selectedModelName) {
selectedModelToDownload = model;
selectedNavModelToDownload = model;
-2
View File
@@ -11,7 +11,6 @@ import openpilot.system.sentry as sentry
from openpilot.common.api.sunnylink import UNREGISTERED_SUNNYLINK_DONGLE_ID
from openpilot.common.params import Params, ParamKeyType
from openpilot.common.text_window import TextWindow
from openpilot.selfdrive.modeld.custom_model_metadata import DRIVING_MODEL_SELECTOR_VERSION
from openpilot.system.hardware import HARDWARE, PC
from openpilot.system.manager.helpers import unblock_stdout, write_onroad_params, save_bootlog
from openpilot.system.manager.mapd_installer import VERSION
@@ -65,7 +64,6 @@ def manager_init() -> None:
("DisableOnroadUploads", "0"),
("DisengageLateralOnBrake", "0"),
("DrivingModelGeneration", "0"),
("DrivingModelSelectorVersion", str(DRIVING_MODEL_SELECTOR_VERSION)),
("DynamicLaneProfile", "1"),
("DynamicPersonality", "0"),
("EnableMads", "1"),