Upstream merge fixes

This commit is contained in:
Jason Wen
2023-09-06 01:05:01 -04:00
parent 27c485c621
commit 7dbbc001eb
4 changed files with 16 additions and 18 deletions
@@ -4,7 +4,6 @@ from common.numpy_fast import interp
from enum import IntEnum
from cereal import log, car
from common.params import Params
from common.realtime import sec_since_boot
from selfdrive.controls.lib.drive_helpers import LIMIT_ADAPT_ACC, LIMIT_MIN_ACC, LIMIT_MAX_ACC, LIMIT_SPEED_OFFSET_TH, \
LIMIT_MAX_MAP_DATA_AGE, CONTROL_N
from selfdrive.controls.lib.events import Events
@@ -264,12 +263,12 @@ class SpeedLimitController():
return self._source
def _update_params(self):
time = sec_since_boot()
if time > self._last_params_update + _PARAMS_UPDATE_PERIOD:
t = time.monotonic()
if t > self._last_params_update + _PARAMS_UPDATE_PERIOD:
self._is_enabled = self._params.get_bool("SpeedLimitControl")
self._offset_enabled = self._params.get_bool("SpeedLimitPercOffset")
_debug(f'Updated Speed limit params. enabled: {self._is_enabled}, with offset: {self._offset_enabled}')
self._last_params_update = time
self._last_params_update = t
def _update_calculations(self):
# Update current velocity offset (error)
@@ -280,7 +279,7 @@ class SpeedLimitController():
# cause a temp inactive transition if the controller is updated before controlsd sets actual cruise
# speed.
if not self._op_enabled_prev and self._op_enabled:
self._last_op_enabled_time = sec_since_boot()
self._last_op_enabled_time = time.monotonic()
# Update change tracking variables
self._speed_limit_changed = self._speed_limit != self._speed_limit_prev
@@ -302,7 +301,7 @@ class SpeedLimitController():
# Ignore if a minimum amount of time has not passed since activation. This is to prevent temp inactivations
# due to controlsd logic changing cruise setpoint when going active.
if self._v_cruise_setpoint_changed and \
sec_since_boot() > (self._last_op_enabled_time + _TEMP_INACTIVE_GUARD_PERIOD):
time.monotonic() > (self._last_op_enabled_time + _TEMP_INACTIVE_GUARD_PERIOD):
self.state = SpeedLimitControlState.tempInactive
return
@@ -2,7 +2,6 @@ import numpy as np
import time
from common.params import Params
from cereal import log
from common.realtime import sec_since_boot
from selfdrive.controls.lib.drive_helpers import LIMIT_ADAPT_ACC, LIMIT_MIN_SPEED, LIMIT_MAX_MAP_DATA_AGE, \
LIMIT_SPEED_OFFSET_TH, CONTROL_N, LIMIT_MIN_ACC, LIMIT_MAX_ACC
from selfdrive.modeld.constants import T_IDXS
@@ -163,10 +162,10 @@ class TurnSpeedController():
return speed_limit, 0., turn_sign
def _update_params(self):
time = sec_since_boot()
if time > self._last_params_update + 5.0:
t = time.monotonic()
if t > self._last_params_update + 5.0:
self._is_enabled = self._params.get_bool("TurnSpeedControl")
self._last_params_update = time
self._last_params_update = t
def _update_calculations(self):
# Update current velocity offset (error)
@@ -1,9 +1,9 @@
import numpy as np
import math
import time
from cereal import log
from common.numpy_fast import interp
from common.params import Params
from common.realtime import sec_since_boot
from common.conversions import Conversions as CV
from selfdrive.controls.lib.lateral_planner import TRAJECTORY_SIZE
from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX
@@ -144,10 +144,10 @@ class VisionTurnController():
self._lat_acc_overshoot_ahead = False
def _update_params(self):
time = sec_since_boot()
if time > self._last_params_update + 5.0:
t = time.monotonic()
if t > self._last_params_update + 5.0:
self._is_enabled = self._params.get_bool("TurnVisionControl")
self._last_params_update = time
self._last_params_update = t
def _update_calculations(self, sm):
# Get path polynomial approximation for curvature estimation from model data.
+4 -4
View File
@@ -84,10 +84,10 @@ procs = [
PythonProcess("uploader", "system.loggerd.uploader", always_run),
PythonProcess("statsd", "selfdrive.statsd", always_run),
PythonProcess("gpxd", "selfdrive.gpxd.gpxd"),
PythonProcess("gpxd_uploader", "selfdrive.gpxd.gpx_uploader", offroad=True),
PythonProcess("mapd", "selfdrive.mapd.mapd"),
PythonProcess("fleet_manager", "system.fleetmanager.fleet_manager", onroad=False, offroad=True),
PythonProcess("gpxd", "selfdrive.gpxd.gpxd", only_onroad),
PythonProcess("gpxd_uploader", "selfdrive.gpxd.gpx_uploader", always_run),
PythonProcess("mapd", "selfdrive.mapd.mapd", only_onroad),
PythonProcess("fleet_manager", "system.fleetmanager.fleet_manager", only_offroad),
# debug procs
NativeProcess("bridge", "cereal/messaging", ["./bridge"], notcar),