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
Closed

rosbag play --topics is broken #620

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

Comments

@mintar
Copy link
Contributor

mintar 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
Copy link
Contributor Author

mintar 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
Copy link
Contributor Author

mintar commented Jun 4, 2015

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

@mintar
Copy link
Contributor Author

mintar 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
Copy link
Member

Fixed with #624

@v4hn
Copy link
Contributor

v4hn 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
Copy link
Contributor Author

mintar commented Nov 9, 2015

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

@dirk-thomas
Copy link
Member

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
Copy link

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
Copy link
Member

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

@nicolaerosia
Copy link

@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
Labels
Projects
None yet
Development

No branches or pull requests

4 participants