diff --git a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/cpu_usage_plotter.py b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/cpu_usage_plotter.py index 76199dde..1ab0cdd6 100644 --- a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/cpu_usage_plotter.py +++ b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/cpu_usage_plotter.py @@ -4,7 +4,7 @@ from .system_performance_plotter_base import PREDEFINED_COMPONENT_NAMES from .system_performance_plotter_base import SystemPerformancePlotterBase -from .system_performance_plotter_base import create_common_argment +from .system_performance_plotter_base import create_common_argument class CpuUsagePlotter(SystemPerformancePlotterBase): @@ -43,7 +43,7 @@ def update_metrics_func(self, topic_name, data, date_time): def main(): - args = create_common_argment(100) + args = create_common_argument(100) plotter = CpuUsagePlotter(args, "CPU Usage [%]", "_cpu_usage") plotter.run() diff --git a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/memory_usage_plotter.py b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/memory_usage_plotter.py index e0b9d265..ed8a32e4 100644 --- a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/memory_usage_plotter.py +++ b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/memory_usage_plotter.py @@ -4,7 +4,7 @@ from .system_performance_plotter_base import PREDEFINED_COMPONENT_NAMES from .system_performance_plotter_base import SystemPerformancePlotterBase -from .system_performance_plotter_base import create_common_argment +from .system_performance_plotter_base import create_common_argument class MemoryUsagePlotter(SystemPerformancePlotterBase): @@ -43,7 +43,7 @@ def update_metrics_func(self, topic_name, data, date_time): def main(): - args = create_common_argment() + args = create_common_argument() plotter = MemoryUsagePlotter(args, "Memory Usage [MiB]", "_memory_usage") plotter.run() diff --git a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py index 68a4d151..c27ae822 100644 --- a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py +++ b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py @@ -1,11 +1,13 @@ #!/usr/bin/env python3 -from tier4_debug_msgs.msg import Float32Stamped -from tier4_debug_msgs.msg import Float64Stamped +from autoware_internal_debug_msgs.msg import Float32Stamped +from autoware_internal_debug_msgs.msg import Float64Stamped +from tier4_debug_msgs.msg import Float32Stamped as Tier4Float32Stamped +from tier4_debug_msgs.msg import Float64Stamped as Tier4Float64Stamped from .system_performance_plotter_base import PREDEFINED_COMPONENT_NAMES from .system_performance_plotter_base import SystemPerformancePlotterBase -from .system_performance_plotter_base import create_common_argment +from .system_performance_plotter_base import create_common_argument class ProcessingTimePlotter(SystemPerformancePlotterBase): @@ -30,7 +32,12 @@ def check_topic(self, topic_name): return True def update_metrics_func(self, topic_name, data, date_time): - if not isinstance(data, Float64Stamped) and not isinstance(data, Float32Stamped): + if ( + not isinstance(data, Tier4Float64Stamped) + and not isinstance(data, Tier4Float32Stamped) + and not isinstance(data, Float64Stamped) + and not isinstance(data, Float32Stamped) + ): return if topic_name not in self.stamp_and_metrics: @@ -43,7 +50,7 @@ def update_metrics_func(self, topic_name, data, date_time): def main(): - args = create_common_argment(100) + args = create_common_argument(100) plotter = ProcessingTimePlotter(args, "Processing Time [ms]", "_processing_time") plotter.run() diff --git a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/system_performance_plotter_base.py b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/system_performance_plotter_base.py index 76e73360..1fe33e55 100644 --- a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/system_performance_plotter_base.py +++ b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/system_performance_plotter_base.py @@ -22,8 +22,8 @@ "control", "system", ] -LINESTYLES = ["solid", "dashed"] -NUM_LINESTYLES = len(LINESTYLES) +LINE_STYLES = ["solid", "dashed"] +NUM_LINE_STYLES = len(LINE_STYLES) COLORS = plt.get_cmap("tab20") NUM_COLORS = len(COLORS.colors) @@ -118,7 +118,7 @@ def run(self): stamp = raw_data_arr[:, 0] rate = raw_data_arr[:, 1] color = COLORS(idx % NUM_COLORS) - linestyle = LINESTYLES[(idx // NUM_COLORS) % NUM_LINESTYLES] + linestyle = LINE_STYLES[(idx // NUM_COLORS) % NUM_LINE_STYLES] ax.plot(stamp, rate, label=name, color=color, linestyle=linestyle) self.report_data[name].append(np.round(rate.mean(), 3)) @@ -179,7 +179,7 @@ def run(self): plt.show() -def create_common_argment(ymax=None): +def create_common_argument(ymax=None): parser = argparse.ArgumentParser(description="report system performance from rosbag.") parser.add_argument("bag_file", help="input bagfile") parser.add_argument("-c", "--component-name", default="all", type=str, help="component name")