Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Add the --duration and --split flags to the python wrapper for rosbag.#2

Merged
wjwwood merged 1 commit intoros:masterfrom
mjcarroll:master
Aug 29, 2012
Merged

Add the --duration and --split flags to the python wrapper for rosbag.#2
wjwwood merged 1 commit intoros:masterfrom
mjcarroll:master

Conversation

@mjcarroll
Copy link
Copy Markdown
Member

Changing so that duration and size flags are recognized through the python command line.

Modification taken from https://code.ros.org/trac/ros/ticket/3810

Quote:
[moved from https://code.ros.org/trac/ros-pkg/ticket/5335]

Currently rosbag record doesn't support --duration argument (it ignores it).

It would be useful to have such feature, in particular to record multiple topics for a given time, since -l (number of messages) is not useful in such case (it records the same number of messages for each topic).

This affects to ros-electric, as well as previous version (at least, diamondback).

Changing so that duration and size flags are recognized through the python command line.
@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Aug 28, 2012

What is this change for? This diff doesn't seem to do much....

@mjcarroll
Copy link
Copy Markdown
Member Author

So the size and duration params can be passed without the need for the
split flag in the actual cpp binaries of rosbag.

The extra indent in the python wrapper makes it so that you have to have
the split flag in order for duration or size to take effect.

My use case was:

rosbag record --duration 30 topic1 topic2 topic3

Which should record a 30 second long bag, but instead records indefinitely.

~mc mobile

On Aug 28, 2012, at 19:57, William Woodall notifications@github.com wrote:

What is this change for? This diff doesn't seem to do much....


Reply to this email directly or view it on
GitHubhttps://github.com//pull/2#issuecomment-8111292.

@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Aug 29, 2012

As Dirk just pointed out to me, the indention is different.

There was some confusion though, because I thought in this instance the patch was incorrect, because --size and --duration are used by --split to indicate how to split bag files. But there seems to be the ability for --size and --duration to work independently of --split in the c++ implementation. Therefore the patch is valid.

I will apply this patch and that will make the behavior as follows:

rosbag record --duration 30 topic1 topic2 topic3 -> Records a 30 second bag file.
rosbag record --duration 30 --split topic1 topic2 topic3 -> Records indefinitely, splitting bag files at 30 second intervals

I will, however, also open an issue stating that --size and --duration so always specify overall recording and --split should be moved into --split-duration and --split-size which might be mutually exclusive options, but could be used with --duration and --size.

@mjcarroll
Copy link
Copy Markdown
Member Author

I can probably add that, as it's something that I'm interested in.

And yes, I should have told you it was just a few indents. It was noted in
the original issue, but I didn't copy it over.

~mc mobile

On Aug 28, 2012, at 20:19, William Woodall notifications@github.com wrote:

As Dirk just pointed out to me, the indention is different.

There was some confusion though, because I thought in this instance the
patch was incorrect, because --size and --duration are used by --split to
indicate how to split bag files. But there seems to be the ability for
--size and --duration to work independently of --split in the c++
implementation. Therefore the patch is valid.

I will apply this patch and that will make the behavior as follows:

rosbag record --duration 30 topic1 topic2 topic3 -> Records a 30 second bag
file.
rosbag record --duration 30 --split topic1 topic2 topic3 -> Records
indefinitely, splitting bag files at 30 second intervals

I will, however, also open an issue stating that --size and --duration so
always specify overall recording and --split should be moved into
--split-duration and --split-size which might be mutually exclusive
options, but could be used with --duration and --size.


Reply to this email directly or view it on
GitHubhttps://github.com//pull/2#issuecomment-8111641.

@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Aug 29, 2012

The issue is here: #4

wjwwood added a commit that referenced this pull request Aug 29, 2012
rosbag: Allow the `--duration` and `--size` flags to work with or without the `--split` flag.
@wjwwood wjwwood merged commit bafbdad into ros:master Aug 29, 2012
tfoote pushed a commit that referenced this pull request Jun 17, 2016
Adding apparmor profiles and readme
tfoote pushed a commit that referenced this pull request Aug 11, 2016
contradict pushed a commit to contradict/ros_comm that referenced this pull request Aug 12, 2016
rqt_nav_view: initial import from external
contradict pushed a commit to contradict/ros_comm that referenced this pull request Aug 12, 2016
ggallagher01 pushed a commit to ggallagher01/ros_comm that referenced this pull request Dec 27, 2016
NIM-2725 Add logging around publisherUpdate and Inbound failures
rsinnet referenced this pull request in MisoRobotics/ros_comm Jun 19, 2017
rosbag: Allow the `--duration` and `--size` flags to work with or without the `--split` flag.
Nickolaim added a commit to Nickolaim/ros_comm that referenced this pull request Mar 2, 2018
johnsonshih added a commit to johnsonshih/ros_comm that referenced this pull request Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants