Calibrationd: check size of valid_blocks without current (#23223)
parent
40dcc63823
commit
cd190dc85d
|
@ -106,7 +106,7 @@ class Calibrator():
|
|||
return before_current + after_current
|
||||
|
||||
def update_status(self):
|
||||
if self.valid_blocks > 0:
|
||||
if len(self.get_valid_idxs()) > 0:
|
||||
max_rpy_calib = np.array(np.max(self.rpys[self.get_valid_idxs()], axis=0))
|
||||
min_rpy_calib = np.array(np.min(self.rpys[self.get_valid_idxs()], axis=0))
|
||||
self.calib_spread = np.abs(max_rpy_calib - min_rpy_calib)
|
||||
|
@ -163,7 +163,7 @@ class Calibrator():
|
|||
self.block_idx += 1
|
||||
self.valid_blocks = max(self.block_idx, self.valid_blocks)
|
||||
self.block_idx = self.block_idx % INPUTS_WANTED
|
||||
if self.valid_blocks > 0:
|
||||
if len(self.get_valid_idxs()) > 0:
|
||||
self.rpy = np.mean(self.rpys[self.get_valid_idxs()], axis=0)
|
||||
|
||||
self.update_status()
|
||||
|
|
Loading…
Reference in New Issue