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

        The task computes two metrics:
            - speed
            - size of the input pointcloud (in bytes)

        @return: True on success, False on failure
        """
        dataset_path = getParameter(self.node, "dataset_path")
        input_topic = getParameter(self.node, "input_topic")
        output_topic = getParameter(self.node, "output_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 is None:
            end_frame = -1

        # Load the3D lidar dataset
        self._dataset = Kitti3DBenchmarkDataset(self.node, dataset_path)
        if not self._dataset.init():
            error(self.node,
                  "There is a problem initializing the dataset")
            return False

        if (end_frame >= 0):
            self._dataset.set_frame_limit(end_frame)

        # 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
        )

        # Load the size output formatter to get the input of the node
        # and save it to a file
        self._pointcloud_size_formatter = GenericStreamFormatter(
            self.node,
            result_path + self.SIZE_METRIC_RESULT_PATH,
            self.SIZE_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
        )

        # Prepare the size metric object
        self._pointcloud_size_metric = AverageMetric(
            self.node,
            (result_path + self.SIZE_METRIC_RESULT_PATH),
            (result_path + self.SIZE_METRIC_OUTPUT_PATH),
            self.SIZE_MEASURE_FILE_NAME,
            self.SIZE_METRIC_OUTPUT_NAME
        )

        # Create the Player to play the data to the lidar node
        self._data_player = SyncedPlayerFrameSize(
            self.node,
            self._dataset,
            self.SIZE_METRIC_TOPIC,
            [0]
        )
        if not self._data_player.add_track(
                self.POINT_CLOUD_DATASET_TRACK,
                input_topic,
                PointCloud2,
                output_topic,
                self.POINT_CLOUD_TRACK_MIN_SUBS,
                self.POINT_CLOUD_TRACK_RATE_HZ,
                self.POINT_CLOUD_TRACK_TIMEOUT_MS
        ):
            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

        # Listen to the size metric
        if not self._pointcloud_size_formatter.start_output_listener(
                self.SIZE_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 two metrics:
            - speed
            - size of the input pointcloud (in bytes)

        @return: True on success, False on failure
        
Initialize the task structure.
The task computes two metrics:
speed
size of the input pointcloud (in bytes)
Initialize the task structure . The task computes two metrics : speed size of the input pointcloud ( in bytes )
def init(self):
        dataset_path = getParameter(self.node, "dataset_path")
        input_topic = getParameter(self.node, "input_topic")
        output_topic = getParameter(self.node, "output_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 is None:
            end_frame = -1
        self._dataset = Kitti3DBenchmarkDataset(self.node, dataset_path)
        if not self._dataset.init():
            error(self.node,
                  "There is a problem initializing the dataset")
            return False
        if (end_frame >= 0):
            self._dataset.set_frame_limit(end_frame)
        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._pointcloud_size_formatter = GenericStreamFormatter(
            self.node,
            result_path + self.SIZE_METRIC_RESULT_PATH,
            self.SIZE_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._pointcloud_size_metric = AverageMetric(
            self.node,
            (result_path + self.SIZE_METRIC_RESULT_PATH),
            (result_path + self.SIZE_METRIC_OUTPUT_PATH),
            self.SIZE_MEASURE_FILE_NAME,
            self.SIZE_METRIC_OUTPUT_NAME
        )
        self._data_player = SyncedPlayerFrameSize(
            self.node,
            self._dataset,
            self.SIZE_METRIC_TOPIC,
            [0]
        )
        if not self._data_player.add_track(
                self.POINT_CLOUD_DATASET_TRACK,
                input_topic,
                PointCloud2,
                output_topic,
                self.POINT_CLOUD_TRACK_MIN_SUBS,
                self.POINT_CLOUD_TRACK_RATE_HZ,
                self.POINT_CLOUD_TRACK_TIMEOUT_MS
        ):
            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
        if not self._pointcloud_size_formatter.start_output_listener(
                self.SIZE_METRIC_TOPIC,
                Int64
        ):
            error(self.node,
                  "Problem initializing the speed metric listener")
            return False
        return True
def init ( self ) : dataset_path = getParameter ( self . node , "dataset_path" ) input_topic = getParameter ( self . node , "input_topic" ) output_topic = getParameter ( self . node , "output_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 is None : end_frame = - 1 self . _dataset = Kitti3DBenchmarkDataset ( self . node , dataset_path ) if not self . _dataset . init ( ) : error ( self . node , "There is a problem initializing the dataset" ) return False if ( end_frame >= 0 ) : self . _dataset . set_frame_limit ( end_frame ) 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 . _pointcloud_size_formatter = GenericStreamFormatter ( self . node , result_path + self . SIZE_METRIC_RESULT_PATH , self . SIZE_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 . _pointcloud_size_metric = AverageMetric ( self . node , ( result_path + self . SIZE_METRIC_RESULT_PATH ) , ( result_path + self . SIZE_METRIC_OUTPUT_PATH ) , self . SIZE_MEASURE_FILE_NAME , self . SIZE_METRIC_OUTPUT_NAME ) self . _data_player = SyncedPlayerFrameSize ( self . node , self . _dataset , self . SIZE_METRIC_TOPIC , [ 0 ] ) if not self . _data_player . add_track ( self . POINT_CLOUD_DATASET_TRACK , input_topic , PointCloud2 , output_topic , self . POINT_CLOUD_TRACK_MIN_SUBS , self . POINT_CLOUD_TRACK_RATE_HZ , self . POINT_CLOUD_TRACK_TIMEOUT_MS ) : 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 if not self . _pointcloud_size_formatter . start_output_listener ( self . SIZE_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 two metrics:
            - speed
            - size of the input pointcloud (in bytes)

        @return: True on success, False on failure
        """ # Load the3D lidar dataset # 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 # Load the size output formatter to get the input of the node # and save it to a file # Prepare the speed metric object # Prepare the size metric object # Create the Player to play the data to the lidar node # Listen to the speed metric # Listen to the size metric # Everything is fine
True on success, False on failure
True on success False on failure
self