Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion selfdrive/debug/fingerprint_from_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ def get_fingerprint(lr):
sys.exit(1)

route = Route(sys.argv[1])
lr = MultiLogIterator(route.log_paths()[:5], wraparound=False)
lr = MultiLogIterator(route.log_paths()[:5])
get_fingerprint(lr)
2 changes: 1 addition & 1 deletion selfdrive/debug/run_process_on_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
cfg = [c for c in CONFIGS if c.proc_name == args.process][0]

route = Route(args.route)
lr = MultiLogIterator(route.log_paths(), wraparound=False)
lr = MultiLogIterator(route.log_paths())
inputs = list(lr)

outputs = replay_process(cfg, inputs)
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/debug/toyota_eps_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ def get_eps_factor(lr, plot=False):

if __name__ == "__main__":
r = Route(sys.argv[1])
lr = MultiLogIterator(r.log_paths(), wraparound=False)
lr = MultiLogIterator(r.log_paths())
n = get_eps_factor(lr, plot="--plot" in sys.argv)
print("EPS torque factor: ", n)
9 changes: 2 additions & 7 deletions tools/lib/logreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

# this is an iterator itself, and uses private variables from LogReader
class MultiLogIterator:
def __init__(self, log_paths, wraparound=False, sort_by_time=False):
def __init__(self, log_paths, sort_by_time=False):
self._log_paths = log_paths
self._wraparound = wraparound

self._first_log_idx = next(i for i in range(len(log_paths)) if log_paths[i] is not None)
self._current_log = self._first_log_idx
Expand All @@ -42,12 +41,8 @@ def _inc(self):
self._idx = 0
self._current_log = next(i for i in range(self._current_log + 1, len(self._log_readers) + 1)
if i == len(self._log_readers) or self._log_paths[i] is not None)
# wraparound
if self._current_log == len(self._log_readers):
if self._wraparound:
self._current_log = self._first_log_idx
else:
raise StopIteration
raise StopIteration

def __next__(self):
while 1:
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/save_ubloxraw_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def main(argv):
args.data_dir = os.path.dirname(args.data_dir)

route = Route(args.route_name, args.data_dir)
lr = MultiLogIterator(route.log_paths(), wraparound=False)
lr = MultiLogIterator(route.log_paths())

with open(args.out_path, 'wb') as f:
try:
Expand Down