Skip to content

Commit

Permalink
fixed mlog attribute in mavplayback
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymon-SR authored and peterbarker committed Feb 6, 2024
1 parent 55fcf4d commit bc1860a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/mavplayback.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ def pause(self):

def rewind(self):
'''rewind 10%'''
pos = int(self.mlog.f.tell() - 0.1*self.filesize)
pos = int(self.mlog.f.tell() - 0.1 * self.filesize)
if pos < 0:
pos = 0
self.mlog.filehandle.seek(pos)
self.mlog.f.seek(pos)
self.find_message()

def forward(self):
'''forward 10%'''
pos = int(self.mlog.f.tell() + 0.1*self.filesize)
pos = int(self.mlog.f.tell() + 0.1 * self.filesize)
if pos > self.filesize:
pos = self.filesize - 2048
self.mlog.filehandle.seek(pos)
self.mlog.f.seek(pos)
self.find_message()

def status(self):
Expand All @@ -158,7 +158,7 @@ def slew(self, value):
'''move to a given position in the file'''
if float(value) != self.filepos:
pos = float(value) * self.filesize
self.mlog.filehandle.seek(int(pos))
self.mlog.f.seek(int(pos))
self.find_message()


Expand Down

0 comments on commit bc1860a

Please sign in to comment.