src/tools/benchmark_tool/benchmark_tool/benchmark_task/ndt_matching_task.py
def init(self):
        """
        Initialize the task structure.

        The task computes one metric:
            - speed

        @return: True on success, False on failure
        """
        input_topic = getParameter(self.node, "input_topic")
        benchmarked_out_topic = getParameter(self.node, "benchmarked_output_topic")
        result_path = getParameter(self.node, "result_path")
        end_frame = getParameter(self.node, "force_end_at_frame_n")

        if end_frame <= 0:
            error(self.node, "The force_end_at_frame_n parameter has to be positive" +
                  " and greater from zero.")
            return False

        # Load TimeEstimator to get the speed metric
        self._time_estimator = TimeEstimatorHeader(self.node)

        # Load the speed output formatter to get the output of the TimeEstimator
        # and save it to a file
        self._speed_formatter = GenericStreamFormatter(
            self.node,
            result_path + self.SPEED_METRIC_RESULT_PATH,
            self.SPEED_MEASURE_FILE_NAME
        )

        # Prepare the speed metric object
        self._speed_metric = AverageMetric(
            self.node,
            (result_path + self.SPEED_METRIC_RESULT_PATH),
            (result_path + self.SPEED_METRIC_OUTPUT_PATH),
            self.SPEED_MEASURE_FILE_NAME,
            self.SPEED_METRIC_OUTPUT_NAME
        )

        # Create the Player to play the data to the ndt_matching node
        self._data_player = SyncedExternalPlayer(self.node)
        if not self._data_player.add_track(
                input_topic,
                "/replay" + input_topic,
                benchmarked_out_topic,
                self.POINT_CLOUD_TRACK_MIN_SUBS,
                self.POINT_CLOUD_TRACK_RATE_HZ,
                end_frame,
                120000):
            error(self.node, "There is a problem initializing the player")
            return False

        if not self._time_estimator.start_listener(benchmarked_out_topic,
                                                   self.SPEED_METRIC_TOPIC):
            error(self.node,
                  "There is a problem initializing the TimeEstimator")
            return False

        # Listen to the speed metric
        if not self._speed_formatter.start_output_listener(
                self.SPEED_METRIC_TOPIC,
                Int64
        ):
            error(self.node, "Problem initializing the speed metric listener")
            return False

        # Everything is fine
        return True

        Initialize the task structure.

        The task computes one metric:
            - speed

        @return: True on success, False on failure
        
Initialize the task structure.
The task computes one metric:
speed
Initialize the task structure . The task computes one metric : speed
def init(self):
        input_topic = getParameter(self.node, "input_topic")
        benchmarked_out_topic = getParameter(self.node, "benchmarked_output_topic")
        result_path = getParameter(self.node, "result_path")
        end_frame = getParameter(self.node, "force_end_at_frame_n")
        if end_frame <= 0:
            error(self.node, "The force_end_at_frame_n parameter has to be positive" +
                  " and greater from zero.")
            return False
        self._time_estimator = TimeEstimatorHeader(self.node)
        self._speed_formatter = GenericStreamFormatter(
            self.node,
            result_path + self.SPEED_METRIC_RESULT_PATH,
            self.SPEED_MEASURE_FILE_NAME
        )
        self._speed_metric = AverageMetric(
            self.node,
            (result_path + self.SPEED_METRIC_RESULT_PATH),
            (result_path + self.SPEED_METRIC_OUTPUT_PATH),
            self.SPEED_MEASURE_FILE_NAME,
            self.SPEED_METRIC_OUTPUT_NAME
        )
        self._data_player = SyncedExternalPlayer(self.node)
        if not self._data_player.add_track(
                input_topic,
                "/replay" + input_topic,
                benchmarked_out_topic,
                self.POINT_CLOUD_TRACK_MIN_SUBS,
                self.POINT_CLOUD_TRACK_RATE_HZ,
                end_frame,
                120000):
            error(self.node, "There is a problem initializing the player")
            return False
        if not self._time_estimator.start_listener(benchmarked_out_topic,
                                                   self.SPEED_METRIC_TOPIC):
            error(self.node,
                  "There is a problem initializing the TimeEstimator")
            return False
        if not self._speed_formatter.start_output_listener(
                self.SPEED_METRIC_TOPIC,
                Int64
        ):
            error(self.node, "Problem initializing the speed metric listener")
            return False
        return True
def init ( self ) : input_topic = getParameter ( self . node , "input_topic" ) benchmarked_out_topic = getParameter ( self . node , "benchmarked_output_topic" ) result_path = getParameter ( self . node , "result_path" ) end_frame = getParameter ( self . node , "force_end_at_frame_n" ) if end_frame <= 0 : error ( self . node , "The force_end_at_frame_n parameter has to be positive" + " and greater from zero." ) return False self . _time_estimator = TimeEstimatorHeader ( self . node ) self . _speed_formatter = GenericStreamFormatter ( self . node , result_path + self . SPEED_METRIC_RESULT_PATH , self . SPEED_MEASURE_FILE_NAME ) self . _speed_metric = AverageMetric ( self . node , ( result_path + self . SPEED_METRIC_RESULT_PATH ) , ( result_path + self . SPEED_METRIC_OUTPUT_PATH ) , self . SPEED_MEASURE_FILE_NAME , self . SPEED_METRIC_OUTPUT_NAME ) self . _data_player = SyncedExternalPlayer ( self . node ) if not self . _data_player . add_track ( input_topic , "/replay" + input_topic , benchmarked_out_topic , self . POINT_CLOUD_TRACK_MIN_SUBS , self . POINT_CLOUD_TRACK_RATE_HZ , end_frame , 120000 ) : error ( self . node , "There is a problem initializing the player" ) return False if not self . _time_estimator . start_listener ( benchmarked_out_topic , self . SPEED_METRIC_TOPIC ) : error ( self . node , "There is a problem initializing the TimeEstimator" ) return False if not self . _speed_formatter . start_output_listener ( self . SPEED_METRIC_TOPIC , Int64 ) : error ( self . node , "Problem initializing the speed metric listener" ) return False return True
Initialize the task structure.
Initialize the task structure .
"""
        Initialize the task structure.

        The task computes one metric:
            - speed

        @return: True on success, False on failure
        """ # Load TimeEstimator to get the speed metric # Load the speed output formatter to get the output of the TimeEstimator # and save it to a file # Prepare the speed metric object # Create the Player to play the data to the ndt_matching node # Listen to the speed metric # Everything is fine
True on success, False on failure
True on success False on failure
self