mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-10-13 09:53:41 +08:00
309304a352
* init * more init * keep it alive * fixes * more fixes * more fix * new submodule for nn data * bump submodule * update path to submodule * spacing??? * update submodule path * update submodule path * bump * dump * bump * introduce params * Add Neural Network Lateral Control toggle to developer panel This introduces a new toggle for enabling Neural Network Lateral Control (NNLC), providing detailed descriptions of its functionality and compatibility. It includes UI integration, car compatibility checks, and feedback links for unsupported vehicles. * decouple even more * static * codespell * remove debug * in structs * fix import * convert to capnp * fixes * debug * only initialize if NNLC is enabled or allow to enable * oops * fix initialization * only allow engage if nnlc is off * fix toggle param * fix tests * lint * fix more test * capnp test * try this out * validate if it's not None * make it 33 to match * align * share the same friction input calculation * return stock values if not enabled * unused * split base and child * space * rename * NeuralNetworkFeedForwardModel * less * just use file name * try this * more explicit * rename * move it * child class for additional controllers * rename * time to split out custom lateral acceleration * move around * space * fix * TODO-SP * TODO-SP * update regardless, it's an extension now * update name and expose toggle * ui: sunnypilot Panel -> Steering Panel * Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h * merge * move to steering panel * no need for this * live params in a thread * no live for now * new structs * more ui * more flexible * more ui * no longer needed * another ui * cereal changes * bump opendbc * simplify checks * all in one place * split Enhanced Lat Accel * handle unrecognized platform * test for fingerprinting * fix fingerprint * NNLC: Mock data for unrecognized cars * fix fingerprints * test to verify model loading * bump neural_network_data * use pytest * use different one for now * fix ui preview alignments * typing * more type * show a platform * show match * init params for tests * ok ruff * make sure to loop through tests * ok again ruff * ok we need this lol --------- Co-authored-by: DevTekVE <devtekve@gmail.com>
200 lines
4.0 KiB
Cap'n Proto
200 lines
4.0 KiB
Cap'n Proto
using Cxx = import "./include/c++.capnp";
|
|
$Cxx.namespace("cereal");
|
|
|
|
@0xb526ba661d550a59;
|
|
|
|
# custom.capnp: a home for empty structs reserved for custom forks
|
|
# These structs are guaranteed to remain reserved and empty in mainline
|
|
# cereal, so use these if you want custom events in your fork.
|
|
|
|
# DO rename the structs
|
|
# DON'T change the identifier (e.g. @0x81c2f05a394cf4af)
|
|
|
|
struct ModularAssistiveDrivingSystem {
|
|
state @0 :ModularAssistiveDrivingSystemState;
|
|
enabled @1 :Bool;
|
|
active @2 :Bool;
|
|
available @3 :Bool;
|
|
|
|
enum ModularAssistiveDrivingSystemState {
|
|
disabled @0;
|
|
paused @1;
|
|
enabled @2;
|
|
softDisabling @3;
|
|
overriding @4;
|
|
}
|
|
}
|
|
|
|
struct SelfdriveStateSP @0x81c2f05a394cf4af {
|
|
mads @0 :ModularAssistiveDrivingSystem;
|
|
}
|
|
|
|
struct ModelManagerSP @0xaedffd8f31e7b55d {
|
|
activeBundle @0 :ModelBundle;
|
|
selectedBundle @1 :ModelBundle;
|
|
availableBundles @2 :List(ModelBundle);
|
|
|
|
struct DownloadUri {
|
|
uri @0 :Text;
|
|
sha256 @1 :Text;
|
|
}
|
|
|
|
enum Type {
|
|
drive @0;
|
|
navigation @1;
|
|
metadata @2;
|
|
}
|
|
|
|
struct Model {
|
|
fullName @0 :Text;
|
|
fileName @1 :Text;
|
|
downloadUri @2 :DownloadUri;
|
|
downloadProgress @3 :DownloadProgress;
|
|
type @4 :Type;
|
|
}
|
|
|
|
enum DownloadStatus {
|
|
notDownloading @0;
|
|
downloading @1;
|
|
downloaded @2;
|
|
cached @3;
|
|
failed @4;
|
|
}
|
|
|
|
struct DownloadProgress {
|
|
status @0 :DownloadStatus;
|
|
progress @1 :Float32;
|
|
eta @2 :UInt32;
|
|
}
|
|
|
|
enum Runner {
|
|
snpe @0;
|
|
tinygrad @1;
|
|
stock @2;
|
|
}
|
|
|
|
struct ModelBundle {
|
|
index @0 :UInt32;
|
|
internalName @1 :Text;
|
|
displayName @2 :Text;
|
|
models @3 :List(Model);
|
|
status @4 :DownloadStatus;
|
|
generation @5 :UInt32;
|
|
environment @6 :Text;
|
|
runner @7 :Runner;
|
|
is20hz @8 :Bool;
|
|
}
|
|
}
|
|
|
|
struct LongitudinalPlanSP @0xf35cc4560bbf6ec2 {
|
|
dec @0 :DynamicExperimentalControl;
|
|
|
|
struct DynamicExperimentalControl {
|
|
state @0 :DynamicExperimentalControlState;
|
|
enabled @1 :Bool;
|
|
active @2 :Bool;
|
|
|
|
enum DynamicExperimentalControlState {
|
|
acc @0;
|
|
blended @1;
|
|
}
|
|
}
|
|
}
|
|
|
|
struct OnroadEventSP @0xda96579883444c35 {
|
|
name @0 :EventName;
|
|
|
|
# event types
|
|
enable @1 :Bool;
|
|
noEntry @2 :Bool;
|
|
warning @3 :Bool; # alerts presented only when enabled or soft disabling
|
|
userDisable @4 :Bool;
|
|
softDisable @5 :Bool;
|
|
immediateDisable @6 :Bool;
|
|
preEnable @7 :Bool;
|
|
permanent @8 :Bool; # alerts presented regardless of openpilot state
|
|
overrideLateral @10 :Bool;
|
|
overrideLongitudinal @9 :Bool;
|
|
|
|
enum EventName {
|
|
lkasEnable @0;
|
|
lkasDisable @1;
|
|
manualSteeringRequired @2;
|
|
manualLongitudinalRequired @3;
|
|
silentLkasEnable @4;
|
|
silentLkasDisable @5;
|
|
silentBrakeHold @6;
|
|
silentWrongGear @7;
|
|
silentReverseGear @8;
|
|
silentDoorOpen @9;
|
|
silentSeatbeltNotLatched @10;
|
|
silentParkBrake @11;
|
|
controlsMismatchLateral @12;
|
|
hyundaiRadarTracksConfirmed @13;
|
|
experimentalModeSwitched @14;
|
|
}
|
|
}
|
|
|
|
struct CarParamsSP @0x80ae746ee2596b11 {
|
|
flags @0 :UInt32; # flags for car specific quirks in sunnypilot
|
|
safetyParam @1 : Int16; # flags for sunnypilot's custom safety flags
|
|
|
|
neuralNetworkLateralControl @2 :NeuralNetworkLateralControl;
|
|
|
|
struct NeuralNetworkLateralControl {
|
|
model @0 :Model;
|
|
fuzzyFingerprint @1 :Bool;
|
|
|
|
struct Model {
|
|
path @0 :Text;
|
|
name @1 :Text;
|
|
}
|
|
}
|
|
}
|
|
|
|
struct CarControlSP @0xa5cd762cd951a455 {
|
|
mads @0 :ModularAssistiveDrivingSystem;
|
|
}
|
|
|
|
struct CustomReserved6 @0xf98d843bfd7004a3 {
|
|
}
|
|
|
|
struct CustomReserved7 @0xb86e6369214c01c8 {
|
|
}
|
|
|
|
struct CustomReserved8 @0xf416ec09499d9d19 {
|
|
}
|
|
|
|
struct CustomReserved9 @0xa1680744031fdb2d {
|
|
}
|
|
|
|
struct CustomReserved10 @0xcb9fd56c7057593a {
|
|
}
|
|
|
|
struct CustomReserved11 @0xc2243c65e0340384 {
|
|
}
|
|
|
|
struct CustomReserved12 @0x9ccdc8676701b412 {
|
|
}
|
|
|
|
struct CustomReserved13 @0xcd96dafb67a082d0 {
|
|
}
|
|
|
|
struct CustomReserved14 @0xb057204d7deadf3f {
|
|
}
|
|
|
|
struct CustomReserved15 @0xbd443b539493bc68 {
|
|
}
|
|
|
|
struct CustomReserved16 @0xfc6241ed8877b611 {
|
|
}
|
|
|
|
struct CustomReserved17 @0xa30662f84033036c {
|
|
}
|
|
|
|
struct CustomReserved18 @0xc86a3d38d13eb3ef {
|
|
}
|
|
|
|
struct CustomReserved19 @0xa4f1eb3323f5f582 {
|
|
}
|