Skip to content

Commit

Permalink
Fixed FileNotFoundError
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Humbel committed Apr 24, 2024
1 parent af82487 commit c0caf08
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def __init__(self):

# Open up logfile
self.logfile_name = f"lap_analyzer_{datetime.now().strftime('%d%m_%H%M')}.txt"
self.logfile_dir = os.path.join(RosPack().get_path('lap_analyser'), 'data', self.logfile_name)
self.logfile_par = os.path.join(RosPack().get_path('lap_analyser'), 'data')
self.logfile_dir = os.path.join(self.logfile_par, self.logfile_name)
if not os.path.exists(self.logfile_par):
os.makedirs(self.logfile_par)
with open(self.logfile_dir, 'w') as f:
f.write(f"Laps done on " + datetime.now().strftime('%d %b %H:%M:%S') + '\n')

Expand Down

0 comments on commit c0caf08

Please sign in to comment.