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

Add optional '--topics' CLI argument for 'ros2 bag record' #1632

Merged

Conversation

MichaelOrlov
Copy link
Contributor

Motivation:

ros2 bag record --services service1 service2 -- topic1 topic2 --output path/to/bag

It works currently, if put a trailing -- after the list of services. However, that workaround with trailing -- is not obvious and could cause confusion and be a source of mistakes because the topics parameter can't be specified explicitly. i.e., --topics.

List of changes:

  • Add optional "--topics" parameter for the ros2 bag record CLI interface.
  • Deprecate the positional "topics" parameter to be consistent with the"--services" parameter.
  • Add test coverage for non-trivial cases in the recorder CLI parser.
  • Use the optional "--topics" parameter instead of the deprecated positional parameter in integration tests.

Note: There are no API/ABI breaking changes in this PR

- Deprecate positional "topics" parameter.
- Add test coverage for non-trivial cases in the recorder CLI parser.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
@MichaelOrlov MichaelOrlov marked this pull request as ready for review May 2, 2024 06:24
@MichaelOrlov MichaelOrlov requested a review from a team as a code owner May 2, 2024 06:24
@MichaelOrlov MichaelOrlov requested review from gbiggs, hidmic, fujitatomoya and Barry-Xu-2018 and removed request for a team, gbiggs and hidmic May 2, 2024 06:24
@MichaelOrlov MichaelOrlov changed the title Add optional --topics CLI argument for ros2 bag record Add optional '--topics' CLI argument for 'ros2 bag record' May 2, 2024
ros2bag/ros2bag/verb/record.py Outdated Show resolved Hide resolved
ros2bag/ros2bag/verb/record.py Outdated Show resolved Hide resolved
ros2bag/ros2bag/verb/record.py Outdated Show resolved Hide resolved
ros2bag/ros2bag/verb/record.py Outdated Show resolved Hide resolved
ros2bag/ros2bag/verb/record.py Outdated Show resolved Hide resolved
ros2bag/ros2bag/verb/record.py Show resolved Hide resolved
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
@Barry-Xu-2018
Copy link
Contributor

LGTM

@MichaelOrlov
Copy link
Contributor Author

@clalancette @emersonknapp I need a formal review/approval for this PR.

Copy link
Contributor

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

@MichaelOrlov lgtm with minor comment. thanks!

ros2bag/ros2bag/verb/record.py Outdated Show resolved Hide resolved
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
@MichaelOrlov MichaelOrlov force-pushed the morlov/add_optional--topics_cli_argument_for_recorder branch from bb525b8 to df50851 Compare May 4, 2024 04:22
@MichaelOrlov
Copy link
Contributor Author

Gist: https://gist.githubusercontent.com/MichaelOrlov/dc71cf596e1d88b0a21fc5b572384bd1/raw/b77faf036884f4558a559c99f6f6d8c6c4c8f617/ros2.repos
BUILD args: --packages-above-and-dependencies ros2bag rosbag2_tests
TEST args: --packages-above ros2bag rosbag2_tests
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/13819

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@MichaelOrlov
Copy link
Contributor Author

@clalancette @emersonknapp Friendly ping here for formal review/approval.

Copy link
Collaborator

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

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

haven't read all the way through but I'm now coming off my parental leave and trying to get back into the ros2 development. this looks fine at a glance to me

@MichaelOrlov MichaelOrlov merged commit 9146878 into rolling May 7, 2024
14 checks passed
@delete-merged-branch delete-merged-branch bot deleted the morlov/add_optional--topics_cli_argument_for_recorder branch May 7, 2024 00:15
@MichaelOrlov
Copy link
Contributor Author

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented May 7, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 7, 2024
* Add optional "--topics" CLI parameter for recorder

- Deprecate positional "topics" parameter.
- Add test coverage for non-trivial cases in the recorder CLI parser.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Use "--topics" instead of positional argument in integration tests

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Cleanup in the recorder CLI help section

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Add empty line to the end of the pytest.ini

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Add deprecation notice for positional topics argument in help section

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 9146878)
MichaelOrlov added a commit that referenced this pull request May 23, 2024
* Add optional "--topics" CLI parameter for recorder

- Deprecate positional "topics" parameter.
- Add test coverage for non-trivial cases in the recorder CLI parser.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Use "--topics" instead of positional argument in integration tests

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Cleanup in the recorder CLI help section

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Add empty line to the end of the pytest.ini

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Add deprecation notice for positional topics argument in help section

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 9146878)
MichaelOrlov added a commit that referenced this pull request May 23, 2024
…ackport #1632) (#1640)

* Add optional  '--topics' CLI argument for 'ros2 bag record' (#1632)

* Add optional "--topics" CLI parameter for recorder

- Deprecate positional "topics" parameter.
- Add test coverage for non-trivial cases in the recorder CLI parser.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Use "--topics" instead of positional argument in integration tests

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Cleanup in the recorder CLI help section

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Add empty line to the end of the pytest.ini

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Add deprecation notice for positional topics argument in help section

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 9146878)

* Remove warning about deprecation of the positional "topics" argument

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Michael Orlov <michael.orlov@apex.ai>
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

Successfully merging this pull request may close these issues.

4 participants