Skip to content

Commit

Permalink
properly set unsafe_mode = 1 for UNSAFE_DISABLE_DISENGAGE_ON_GAS (com…
Browse files Browse the repository at this point in the history
…maai#215)

* properly set unsafe_mode = 1 for UNSAFE_DISABLE_DISENGAGE_ON_GAS

* change log

* change safety param to better align STEER_TORQUE_EPS and STEER_TORQUE_CMD

* update version
  • Loading branch information
sshane committed Sep 15, 2020
1 parent 1a5b41f commit 12b9608
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stock Additions v0.5.2 (0.7.7)
# Stock Additions v0.5.3 (0.7.7)

Stock Additions is a fork of openpilot designed to be minimal in design while boasting various feature additions and behavior improvements over stock. I have a 2017 Toyota Corolla with comma pedal, so most of my changes are designed to improve the longitudinal performance.

Expand Down
4 changes: 4 additions & 0 deletions SA_RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Stock Additions v0.5.3 - 2020-9-15 (0.7.7)
===
* Properly set unsafe_mode in boardd. This might fix panda flashing issues for new users, since it won't be required

Stock Additions v0.5.2 - 2020-9-11 (0.7.7)
===
* Fix jerking after dynamic camera offset is complete, it now smoothly ramps back to center
Expand Down
2 changes: 1 addition & 1 deletion opendbc/toyota_corolla_2017_pt_generated.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ BO_ 705 GAS_PEDAL: 8 XXX
SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX

BO_ 608 STEER_TORQUE_SENSOR: 8 XXX
SG_ STEER_TORQUE_EPS : 47|16@0- (1.0,0) [-20000|20000] "" XXX
SG_ STEER_TORQUE_EPS : 47|16@0- (0.87,0) [-20000|20000] "" XXX
SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX
SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
Expand Down
2 changes: 1 addition & 1 deletion panda/board/safety_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct sample_t angle_meas; // last 3 steer angles
// See ISO 15622:2018 for more information.
#define UNSAFE_RAISE_LONGITUDINAL_LIMITS_TO_ISO_MAX 8

int unsafe_mode = 1;
int unsafe_mode = 0;

// time since safety mode has been changed
uint32_t safety_mode_cnt = 0U;
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/boardd/boardd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ void *safety_setter_thread(void *s) {
capnp::FlatArrayMessageReader cmsg(amsg);
cereal::CarParams::Reader car_params = cmsg.getRoot<cereal::CarParams>();

LOGW("setting unsafe_mode for gas press");
libusb_control_transfer(dev_handle, 0x40, 0xdf, 9, 0, NULL, 0, TIMEOUT);

int safety_model = int(car_params.getSafetyModel());
auto safety_param = car_params.getSafetyParam();
LOGW("setting safety model: %d with param %d", safety_model, safety_param);
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False,

elif candidate == CAR.COROLLA:
stop_and_go = False
ret.safetyParam = 100
ret.safetyParam = 87
ret.wheelbase = 2.70
ret.steerRatio = 18.27
tire_stiffness_factor = 0.444 # not optimized yet
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/common/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define COMMA_VERSION "0.7.7 - SA v0.5.2"
#define COMMA_VERSION "0.7.7 - SA v0.5.3"

0 comments on commit 12b9608

Please sign in to comment.