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

rosbag play --topics is broken #620

Closed
mintar opened this issue Jun 3, 2015 · 10 comments

Comments

Projects
None yet
4 participants
@mintar
Copy link
Contributor

commented Jun 3, 2015

On Indigo, I couldn't find a way to get rosbag play --topics to work. IIRC, on Hydro, the following used to work, but produces an error on Indigo:

$ rosbag play mybag.bag --clock --topics /mytopic
[ERROR] [1433321952.976544128]: Error reading options: When using --topics or --pause-topics, --bags should be specified to list bags.

Ok, so I tried to humor rosbag:

$ rosbag play --clock --topics /mytopic --bags mybag.bag  
Usage: rosbag play BAGFILE1 [BAGFILE2 BAGFILE3 ...]

rosbag: error: You must specify at least 1 bag file to play back.

Last try:

$ rosbag play mybag.bag --clock --topics /mytopic --bags mybag.bag
[ INFO] [1433321989.060645972]: Opening mybag.bag
[ INFO] [1433321989.061010974]: Opening mybag.bag

Waiting 0.2 seconds after advertising topics... done.

Hit space to toggle paused, or 's' to step.

This doesn't produce an error, but of course now every message is replayed twice. Did I miss something obvious, or is this a regression from Hydro?

@mintar

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2015

Update: Just confirmed that the first variant (rosbag play mybag.bag --clock --topics /mytopic) works in Hydro.

Versions:

  • hydro: rosbag 1.10.12 (works)
  • indigo: rosbag 1.11.13 (broken)
@mintar

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2015

Update: This was introduced in b7796fe by @gerkey : in line 238, setting the --bags arg was removed.

@mintar

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2015

So, in summary the problem is this. This is how this worked in hydro:

rosbag play mybag.bag --clock --topics /mytopic
  1. are positional args for bag files present? yes (here)
  2. is --topics set? yes => add --bags to args (here)
  3. is --topics set, but not --bags? no (otherwise exception) (here)

In b7796fe, number (2) was removed, causing this bug.

So, what to do about this?

  1. restore the old behavior by adding --bags if --topics (and now presumably --pause-topics) is present, or
  2. don't require positional args if --bags is present, or
  3. rewrite the argument parser using argparse instead of optparse?
@dirk-thomas

This comment has been minimized.

Copy link
Member

commented Jun 9, 2015

Fixed with #624

@dirk-thomas dirk-thomas closed this Jun 9, 2015

@v4hn

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2015

Hey guys,

would be great to see this fix in a release!
Until now --topics is still broken in the latest release.

@mintar

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2015

The fix has still not been released into Indigo. Could we get another release please?

@dirk-thomas

This comment has been minimized.

Copy link
Member

commented Nov 9, 2015

The patch has been released a while ago and is sitting in shadow-fixed for a soak time. Due to other regressions it will sit there a bit more until it can be synced to the public repo.

@nicolaerosia

This comment has been minimized.

Copy link

commented Oct 5, 2017

this seems to be broken on Lunar:

user@ubuntu1704:~/bagfiles$ rosbag play --clock --topics /mytopic 2017-10-05-16-53-43.bag 
Usage: rosbag play BAGFILE1 [BAGFILE2 BAGFILE3 ...]

rosbag: error: You must specify at least 1 bag file to play back.
@dirk-thomas

This comment has been minimized.

Copy link
Member

commented Oct 5, 2017

@nicolaerosia A recent regression has been fixed in #1156 which will be available with the next patch release.

@nicolaerosia

This comment has been minimized.

Copy link

commented Oct 6, 2017

@dirk-thomas I should have searched more, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.