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

Fetch 0.8.9 Sato #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
Binary file added Paypall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,30 @@ Example: If my corolla is not hybrid i need do a ssh and:
```
echo 'export FINGERPRINT="TOYOTA COROLLA TSS2 2019"' >> launch_env.sh
```
The first engine start is expected to show a cruise fault error, just ignore it and wait 30 seconds with the engine off and only then start again. This error should happen only in the first match and then no longer repeat itself.
If your TSS2 corolla is hybrid equal to mine you can proceed a format factory (turning off your c2 and turning on by holding down the volume increase button) and then instead of putting ```https://openpilot.comma.ai``` in the custom fork installation url use ``` installer.comma.ai/alexandresato/master```

Se quiser agradecer pode me fazer um PIX de qualquer valor para 11 98546-1498
If you want to thank please join the process of sponsoring Shane Smiskol on his github
Now if you already know how to perform a ssh (if you do not know how to learn at: https://github.com/commaai/openpilot/wiki/SSH) run this command:
```cd /data/openpilot; scons --clean; cd ..; rm -rf openpilot; git clone --recurse-submodules https://github.com/alexandresato/openpilot; reboot```


If your TSS2 corolla is hybrid equal to mine you can proceed a format factory (turning off your c2 and turning on by holding down the volume increase button) and then instead of putting ```https://openpilot.comma.ai``` in the custom fork installation url use ``` installer.comma.ai/alexandresato/master```
💰 Donate 💰
---

If you find any of the features useful, feel free to donate to support for future feature development.

Thank you for your continuous love and support! Enjoy 🥰

**PayPal:**

<a href="https://www.paypal.com/donate/?hosted_button_id=JN4E8PTL4QBZG" target="_blank">
<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt="PayPal this" title="PayPal - The safer, easier way to pay online!" border="0" />
</a>
<br></br>

**PayPal QR Code:**

![Paypall.png.png](Paypall.png)

Now if you already know how to perform a ssh (if you do not know how to learn at: https://github.com/commaai/openpilot/wiki/SSH) run this command:
```cd /data/openpilot; scons --clean; cd ..; rm -rf openpilot; git clone --recurse-submodules https://github.com/alexandresato/openpilot; reboot```


this fork is based in:
Expand Down
2 changes: 2 additions & 0 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ struct CarState {
leftBlindspot @33 :Bool; # Is there something blocking the left lane change
rightBlindspot @34 :Bool; # Is there something blocking the right lane change

headlightON @38 :Bool; # Low Beam ON

struct WheelSpeeds {
# optional wheel speeds
fl @0 :Float32;
Expand Down
2 changes: 1 addition & 1 deletion installer/updater/update.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-50da8800caa5cbc224acbaa21f3a83d21802a31d89cccfc62a898903a8eb19e7.zip",
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-e5aa34ebb27977779db4e82439cca8f807e9c9ee2c84c217c926a2d08dd2959f.zip",
"ota_hash": "e5aa34ebb27977779db4e82439cca8f807e9c9ee2c84c217c926a2d08dd2959f",
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-cf752ceb7931aa427ccec384fd21d9425c6053f25161814dab31ec75e4d296b0.img",
"recovery_len": 15222060,
Expand Down
1 change: 1 addition & 0 deletions launch_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ if [ -z "$PASSIVE" ]; then
fi

export STAGING_ROOT="/data/safe_staging"
export SKIP_FW_QUERY=1
export FINGERPRINT="TOYOTA COROLLA HYBRID TSS2 2019"
4 changes: 3 additions & 1 deletion selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def update(self, cp, cp_cam):
# we could use the override bit from dbc, but it's triggered at too high torque values
ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD
ret.steerWarning = cp.vl["EPS_STATUS"]["LKA_STATE"] not in [1, 5]
ret.headlightON = cp.vl["LIGHT_STALK"]['LOW_BEAM'] == 1

if self.CP.carFingerprint == CAR.LEXUS_IS:
ret.cruiseState.available = cp.vl["DSU_CRUISE"]["MAIN_ON"] != 0
Expand Down Expand Up @@ -129,7 +130,7 @@ def update(self, cp, cp_cam):
# send your own ACC_CONTROL msg on startup with ACC_TYPE set to 1
if (self.CP.carFingerprint not in TSS2_CAR and self.CP.carFingerprint != CAR.LEXUS_IS) or \
(self.CP.carFingerprint in TSS2_CAR and self.acc_type == 1):
self.low_speed_lockout = cp.vl["PCM_CRUISE_2"]["LOW_SPEED_LOCKOUT"] == 2
self.low_speed_lockout = False

self.pcm_acc_status = cp.vl["PCM_CRUISE"]["CRUISE_STATE"]
if self.CP.carFingerprint in NO_STOP_TIMER_CAR or self.CP.enableGasInterceptor:
Expand Down Expand Up @@ -185,6 +186,7 @@ def get_can_parser(CP):
("LKA_STATE", "EPS_STATUS", 0),
("AUTO_HIGH_BEAM", "LIGHT_STALK", 0),
("BRAKE_LIGHTS_ACC", "ESP_CONTROL", 0),
("LOW_BEAM", "LIGHT_STALK", 0),
]

checks = [
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 @@ -237,7 +237,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # py
ret.lateralTuning.indi.timeConstantV = [1, 3, 4.5]
ret.lateralTuning.indi.actuatorEffectivenessBP = [18, 22, 26]
ret.lateralTuning.indi.actuatorEffectivenessV = [9, 12, 15]
ret.steerActuatorDelay = 0.42 - 0.2
ret.steerActuatorDelay = 0.42 - 0.1534
else:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.1]]
ret.lateralTuning.pid.kf = 0.00007818594
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/toyota/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CarControllerParams:

STEER_MAX = 1500
STEER_DELTA_UP = 10 # 1.5s time to peak torque
STEER_DELTA_DOWN = 25 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
STEER_DELTA_DOWN = 50 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor

class CAR:
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def no_gps_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool) -> Al
"Poor GPS reception",
"If sky is visible, contact support" if gps_integrated else "Check GPS antenna placement",
AlertStatus.normal, AlertSize.mid,
Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2, creation_delay=300.)
Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2, creation_delay=300000000000.)


def wrong_car_mode_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool) -> Alert:
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/thermald/thermald.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def thermald_thread():
now = datetime.datetime.utcnow()

# show invalid date/time alert
startup_conditions["time_valid"] = (now.year > 2020) or (now.year == 2020 and now.month >= 10)
startup_conditions["time_valid"] = (now.year > 1020) or (now.year == 2020 and now.month >= 10)
set_offroad_alert_if_changed("Offroad_InvalidTime", (not startup_conditions["time_valid"]))

# Show update prompt
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/ui/paint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static void ui_draw_vision_speed(UIState *s) {
color = (*s->sm)["carState"].getCarState().getBrakeLights() ? nvgRGBA(255, 66, 66, 255) : color;
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
ui_draw_text(s, s->fb_w/2, 210, speed_str.c_str(), 96 * 2.5, color, "sans-bold");
ui_draw_text(s, s->fb_w/2, 290, s->scene.is_metric ? "KM/H" : "mph", 36 * 2.5, COLOR_WHITE_ALPHA(200), "sans-regular");
ui_draw_text(s, s->fb_w/2, 290, s->scene.is_metric ? "km/h" : "mph", 36 * 2.5, COLOR_WHITE_ALPHA(200), "sans-regular");
}

static void ui_draw_vision_event(UIState *s) {
Expand Down
8 changes: 8 additions & 0 deletions selfdrive/ui/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ static void update_state(UIState *s) {
scene.engageable = sm["controlsState"].getControlsState().getEngageable();
scene.dm_active = sm["driverMonitoringState"].getDriverMonitoringState().getIsActiveMode();
}

s->scene.headlightON = sm["carState"].getCarState().getHeadlightON();

if (sm.updated("modelV2") && s->vg) {
auto model = sm["modelV2"].getModelV2();
update_model(s, model);
Expand Down Expand Up @@ -386,6 +389,11 @@ void Device::updateBrightness(const UIState &s) {
if (!awake) {
brightness = 0;
}
if (s.scene.headlightON) {
brightness = brightness * 0.5;
} else {
brightness = brightness * 1.0;
}

if (brightness != last_brightness) {
std::thread{Hardware::set_brightness, brightness}.detach();
Expand Down
3 changes: 2 additions & 1 deletion selfdrive/ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef enum UIStatus {

const QColor bg_colors [] = {
[STATUS_DISENGAGED] = QColor(0x17, 0x33, 0x49, 0xc8),
[STATUS_ENGAGED] = QColor(0x00, 0xff, 0x00, 0xff),
[STATUS_ENGAGED] = QColor(0x0C, 0x16, 0xFF, 0xff),
[STATUS_WARNING] = QColor(0xDA, 0x6F, 0x25, 0xf1),
[STATUS_ALERT] = QColor(0xC9, 0x22, 0x31, 0xf1),
};
Expand All @@ -106,6 +106,7 @@ typedef struct UIScene {

mat3 view_from_calib;
bool world_objects_visible;
bool headlightON;

cereal::PandaState::PandaType pandaType;

Expand Down