From d806f17ea28c05a47c64ad816a7f66e55788b046 Mon Sep 17 00:00:00 2001 From: Roman Sokolkov Date: Wed, 31 Jul 2024 13:55:25 +0300 Subject: [PATCH] Add cli option compression-threads-priority Signed-off-by: Roman Sokolkov --- ros2bag/ros2bag/verb/record.py | 5 +++++ rosbag2_py/src/rosbag2_py/_transport.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/ros2bag/ros2bag/verb/record.py b/ros2bag/ros2bag/verb/record.py index 733ff360a..1f63ee05f 100644 --- a/ros2bag/ros2bag/verb/record.py +++ b/ros2bag/ros2bag/verb/record.py @@ -194,6 +194,10 @@ def add_recorder_arguments(parser: ArgumentParser) -> None: '--compression-threads', type=int, default=0, help='Number of files or messages that may be compressed in parallel. ' 'Default is %(default)d, which will be interpreted as the number of CPU cores.') + parser.add_argument( + '--compression-threads-priority', type=int, default=0, + help='Thread scheduling priority. For Linux nice value. For Windows SetThreadPriority argument value. ' + 'Default is %(default)d.') parser.add_argument( '--compression-mode', type=str, default='none', choices=['none', 'file', 'message'], @@ -338,6 +342,7 @@ def main(self, *, args): # noqa: D102 record_options.compression_format = args.compression_format record_options.compression_queue_size = args.compression_queue_size record_options.compression_threads = args.compression_threads + record_options.compression_threads_priority = args.compression_threads_priority record_options.topic_qos_profile_overrides = qos_profile_overrides record_options.include_hidden_topics = args.include_hidden_topics record_options.include_unpublished_topics = args.include_unpublished_topics diff --git a/rosbag2_py/src/rosbag2_py/_transport.cpp b/rosbag2_py/src/rosbag2_py/_transport.cpp index a92dd3684..9d15e82b1 100644 --- a/rosbag2_py/src/rosbag2_py/_transport.cpp +++ b/rosbag2_py/src/rosbag2_py/_transport.cpp @@ -573,6 +573,7 @@ PYBIND11_MODULE(_transport, m) { .def_readwrite("compression_format", &RecordOptions::compression_format) .def_readwrite("compression_queue_size", &RecordOptions::compression_queue_size) .def_readwrite("compression_threads", &RecordOptions::compression_threads) + .def_readwrite("compression_threads_priority", &RecordOptions::compression_threads_priority) .def_property( "topic_qos_profile_overrides", &RecordOptions::getTopicQoSProfileOverrides,