Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fix @perpetuoviator dev UI by @theantihero

* Update Makefile

* @theantihero 's fix acc hud for kmh or mph on cruise control hud. fix for ui temporary
  • Loading branch information
kegman committed Jul 8, 2019
1 parent 2d75398 commit 2dbc79a
Show file tree
Hide file tree
Showing 7 changed files with 688 additions and 57 deletions.
21 changes: 12 additions & 9 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ struct CarEvent @0x9b1657f34caf3ad3 {
calibrationProgress @47;
lowBattery @48;
invalidGiraffeHonda @49;
manualSteeringRequired @50;
manualSteeringRequiredBlinkersOn @51;
vehicleModelInvalid @52;
controlsFailed @53;
sensorDataInvalid @54;
commIssue @55;
vehicleModelInvalid @50;
controlsFailed @51;
sensorDataInvalid @52;
commIssue @53;
manualSteeringRequired @54;
manualSteeringRequiredBlinkersOn @55;
}
}

Expand Down Expand Up @@ -122,13 +122,13 @@ struct CarState {
leftBlinker @20 :Bool;
rightBlinker @21 :Bool;
genericToggle @23 :Bool;
readdistancelines @26 :Float32;
lkMode @27 :Bool;
readdistancelines @27 :Float32;
lkMode @28 :Bool;

# lock info
doorOpen @24 :Bool;
seatbeltUnlatched @25 :Bool;
canValid @28 :Bool;
canValid @26 :Bool;

# which packets this state came from
canMonoTimes @12: List(UInt64);
Expand Down Expand Up @@ -348,6 +348,8 @@ struct CarParams {
kiBP @2 :List(Float32);
kiV @3 :List(Float32);
kf @4 :Float32;
dampTime @5 :Float32;
reactMPC @6 :Float32;
}

struct LongitudinalPIDTuning {
Expand All @@ -365,6 +367,7 @@ struct CarParams {
innerLoopGain @1 :Float32;
timeConstant @2 :Float32;
actuatorEffectiveness @3 :Float32;
reactMPC @4 :Float32;
}


Expand Down
9 changes: 9 additions & 0 deletions cereal/log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ struct ControlsState @0x97ff69c53601abf1 {
jerkFactor @12 :Float32;
angleSteers @13 :Float32; # Steering angle in degrees.
angleSteersDes @29 :Float32;
dampAngleSteersDes @54 :Float32;
curvature @37 :Float32; # path curvature from vehicle model
hudLeadDEPRECATED @14 :Int32;
cumLagMs @15 :Float32;
Expand Down Expand Up @@ -662,6 +663,9 @@ struct PathPlan {
angleOffset @11 :Float32;
sensorValid @14 :Bool;
commIssue @15 :Bool;
mpcAngles @16 :List(Float32);
mpcRates @17 :List(Float32);
mpcTimes @18 :List(Float32);
}

struct LiveLocationData {
Expand Down Expand Up @@ -1695,6 +1699,11 @@ struct KalmanOdometry {
rotStd @3 :List(Float32); # std rad/s in device frame
}

struct DynamicFollowData {
gas @0 :Float32;
brake @1 :Float32;
}

struct Event {
# in nanoseconds?
logMonoTime @0 :UInt64;
Expand Down
2 changes: 1 addition & 1 deletion opendbc/honda_insight_ex_2019_can_generated.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ BO_ 780 ACC_HUD: 8 ADAS
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX
SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX
SG_ IMPERIAL_UNIT : 55|1@0+ (1,0) [0|1] "" XXX
SG_ IMPERIAL_UNIT : 55|2@0+ (1,0) [0|3] "" XXX
SG_ SET_TO_X1 : 56|1@0+ (1,0) [0|1] "" XXX
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
Expand Down
4 changes: 3 additions & 1 deletion selfdrive/car/honda/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def get_can_signals(CP):
signals += [("CAR_GAS", "GAS_PEDAL_2", 0),
("MAIN_ON", "SCM_FEEDBACK", 0),
("EPB_STATE", "EPB_STATUS", 0),
("CRUISE_SPEED", "ACC_HUD", 0)]
("CRUISE_SPEED", "ACC_HUD", 0),
("IMPERIAL_UNIT", "ACC_HUD", 0)]
checks += [("GAS_PEDAL_2", 100)]
else:
# Nidec signals.
Expand Down Expand Up @@ -382,6 +383,7 @@ def update(self, cp, cp_cam):

# TODO: discover the CAN msg that has the imperial unit bit for all other cars
self.is_metric = not cp.vl["HUD_SETTING"]['IMPERIAL_UNIT'] if self.CP.carFingerprint in (CAR.CIVIC) else False
self.is_metric = 3

# carstate standalone tester
if __name__ == '__main__':
Expand Down
5 changes: 2 additions & 3 deletions selfdrive/car/honda/hondacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ def create_ui_commands(packer, pcm_speed, hud, car_fingerprint, is_metric, idx):
'CRUISE_SPEED': hud.v_cruise,
'ENABLE_MINI_CAR': hud.mini_car,
'HUD_LEAD': hud.car,
'SET_ME_X01': 0x01,
'HUD_DISTANCE_3': 1,
'HUD_DISTANCE': hud.dist_lines, # max distance setting on display
'HUD_DISTANCE': 3, # max distance setting on display
'IMPERIAL_UNIT': int(not is_metric),
'SET_ME_X01_2': 1,
'SET_ME_X01': 1,
}
commands.append(packer.make_can_msg("ACC_HUD", 0, acc_hud_values, idx))

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CXXFLAGS = -std=c++11 -fPIC -O2 $(WARN_FLAGS)
ZMQ_LIBS = -l:libczmq.a -l:libzmq.a -lgnustl_shared

CEREAL_LIBS = -l:libcapn.a
CEREAL_OBJS = ../../cereal/gen/c/log.capnp.o
CEREAL_OBJS = ../../cereal/gen/c/log.capnp.o ../../cereal/gen/c/car.capnp.o

NANOVG_FLAGS = -I$(PHONELIBS)/nanovg
JSON_FLAGS = -I$(PHONELIBS)/json/src
Expand Down
Loading

0 comments on commit 2dbc79a

Please sign in to comment.