camerad: allow core affinity setting to fail while offroad (#22664)

Co-authored-by: Comma Device <device@comma.ai>
onroad-updated
Adeeb Shihadeh 2021-10-22 20:57:21 -07:00 committed by GitHub
parent 4749815419
commit cd5bc565d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -48,7 +48,7 @@ int main(int argc, char *argv[]) {
ret = set_realtime_priority(53);
assert(ret == 0);
ret = set_core_affinity({Hardware::EON() ? 2 : 6});
assert(ret == 0);
assert(ret == 0 || Params().getBool("IsOffroad")); // failure ok while offroad due to offlining cores
cl_device_id device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT);

View File

@ -11,7 +11,7 @@ import cereal.messaging as messaging
from common.params import Params
from common.realtime import DT_MDL
from common.transformations.camera import eon_f_frame_size, eon_d_frame_size, tici_f_frame_size
from selfdrive.hardware import HARDWARE, TICI
from selfdrive.hardware import TICI
from selfdrive.controls.lib.alertmanager import set_offroad_alert
from selfdrive.manager.process_config import managed_processes
@ -92,7 +92,6 @@ def snapshot():
os.environ["SEND_DRIVER"] = "1"
try:
HARDWARE.set_power_save(False)
managed_processes['camerad'].start()
frame = "wideRoadCameraState" if TICI else "roadCameraState"
front_frame = "driverCameraState" if front_camera_allowed else None
@ -101,8 +100,6 @@ def snapshot():
rear, front = get_snapshots(frame, front_frame, focus_perc_threshold)
finally:
managed_processes['camerad'].stop()
HARDWARE.set_power_save(True)
params.put_bool("IsTakingSnapshot", False)
set_offroad_alert("Offroad_IsTakingSnapshot", False)