SubMaster: init services as invalid (#33513)

* SubMaster: init services as invalid

* fix sim

* update refs

* cpp too

* update refs

* model ref
This commit is contained in:
Adeeb Shihadeh
2024-09-07 16:31:49 -07:00
committed by GitHub
parent 584eb373cd
commit e3f05db3e0
5 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ class SubMaster:
self.data[s] = getattr(data.as_reader(), s)
self.logMonoTime[s] = 0
self.valid[s] = True # FIXME: this should default to False
self.valid[s] = False
self.freq_tracker[s] = FrequencyTracker(SERVICE_LIST[s].frequency, self.update_freq, s == poll)
def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader:
+1 -1
View File
@@ -34,7 +34,7 @@ struct SubMaster::SubMessage {
std::string name;
SubSocket *socket = nullptr;
int freq = 0;
bool updated = false, alive = false, valid = true, ignore_alive;
bool updated = false, alive = false, valid = false, ignore_alive;
uint64_t rcv_time = 0, rcv_frame = 0;
void *allocated_msg_reader = nullptr;
bool is_polled = false;
+3 -1
View File
@@ -73,7 +73,7 @@ class SelfdriveD:
'controlsState', 'carControl', 'driverAssistance'] + \
self.camera_packets + self.sensor_packets + self.gps_packets,
ignore_alive=ignore, ignore_avg_freq=ignore+['radarState',],
frequency=int(1/DT_CTRL))
ignore_valid=ignore, frequency=int(1/DT_CTRL))
# read params
self.is_metric = self.params.get_bool("IsMetric")
@@ -365,8 +365,10 @@ class SelfdriveD:
available_streams = VisionIpcClient.available_streams("camerad", block=False)
if VisionStreamType.VISION_STREAM_ROAD not in available_streams:
self.sm.ignore_alive.append('roadCameraState')
self.sm.ignore_valid.append('roadCameraState')
if VisionStreamType.VISION_STREAM_WIDE_ROAD not in available_streams:
self.sm.ignore_alive.append('wideRoadCameraState')
self.sm.ignore_valid.append('wideRoadCameraState')
if REPLAY and any(ps.controlsAllowed for ps in self.sm['pandaStates']):
self.state_machine.state = State.enabled
@@ -1 +1 @@
8726813f978d6baf519055f3105350cd071741f3
32fe8cf4a0daa8d10a689c9ae2e51a879151c87c
+1 -1
View File
@@ -1 +1 @@
eac137f456f25bf138677315b7c4907e2fe9971b
fa642b559758928289d8092f30bb9787eb9ebcf2