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 --log-level to ros2 bag play and record #1625

Merged
merged 2 commits into from
May 10, 2024

Conversation

r7vme
Copy link
Contributor

@r7vme r7vme commented Apr 24, 2024

Examples:

info

ros2 bag play rosbag2_2024_04_23-12_01_27/ --log-level info
[INFO] [1713967388.214619740] [rosbag2_player]: Set rate to 1
[INFO] [1713967388.383060294] [rosbag2_player]: Adding keyboard callbacks.
[INFO] [1713967388.383322290] [rosbag2_player]: Press SPACE for Pause/Resume
[INFO] [1713967388.383947615] [rosbag2_player]: Press CURSOR_RIGHT for Play Next Message
[INFO] [1713967388.384285062] [rosbag2_player]: Press CURSOR_UP for Increase Rate 10%
[INFO] [1713967388.384607737] [rosbag2_player]: Press CURSOR_DOWN for Decrease Rate 10%
[INFO] [1713967388.386311806] [rosbag2_player]: Playback until timestamp: -1
[INFO] [1713967390.580246159] [rosbag2_player]: Stopping playback.
[INFO] [1713967390.755944560] [rclcpp]: signal_handler(signum=2)

debug

ros2 bag play rosbag2_2024_04_23-12_01_27/ --log-level debug
[DEBUG] [1713967406.290722714] [rclcpp]: signal handler installed
[DEBUG] [1713967406.290799689] [rclcpp]: deferred_signal_handler(): waiting for SIGINT/SIGTERM or uninstall
[DEBUG] [1713967406.298048672] [pluginlib.ClassLoader]: Creating ClassLoader, base = rosbag2_storage::storage_interfaces::ReadWriteInterface, address = 0x63cf452e4340
[DEBUG] [1713967406.300786500] [pluginlib.ClassLoader]: Entering determineAvailableClasses()...
[DEBUG] [1713967406.300803318] [pluginlib.ClassLoader]: Processing xml file /home/r7vme/ws/install/rosbag2_storage/share/rosbag2_storage/test/rosbag2_storage/test_plugin.xml...
[DEBUG] [1713967406.300891790] [pluginlib.ClassLoader]: XML file specifies lookup name (i.e. magic name) = my_test_plugin.
[DEBUG] [1713967406.300907280] [pluginlib.ClassLoader]: XML file specifies lookup name (i.e. magic name) = my_read_only_test_plugin.
[DEBUG] [1713967406.300913918] [pluginlib.ClassLoader]: Processing xml file /home/r7vme/ws/install/rosbag2_storage_mcap/share/rosbag2_storage_mcap/plugin_description.xml...
[DEBUG] [1713967406.300956120] [pluginlib.ClassLoader]: XML file specifies lookup name (i.e. magic name) = mcap.
[DEBUG] [1713967406.300966477] [pluginlib.ClassLoader]: Processing xml file /home/r7vme/ws/install/rosbag2_storage_sqlite3/share/rosbag2_storage_sqlite3/plugin_description.xml...
[DEBUG] [1713967406.301001733] [pluginlib.ClassLoader]: XML file specifies lookup name (i.e. magic name) = sqlite3.
[DEBUG] [1713967406.301013964] [pluginlib.ClassLoader]: Exiting determineAvailableClasses()...
[DEBUG] [1713967406.301021444] [pluginlib.ClassLoader]: Finished constructring ClassLoader, base = rosbag2_storage::storage_interfaces::ReadWriteInterface, address = 0x63cf452e4340
[DEBUG] [1713967406.301036392] [pluginlib.ClassLoader]: Creating ClassLoader, base = rosbag2_storage::storage_interfaces::ReadOnlyInterface, address = 0x63cf4563a9b0
[DEBUG] [1713967406.303476865] [pluginlib.ClassLoader]: Entering determineAvailableClasses()...
[DEBUG] [1713967406.303487897] [pluginlib.ClassLoader]: Processing xml file /home/r7vme/ws/install/rosbag2_storage/share/rosbag2_storage/test/rosbag2_storage/test_plugin.xml...
[DEBUG] [1713967406.303559663] [pluginlib.ClassLoader]: XML file specifies lookup name (i.e. magic name) = my_test_plugin.
[DEBUG] [1713967406.303567099] [pluginlib.ClassLoader]: XML file specifies lookup name (i.e. magic name) = my_read_only_test_plugin.
[DEBUG] [1713967406.303577954] [pluginlib.ClassLoader]: Processing xml file /home/r7vme/ws/install/rosbag2_storage_mcap/share/rosbag2_storage_mcap/plugin_description.xml...
[DEBUG] [1713967406.303631795] [pluginlib.ClassLoader]: XML file specifies lookup name (i.e. magic name) = mcap.
...skipped...
[DEBUG] [1713967407.670974917] [rcl]: Finalizing node
[DEBUG] [1713967407.674591216] [rcl]: Node finalized
[INFO] [1713967407.674653174] [rclcpp]: signal_handler(signum=2)
[DEBUG] [1713967407.674662064] [rclcpp]: signal_handler(): notifying deferred signal handler
[DEBUG] [1713967407.674759349] [rclcpp]: deferred_signal_handler(): woken up due to SIGINT/SIGTERM or uninstall
[DEBUG] [1713967407.674777948] [rclcpp]: deferred_signal_handler(): shutting down
[DEBUG] [1713967407.674771623] [rcl]: Shutting down ROS client library, for context at address: 0x63cf45598ec0
[DEBUG] [1713967407.674822040] [rclcpp]: deferred_signal_handler(): shutting down rclcpp::Context @ 0x63cf455a4560, because it had shutdown_on_signal == true
[DEBUG] [1713967407.674864531] [rclcpp]: SignalHandler::uninstall(): notifying deferred signal handler
[DEBUG] [1713967407.674874613] [rclcpp]: deferred_signal_handler(): signal handling uninstalled
[DEBUG] [1713967407.674913747] [rclcpp]: signal handler uninstalled

@r7vme
Copy link
Contributor Author

r7vme commented Apr 24, 2024

@MichaelOrlov could you please take a look? this is draft PR to validate design. If design is OK, I'll add tests and also cover recorder

@MichaelOrlov MichaelOrlov self-requested a review April 24, 2024 17:24
@MichaelOrlov MichaelOrlov changed the title Add --log-level to ros2 bag play [WIP] Add --log-level to ros2 bag play Apr 24, 2024
@MichaelOrlov
Copy link
Contributor

@r7vme Thanks for the PR! The approach looks good to me. 👍

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.

lgtm with a couple of minor refactoring ideas.

ros2bag/ros2bag/verb/play.py Outdated Show resolved Hide resolved
rosbag2_py/src/rosbag2_py/_transport.cpp Outdated Show resolved Hide resolved
@r7vme r7vme force-pushed the rosbag-add-log-level branch 4 times, most recently from 0886fca to 4151c6e Compare May 6, 2024 07:45
@r7vme r7vme changed the title [WIP] Add --log-level to ros2 bag play Add --log-level to ros2 bag play May 6, 2024
@r7vme r7vme marked this pull request as ready for review May 6, 2024 07:54
@r7vme r7vme requested a review from a team as a code owner May 6, 2024 07:54
@r7vme r7vme requested review from gbiggs and hidmic and removed request for a team May 6, 2024 07:54
@r7vme
Copy link
Contributor Author

r7vme commented May 6, 2024

@MichaelOrlov @fujitatomoya thanks for review. Addressed comments and added test, ready for review

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.

lgtm with green CI, @r7vme thanks for iterating!

@fujitatomoya
Copy link
Contributor

@r7vme can you rebase this there are several commits ahead in mainline rolling? and then i can start the CI.

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>
@r7vme r7vme changed the title Add --log-level to ros2 bag play Add --log-level to ros2 bag play and record May 7, 2024
@r7vme
Copy link
Contributor Author

r7vme commented May 7, 2024

@fujitatomoya rebased

@fujitatomoya
Copy link
Contributor

CI:

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

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@fujitatomoya
Copy link
Contributor

@r7vme test failures are pretty much unrelated i think, but just in case can you also take a look?

@r7vme
Copy link
Contributor Author

r7vme commented May 8, 2024

@fujitatomoya No tests related to rosbag failed as far as I can see. Most failures for aarch64 are could not find definitions for vital function(s): 'abort' 'vfprintf' and for Windows DDS compiler test failed projectroot.src.core.ddsc.tests.CUnit_ddsc_whc_check_end_state.

@fujitatomoya
Copy link
Contributor

@MichaelOrlov i will leave this to you, since i do not have merge permission for this repo.

@MichaelOrlov
Copy link
Contributor

@r7vme @fujitatomoya We have a breakage on CI currently. Will wait until ros2/ros2#1560 (review) will be merged - then will re-run CI one more time.

@MichaelOrlov
Copy link
Contributor

Pulls: #1625
Gist: https://gist.githubusercontent.com/MichaelOrlov/9c08d8fab6ae11c1acdc4ac2e8992037/raw/ca588acacdb07218367a2e7b3b5a384acf202968/ros2.repos
BUILD args: --packages-above-and-dependencies ros2bag rosbag2_py rosbag2_tests
TEST args: --packages-above ros2bag rosbag2_py rosbag2_tests
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/13847

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

@MichaelOrlov
Copy link
Contributor

@r7vme Could you please address one new warning https://ci.ros2.org/job/ci_windows/21723/msbuild/new/ on Windows CI build?

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
@MichaelOrlov
Copy link
Contributor

@ros-pull-request-builder retest this please

@MichaelOrlov
Copy link
Contributor

Re-running Windows CI after attempting to fix the warning.

  • Windows Build Status

@MichaelOrlov MichaelOrlov merged commit 5a06430 into ros2:rolling May 10, 2024
14 checks passed
@MichaelOrlov
Copy link
Contributor

@r7vme Could you please help to backport this PR to the Iron and Humble?
We will do an "automatic" backport to Jazzy via mergify when #1632 will land on it.
However, backporting to the Iron and Humble via Mergefy doesn't make sense since the code base in the relevant places is different. It will be easier to do it manually.

@r7vme
Copy link
Contributor Author

r7vme commented May 13, 2024

Could you please help to backport this PR to the Iron and Humble?

@MichaelOrlov #1655 #1654

@MichaelOrlov
Copy link
Contributor

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented May 23, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 23, 2024
* Add log level parameter to rosbag play and record

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

* Fix warning with typecast and add test coverage for default constructors

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

---------

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Michael Orlov <michael.orlov@apex.ai>
(cherry picked from commit 5a06430)
MichaelOrlov pushed a commit that referenced this pull request May 23, 2024
* Add log level parameter to rosbag play and record
* Fix warning with typecast and add test coverage for default
constructors

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Roman Sokolkov <rsokolkov@gmail.com>
(cherry picked from commit 5a06430)
MichaelOrlov pushed a commit that referenced this pull request May 24, 2024
* Add log level parameter to rosbag play and record
* Fix warning with typecast and add test coverage for default
constructors

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Roman Sokolkov <rsokolkov@gmail.com>
(cherry picked from commit 5a06430)

Co-authored-by: Roman <rsokolkov@gmail.com>
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.

3 participants