Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logplayer: Show indictor of time till next message (when large) #438

Open
judfs opened this issue Apr 6, 2023 · 0 comments
Open

logplayer: Show indictor of time till next message (when large) #438

judfs opened this issue Apr 6, 2023 · 0 comments

Comments

@judfs
Copy link
Contributor

judfs commented Apr 6, 2023

When lcm-logplayer-gui is waiting is waiting for another message, the gui appears as though it is stalled. The internal timer continues to tick, but there is no user feedback that things are still working.

I was trying to play a log I collected. I hit this behavior and my first thought was my log somehow got corrupted and it somehow ended up breaking the player. But actually when recording the log, my data source was just down for several minutes. However there is no indication in the log player that the next message actually will come.

Kind of surprising, but I guess useful, hitting pause+play will skip waiting and will jump to the next message instead of pausing a playback timer.

I actually have now clue how I would like this displayed. Would be simple to add print statements to command line player if desired. Might at the minimum also be useful for the gui version.


A script to create a log with a large content break. Using examples/python dir/types:

import lcm
import time
import datetime

from exlcm import example_t

lc = lcm.LCM()

msg = example_t()
msg.timestamp = int(time.time() * 1000000)
msg.position = (1, 2, 3)
msg.orientation = (1, 0, 0, 0)
msg.ranges = range(15)
msg.num_ranges = len(msg.ranges)
msg.name = "example string"
msg.enabled = True


logname = "stalled.lcmlog"
log = lcm.EventLog(logname, "w", overwrite=True)

unit_to_micro = lambda x: int(x * 1e6)

channel = "EXAMPLE"

t0 = datetime.datetime.fromisoformat("2021-02-03").timestamp()  # Arbitrary fixed point
t0 = unit_to_micro(t0)

clock_s = 0

# 30s of 1hz data
duration = 30
for i in range(clock_s, clock_s + duration):
    msg.name = f"e{i}"
    mu_i = unit_to_micro(i)
    log.write_event(t0 + mu_i, channel, msg.encode())
clock_s += duration


# Wait 2 min
clock_s += 2 * 60

# After waiting data continues to flow in.
duration = 5 * 60
for i in range(clock_s, clock_s + duration):
    msg.name = f"e{i}"
    mu_i = unit_to_micro(i)
    log.write_event(t0 + mu_i, channel, msg.encode())
clock_s += duration

#
log.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant