Apollo  v5.5.0
Open source self driving car software
base_segmentation.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 #pragma once
17 
18 #include <string>
19 
20 #include "cyber/common/macros.h"
23 
24 namespace apollo {
25 namespace perception {
26 namespace lidar {
27 
29  std::string sensor_name = "velodyne64";
30 };
31 
33 
35  public:
36  BaseSegmentation() = default;
37 
38  virtual ~BaseSegmentation() = default;
39 
40  virtual bool Init(
41  const SegmentationInitOptions& options = SegmentationInitOptions()) = 0;
42 
43  // @brief: segment point cloud and get objects.
44  // @param [in]: options
45  // @param [in/out]: frame
46  // segmented_objects should be filled, required,
47  // label field of point cloud can be filled, optional,
48  virtual bool Segment(const SegmentationOptions& options,
49  LidarFrame* frame) = 0;
50 
51  virtual std::string Name() const = 0;
52 
53  private:
54  DISALLOW_COPY_AND_ASSIGN(BaseSegmentation);
55 }; // class BaseSegmentation
56 
58 #define PERCEPTION_REGISTER_SEGMENTATION(name) \
59  PERCEPTION_REGISTER_CLASS(BaseSegmentation, name)
60 
61 } // namespace lidar
62 } // namespace perception
63 } // namespace apollo
Definition: blob.h:72
Definition: base_segmentation.h:28
std::string sensor_name
Definition: base_segmentation.h:29
Definition: base_segmentation.h:34
Definition: base_segmentation.h:32
PERCEPTION_REGISTER_REGISTERER(BaseOneShotTypeFusion)
Definition: lidar_frame.h:33