From 8c1032568f4bbe8b901f80797cc6fcba9bdf0724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Mart=C3=ADnez=20Fari=C3=B1a?= Date: Tue, 30 May 2023 12:20:54 +0200 Subject: [PATCH] Generalized files for option and session_name. Integrated a1 with ros2_benchmark --- .../ros2_benchmark/default_ros2_benchmark_config.yaml | 5 +++++ ros2_benchmark/ros2_benchmark/ros2_benchmark_config.py | 3 ++- ros2_benchmark/ros2_benchmark/ros2_benchmark_test.py | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ros2_benchmark/ros2_benchmark/default_ros2_benchmark_config.yaml b/ros2_benchmark/ros2_benchmark/default_ros2_benchmark_config.yaml index 0a6675f..9967697 100644 --- a/ros2_benchmark/ros2_benchmark/default_ros2_benchmark_config.yaml +++ b/ros2_benchmark/ros2_benchmark/default_ros2_benchmark_config.yaml @@ -144,4 +144,9 @@ ros2_benchmark_config: input_data_start_time: -1 input_data_end_time: -1 + # Integration with benchmarks + # The option can be with or without the monitor node option: 'with_monitor_node' + # The session name is overwritten in the launch file + session_name: "" + diff --git a/ros2_benchmark/ros2_benchmark/ros2_benchmark_config.py b/ros2_benchmark/ros2_benchmark/ros2_benchmark_config.py index 0fbfb91..ccd4e91 100644 --- a/ros2_benchmark/ros2_benchmark/ros2_benchmark_config.py +++ b/ros2_benchmark/ros2_benchmark/ros2_benchmark_config.py @@ -103,7 +103,8 @@ class ROS2BenchmarkConfig(): 'linear_scan_acceptable_frame_rate_drop': float, 'input_data_start_time': float, 'input_data_end_time': float, - 'option': str + 'option': str, + 'session_name': str } def __init__(self, config_file_path: str = '', *args, **kw): diff --git a/ros2_benchmark/ros2_benchmark/ros2_benchmark_test.py b/ros2_benchmark/ros2_benchmark/ros2_benchmark_test.py index fb1d47c..26f77fc 100644 --- a/ros2_benchmark/ros2_benchmark/ros2_benchmark_test.py +++ b/ros2_benchmark/ros2_benchmark/ros2_benchmark_test.py @@ -190,8 +190,8 @@ def generate_test_description( ] ) - @staticmethod - def generate_test_description_with_nsys( + @classmethod + def generate_test_description_with_nsys(cls, launch_setup, node_startup_delay: float = 5.0 ) -> launch.LaunchDescription: """Generate a test launch description with the nsys capability built in.""" @@ -202,7 +202,7 @@ def generate_test_description_with_nsys( nodes = launch_args + [OpaqueFunction(function=bound_launch_setup)] trace = Trace( - session_name="a2_rectify_nvidia", + session_name= cls.config.session_name, events_ust=[ "robotperf_benchmarks:*", "ros2_image_pipeline:*",