Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ jobs:
name: diff_report_${{ github.event.number }}
path: selfdrive/test/process_replay/diff_report.txt
- name: Checkout ci-artifacts
if: github.repository == 'commaai/openpilot' && github.ref == 'refs/heads/master'
if: github.repository == 'elkoled/openpilot-stock' && github.ref == 'refs/heads/master'
uses: actions/checkout@v4
with:
repository: commaai/ci-artifacts
repository: elkoled/ci-artifacts
ssh-key: ${{ secrets.CI_ARTIFACTS_DEPLOY_KEY }}
path: ${{ github.workspace }}/ci-artifacts
- name: Push refs
if: github.repository == 'commaai/openpilot' && github.ref == 'refs/heads/master'
if: github.repository == 'elkoled/openpilot-stock' && github.ref == 'refs/heads/master'
working-directory: ${{ github.workspace }}/ci-artifacts
run: |
git checkout --orphan process-replay
Expand Down
6 changes: 1 addition & 5 deletions selfdrive/test/process_replay/test_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# dashcamOnly makes don't need to be tested until a full port is done
excluded_interfaces = ["mock", "body", "psa"]

BASE_URL = "https://raw.githubusercontent.com/commaai/ci-artifacts/refs/heads/process-replay/"
BASE_URL = "https://raw.githubusercontent.com/elkoled/ci-artifacts/refs/heads/process-replay/"
REF_COMMIT_FN = os.path.join(PROC_REPLAY_DIR, "ref_commit")
EXCLUDED_PROCS = {"modeld", "dmonitoringmodeld"}

Expand Down Expand Up @@ -188,10 +188,6 @@ def test_process(cfg, lr, segment, ref_log_msgs, new_log_path, ignore_fields=Non
if cfg.proc_name not in tested_procs:
continue

# to speed things up, we only test all segments on card
if cfg.proc_name not in ('card', 'controlsd', 'lagd') and car_brand not in ('HYUNDAI', 'TOYOTA'):
continue

cur_log_fn = os.path.join(FAKEDATA, f"{segment}_{cfg.proc_name}_{cur_commit}.zst".replace("|", "_"))
if args.update_refs: # reference logs will not exist if routes were just regenerated
ref_log_path = get_url(*segment.rsplit("--", 1,), "rlog.zst")
Expand Down
4 changes: 2 additions & 2 deletions system/hardware/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def read(self) -> float:
try:
with open(f"/sys/devices/virtual/thermal/thermal_zone{self.zone_number}/temp") as f:
return int(f.read()) / self.scale
except FileNotFoundError:
return 0
except Exception:
return float('nan')

@dataclass
class ThermalConfig:
Expand Down
6 changes: 6 additions & 0 deletions system/hardware/fan_controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
import math

import numpy as np

from openpilot.common.pid import PIDController
Expand All @@ -17,6 +19,10 @@ def update(self, cur_temp: float, ignition: bool) -> int:
self.controller.reset()
self.last_ignition = ignition

# guard against NaN/Inf from failed sensor reads
if not math.isfinite(cur_temp):
cur_temp = 0.

return int(self.controller.update(
error=(cur_temp - 75), # temperature setpoint in C
feedforward=np.interp(cur_temp, [60.0, 100.0], [0, 100])
Expand Down
14 changes: 10 additions & 4 deletions system/hardware/hardwared.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import fcntl
import math
import os
import queue
import struct
Expand Down Expand Up @@ -271,15 +272,20 @@ def hardware_thread(end_event, hw_queue) -> None:
msg.deviceState.screenBrightnessPercent = HARDWARE.get_screen_brightness()

# this subset is only used for offroad
# filter out NaN values from failed sensor reads
def max_valid_temp(temps, default=0.):
valid = [t for t in temps if math.isfinite(t)]
return max(valid, default=default)

temp_sources = [
msg.deviceState.memoryTempC,
max(msg.deviceState.cpuTempC, default=0.),
max(msg.deviceState.gpuTempC, default=0.),
msg.deviceState.memoryTempC if math.isfinite(msg.deviceState.memoryTempC) else 0.,
max_valid_temp(msg.deviceState.cpuTempC),
max_valid_temp(msg.deviceState.gpuTempC),
]
offroad_comp_temp = offroad_temp_filter.update(max(temp_sources))

# this drives the thermal status while onroad
temp_sources.append(max(msg.deviceState.pmicTempC, default=0.))
temp_sources.append(max_valid_temp(msg.deviceState.pmicTempC))
all_comp_temp = all_temp_filter.update(max(temp_sources))
msg.deviceState.maxTempC = all_comp_temp

Expand Down
14 changes: 10 additions & 4 deletions system/hardware/tici/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,18 @@ def get_serial(self):
return self.get_cmdline()['androidboot.serialno']

def get_voltage(self):
with open("/sys/class/hwmon/hwmon1/in1_input") as f:
return int(f.read())
try:
with open("/sys/class/hwmon/hwmon1/in1_input") as f:
return int(f.read())
except Exception:
return 0

def get_current(self):
with open("/sys/class/hwmon/hwmon1/curr1_input") as f:
return int(f.read())
try:
with open("/sys/class/hwmon/hwmon1/curr1_input") as f:
return int(f.read())
except Exception:
return 0

def set_ir_power(self, percent: int):
if self.get_device_type() == "tizi":
Expand Down
Loading