Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update values.py #74

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
4a3d5e2
dragonpilot 0.7.10
eFiniLan Oct 30, 2020
3cb8df8
* HYUNDAI_GENESIS uses INDI controller. (Thanks to @donfyffe)
eFiniLan Nov 4, 2020
2665d30
* HYUNDAI_GENESIS added Cruise button event and lkMode feature. (Than…
eFiniLan Nov 5, 2020
1e53607
added minSteerSpeed back to hkg
eFiniLan Nov 10, 2020
59b5212
update logic
eFiniLan Nov 11, 2020
078935b
update logic
eFiniLan Nov 11, 2020
4cb5e99
update logic
eFiniLan Nov 11, 2020
d6b3cb2
* Support 2018 Taiwan Hyundai IONIQ + smart MDPS (dp_hkg_smart_mdps) …
eFiniLan Nov 12, 2020
8a8dfaf
torch model
eFiniLan Nov 9, 2020
1c75d1c
* updated all honda/hyunda/toyota fingerprints
eFiniLan Nov 19, 2020
02e1036
fix bugs
eFiniLan Nov 19, 2020
43e9274
fix bugs
eFiniLan Nov 20, 2020
c09c2bc
https://github.com/commaai/openpilot/pull/2569
eFiniLan Nov 20, 2020
0fbf202
fixed VW 0x117 CRC error
eFiniLan Nov 20, 2020
2851514
genesis should all have switch signal
eFiniLan Nov 20, 2020
4a11adb
Update values.py
sebastian4k Nov 22, 2020
4c34b3c
* Added Dynamic Gas Lite. (Thanks to toyboxZ)
eFiniLan Nov 22, 2020
aee4f97
https://github.com/commaai/openpilot/pull/2590
eFiniLan Nov 22, 2020
3363228
bug fixes
eFiniLan Nov 22, 2020
12b4f9a
bug fixes
eFiniLan Nov 22, 2020
325c9b2
Merge pull request #69 from sebastian4k/patch-7
eFiniLan Nov 23, 2020
e0b7cce
2020-11-21, 2020-11-23, 2020-11-24 changes in master-ci
eFiniLan Nov 24, 2020
bafbab1
fix bugs
eFiniLan Nov 24, 2020
ba0fb4f
fix bugs
eFiniLan Nov 24, 2020
b92f36a
fix bugs
eFiniLan Nov 24, 2020
6704c8d
fix bugs
eFiniLan Nov 24, 2020
2894cd2
https://github.com/commaai/openpilot/commit/71930a4b9674037f494b622fb…
eFiniLan Nov 25, 2020
af020da
bug fixes
eFiniLan Nov 25, 2020
168136e
multiple bug fixes
eFiniLan Nov 25, 2020
274e75c
* Added Honda inspire, accord, crv SnG optimisation from afa fork. (T…
eFiniLan Nov 28, 2020
829ecd7
* Added dp_toyota_lowest_cruise_override_vego. (Thanks to @toyboxZ)
eFiniLan Nov 28, 2020
8f64538
smart mdps steering speed override
eFiniLan Nov 30, 2020
d972f6d
attempt to fix lead_distance bug
eFiniLan Nov 30, 2020
7f41aa9
Merge branch 'devel' of https://github.com/commaai/openpilot into tes…
eFiniLan Dec 1, 2020
7860ab7
dragonpilot v0.8.0
eFiniLan Dec 3, 2020
11ce615
Fix commIssue due to frame drop and power draw (#2689)
adeebshihadeh Dec 3, 2020
fc14ec2
Merge branch 'devel' of https://github.com/commaai/openpilot into tes…
eFiniLan Dec 4, 2020
c744ac0
* Added git error fix. (Thanks to @toyboxZ)
eFiniLan Dec 4, 2020
d7068a1
revert uno.h change to 0.7.10
Dec 5, 2020
3064cef
revert uno change
eFiniLan Dec 5, 2020
9c6abca
Merge branch 'testing' of https://github.com/dragonpilot-community/dr…
eFiniLan Dec 5, 2020
e0f8046
Bug fixes
Dec 6, 2020
287bad7
devel branch w/ grey panda support
Dec 7, 2020
0c96289
Merge branch 'feature-greypanda-support' of https://github.com/dragon…
eFiniLan Dec 10, 2020
5173f73
fix dynamicGas profile change does not take effect
toyboxZ Dec 13, 2020
3f22229
Update values.py
sebastian4k Dec 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
602 changes: 602 additions & 0 deletions CHANGELOGS-DEV.md

Large diffs are not rendered by default.

301 changes: 301 additions & 0 deletions CHANGELOGS-REL.md

Large diffs are not rendered by default.

414 changes: 414 additions & 0 deletions CHANGELOGS.md

Large diffs are not rendered by default.

Binary file modified apk/ai.comma.plus.offroad.apk
Binary file not shown.
16 changes: 16 additions & 0 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ struct CarEvent @0x9b1657f34caf3ad3 {
focusRecoverActiveDEPRECATED @86;
neosUpdateRequiredDEPRECATED @88;
modelLagWarningDEPRECATED @93;

#dp
preLaneChangeLeftALC @94;
preLaneChangeRightALC @95;
manualSteeringRequired @96;
manualSteeringRequiredBlinkersOn @97;
leadCarMoving @98;

# timebomb assist
timebombWarn @99;
timebombBypassing @100;
timebombBypassed @101;
}
}

Expand Down Expand Up @@ -184,6 +196,10 @@ struct CarState {
leftBlindspot @33 :Bool; # Is there something blocking the left lane change
rightBlindspot @34 :Bool; # Is there something blocking the right lane change

# dp
lkMode @37 :Bool;
stopSteering @38 :Bool; # timebomb - stopSteering

struct WheelSpeeds {
# optional wheel speeds
fl @0 :Float32;
Expand Down
82 changes: 82 additions & 0 deletions cereal/log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,9 @@ struct PathPlan {
laneChangeState @18 :LaneChangeState;
laneChangeDirection @19 :LaneChangeDirection;

# dp
dpALCAllowed @20 :Bool;

enum Desire {
none @0;
turnLeft @1;
Expand Down Expand Up @@ -2138,5 +2141,84 @@ struct Event {
modelV2 @75 :ModelDataV2;
frontEncodeIdx @76 :EncodeIndex; # driver facing camera
wideEncodeIdx @77 :EncodeIndex;
dragonConf @78 :DragonConf;
}
}

struct DragonConf {
dpThermalStarted @0 :Bool;
dpThermalOverheat @1 :Bool;
dpVw @2 :Bool;
dpAtl @3 :Bool;
dpAppWaze @4 :Bool;
dpAppWazeManual @5 :Int8;
dpAppHr @6 :Bool;
dpAppHrManual @7 :Int8;
dpDashcam @8 :Bool;
dpDashcamHoursStored @9 :UInt8;
dpAutoShutdown @10 :Bool;
dpAthenad @11 :Bool;
dpUploader @12 :Bool;
dpLatCtrl @13 :Bool;
dpSteeringLimitAlert @14 :Bool;
dpSteeringOnSignal @15 :Bool;
dpSignalOffDelay @16 :UInt8;
dpAssistedLcMinMph @17 :Float32;
dpAutoLc @18 :Bool;
dpAutoLcCont @19 :Bool;
dpAutoLcMinMph @20 :Float32;
dpAutoLcDelay @21 :Float32;
dpSlowOnCurve @22 :Bool;
dpAllowGas @23 :Bool;
dpMaxCtrlSpeed @24 :Float32;
dpLeadCarAlert @25 :Bool;
dpDynamicFollow @26 :UInt8;
dpAccelProfile @27 :UInt8;
dpDriverMonitor @28 :Bool;
dpSteeringMonitor @29 :Bool;
dpSteeringMonitorTimer @30 :UInt8;
dpGearCheck @31 :Bool;
dpDrivingUi @32 :Bool;
dpUiScreenOffReversing @33 :Bool;
dpUiScreenOffDriving @34 :Bool;
dpUiSpeed @35 :Bool;
dpUiEvent @36 :Bool;
dpUiMaxSpeed @37 :Bool;
dpUiFace @38 :Bool;
dpUiLane @39 :Bool;
dpUiPath @40 :Bool;
dpUiLead @41 :Bool;
dpUiDev @42 :Bool;
dpUiDevMini @43 :Bool;
dpUiBlinker @44 :Bool;
dpUiBrightness @45 :UInt8;
dpUiVolumeBoost @46 :Int8;
dpAppAutoUpdate @47 :Bool;
dpAppExtGps @48 :Bool;
dpAppTomtom @49 :Bool;
dpAppTomtomAuto @50 :Bool;
dpAppTomtomManual @51 :Int8;
dpAppAutonavi @52 :Bool;
dpAppAutonaviAuto @53 :Bool;
dpAppAutonaviManual @54 :Int8;
dpAppAegis @55 :Bool;
dpAppAegisAuto @56 :Bool;
dpAppAegisManual @57 :Int8;
dpAppMixplorer @58 :Bool;
dpAppMixplorerManual @59 :Int8;
dpCarDetected @60 :Text;
dpToyotaLdw @61 :Bool;
dpToyotaSng @62 :Bool;
dpToyotaLowestCruiseOverride @63 :Bool;
dpToyotaLowestCruiseOverrideVego @64 :Bool;
dpToyotaLowestCruiseOverrideAt @65 :Float32;
dpToyotaLowestCruiseOverrideSpeed @66 :Float32;
dpIpAddr @67 :Text;
dpCameraOffset @68 :Int8;
dpLocale @69 :Text;
dpChargingCtrl @70 :Bool;
dpChargingAt @71 :UInt8;
dpDischargingAt @72 :UInt8;
dpIsUpdating @73 :Bool;
dpTimebombAssist @74 :Bool;
}
2 changes: 2 additions & 0 deletions cereal/service_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ wideEncodeIdx: [8075, true, 20.]
wideFrame: [8076, true, 20.]
modelV2: [8077, true, 20., 20]

dragonConf: [8088, false, 2.]

testModel: [8040, false, 0.]
testLiveLocation: [8045, false, 0.]
testJoystick: [8056, false, 0.]
Expand Down
80 changes: 80 additions & 0 deletions common/dp_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env python3.7
import subprocess
from cereal import car
from common.params import Params
from common.realtime import sec_since_boot
import os
params = Params()
PARAM_PATH = "/data/params/d/"
LAST_MODIFIED = PARAM_PATH + "dp_last_modified"

def is_online():
try:
return not subprocess.call(["ping", "-W", "4", "-c", "1", "117.28.245.92"])
except ProcessLookupError:
return False

def common_controller_ctrl(enabled, dragonconf, blinker_on, steer_req, v_ego):
if enabled:
if (dragonconf.dpSteeringOnSignal and blinker_on) or not dragonconf.dpLatCtrl:
steer_req = 0 if isinstance(steer_req, int) else False
return steer_req

def common_interface_atl(ret, atl):
# dp
enable_acc = ret.cruiseState.enabled
if atl and ret.cruiseState.available:
enable_acc = True
if ret.gearShifter in [car.CarState.GearShifter.reverse, car.CarState.GearShifter.park]:
enable_acc = False
if ret.seatbeltUnlatched or ret.doorOpen:
enable_acc = False
return enable_acc

def common_interface_get_params_lqr(ret):
if params.get('dp_lqr') == b'1':
ret.lateralTuning.init('lqr')
ret.lateralTuning.lqr.scale = 1500.0
ret.lateralTuning.lqr.ki = 0.05

ret.lateralTuning.lqr.a = [0., 1., -0.22619643, 1.21822268]
ret.lateralTuning.lqr.b = [-1.92006585e-04, 3.95603032e-05]
ret.lateralTuning.lqr.c = [1., 0.]
ret.lateralTuning.lqr.k = [-110.73572306, 451.22718255]
ret.lateralTuning.lqr.l = [0.3233671, 0.3185757]
ret.lateralTuning.lqr.dcGain = 0.002237852961363602
return ret


def get_last_modified(delay, old_check, old_modified):
new_check = sec_since_boot()
if old_check is None or new_check - old_check >= delay:
return new_check, os.stat(LAST_MODIFIED).st_mtime
else:
return old_check, old_modified

def param_get_if_updated(param, type, old_val, old_modified):
try:
modified = os.stat(PARAM_PATH + param).st_mtime
except OSError:
return old_val, old_modified
if old_modified != modified:
new_val = param_get(param, type, old_val)
new_modified = modified
else:
new_val = old_val
new_modified = old_modified
return new_val, new_modified

def param_get(param_name, type, default):
try:
val = params.get(param_name, encoding='utf8').rstrip('\x00')
if type == 'bool':
val = val == '1'
elif type == 'int':
val = int(val)
elif type == 'float':
val = float(val)
except (TypeError, ValueError):
val = default
return val
Loading