mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 13:02:09 +08:00
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:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 @@
|
||||
eac137f456f25bf138677315b7c4907e2fe9971b
|
||||
fa642b559758928289d8092f30bb9787eb9ebcf2
|
||||
|
||||
Reference in New Issue
Block a user