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

expose rate-control-topic and rate-control-max-delay args to command … #1015

Merged
merged 1 commit into from
Mar 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/rosbag/src/rosbag/rosbag_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ def play_cmd(argv):
parser.add_option("--pause-topics", dest="pause_topics", default=[], callback=handle_pause_topics, action="callback", help="topics to pause on during playback")
parser.add_option("--bags", help="bags files to play back from")
parser.add_option("--wait-for-subscribers", dest="wait_for_subscribers", default=False, action="store_true", help="wait for at least one subscriber on each topic before publishing")
parser.add_option("--rate-control-topic", dest="rate_control_topic", default='', type='str', help="watch the given topic, and if the last publish was more than <rate-control-max-delay> ago, wait until the topic publishes again to continue playback")
parser.add_option("--rate-control-max-delay", dest="rate_control_max_delay", default=1.0, type='float', help="maximum time difference from <rate-control-topic> before pausing")

(options, args) = parser.parse_args(argv)

Expand Down Expand Up @@ -269,6 +271,12 @@ def play_cmd(argv):
if options.topics or options.pause_topics:
cmd.extend(['--bags'])

if options.rate_control_topic:
cmd.extend(['--rate-control-topic', str(options.rate_control_topic)])

if options.rate_control_max_delay:
cmd.extend(['--rate-control-max-delay', str(options.rate_control_max_delay)])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jihoonl Inserting this between --bags and args broke the feature to pass topics or pausing topics. See #1156 for the necessary fix.

cmd.extend(args)

old_handler = signal.signal(
Expand Down