Apollo 11.0
自动驾驶开放平台
apollo::perception::lidar 命名空间参考

命名空间

namespace  centerpoint
 
namespace  cnnseg
 
namespace  cpdet
 
namespace  maskpillars
 
namespace  motion_unet
 
namespace  pointpillars
 
namespace  pointwise_unet
 
namespace  type_util
 
namespace  util
 

类

class  AnchorMaskCuda
 
class  BackgroundFilter
 
struct  BackgroundFilterConfig
 
class  BackgroundMap
 
struct  BarrieGate
 
struct  BarrierBankConfig
 
class  BarrierRecognitionComponent
 
struct  BarrierRecognitionComponentConfig
 
class  BarrierRecognizerBank
 
struct  BarrierRecognizerInitOptions
 
struct  BarrierRecognizerOptions
 
class  BarrierStatusTracker
 
struct  BarrierTrackerConfig
 
class  BaseBarrierRecognizer
 
class  BaseBipartiteGraphMatcher
 
class  BaseClassifier
 
class  BaseCPDetector
 
class  BaseDownSample
 
class  BaseGroundDetector
 
class  BaseLidarDetector
 
class  BaseMotionParser
 
class  BaseMultiShotTypeFusion
 
class  BaseMultiTargetTracker
 
class  BaseObjectFilter
 
class  BaseOneShotTypeFusion
 
class  BasePointCloudParser
 
class  BasePointCloudPreprocessor
 
class  BaseROIFilter
 
class  BaseSequenceTypeFusion
 
class  BaseSingleShotTypeFusion
 
struct  BgNode
 
class  BigmotRefineFilter
 
struct  BigmotRefineFilterConfig
 
struct  BipartiteGraphMatcherInitOptions
 
struct  BipartiteGraphMatcherOptions
 
class  Bitmap2D
 
class  CCRFMultiShotTypeFusion
 
class  CCRFOneShotTypeFusion
 
class  CCRFSequenceTypeFusion
 
class  CCRFSingleShotTypeFusion
 
struct  CcrfTypeFusionConfig
 
struct  CCRFTypeFusionConfig
 
class  CenterPointDetection
 
struct  ClassifierInitOptions
 
struct  ClassifierOptions
 
class  CloudMask
 
class  CNNSegmentation
 
struct  compareHashElements
 
struct  compareX
 
struct  compareY
 
struct  compareZ
 
class  ConfigUtil
 
class  CPDetection
 
struct  CPDetectorInitOptions
 
struct  CPDetectorOptions
 
struct  DownSampleInitOptions
 
struct  DownSampleOptions
 
struct  edge
 
class  FeatureDescriptor
 
class  FeatureGenerator
 
struct  FilterBankConfig
 
class  FloodFill
 
struct  FrontCriticalFilter
 
class  FusedClassifier
 
struct  FusedClassifierConfig
 
class  GnnBipartiteGraphMatcher
 
class  GpuDownSample
 
struct  GpuDownSampleConfig
 
class  GraphSegmentation
 
struct  GraphSegmentationConfig
 
struct  gridParameters
 
struct  GroundDetectorInitOptions
 
struct  GroundDetectorOptions
 
class  GroundGrid
 
struct  GroundNode
 
class  GroundService
 
struct  GroundServiceConfig
 
class  GroundServiceContent
 
class  GroundServiceDetector
 
struct  GroundServiceDetectorConfig
 
struct  hashElement
 
class  HdmapROIFilter
 
struct  HDMapRoiFilterConfig
 
class  Image
 
class  LidarCPDetectionComponent
 
struct  LidarCPDetectionComponentConfig
 
class  LidarDetectionComponent
 
struct  LidarDetectionComponentConfig
 
class  LidarDetectionFilterComponent
 
struct  LidarDetectionFilterComponentConfig
 
struct  LidarDetectorInitOptions
 
struct  LidarDetectorOptions
 
struct  LidarFrame
 
struct  LidarFrameInitializer
 
class  LidarOutputComponent
 
struct  LidarOutputComponentConfig
 
struct  LidarProcessResult
 
class  LidarSegmentationComponent
 
struct  LidarSegmentationComponentConfig
 
class  LidarTrackingComponent
 
struct  LidarTrackingComponentConfig
 
class  Logger
 
class  LRClassifier
 
class  MapManager
 
struct  MapManagerConfig
 
struct  MapManagerInitOptions
 
struct  MapManagerOptions
 
struct  MarkArea
 
class  MarkAreaFilter
 
struct  MarkAreaFilterConfig
 
class  MaskPillarsDetection
 
class  MatchCost
 
class  MlfBaseFilter
 
class  MlfDirectionFilter
 
struct  MlfDirectionFilterConfig
 
struct  MlfDistanceConfig
 
struct  MlfDistanceWeight
 
class  MlfEngine
 
struct  MlfEngineConfig
 
struct  MlfFilterInitOptions
 
struct  MlfFilterOptions
 
class  MlfMotionFilter
 
struct  MlfMotionFilterConfig
 
class  MlfMotionMeasurement
 
class  MlfMotionRefiner
 
struct  MlfMotionRefinerConfig
 
struct  MlfMotionRefinerInitOptions
 
struct  MlfMotionRefinerOptions
 
struct  MlfPredict
 
class  MlfShapeFilter
 
struct  MlfShapeFilterConfig
 
class  MlfTrackData
 
struct  MlfTrackDataInitializer
 
class  MlfTracker
 
struct  MlfTrackerConfig
 
struct  MlfTrackerInitOptions
 
class  MlfTrackObjectDistance
 
struct  MlfTrackObjectDistanceInitOptions
 
class  MlfTrackObjectMatcher
 
struct  MlfTrackObjectMatcherConfig
 
struct  MlfTrackObjectMatcherInitOptions
 
struct  MlfTrackObjectMatcherOptions
 
struct  MlfTrackOptions
 
class  MlfTypeFilter
 
struct  MlfTypeFilterConfig
 
class  MotionUnet
 
class  MultiHmBipartiteGraphMatcher
 
struct  MultiTargetTrackerInitOptions
 
struct  MultiTargetTrackerOptions
 
class  NCut
 
struct  NCutConfig
 
struct  NCutParam
 
class  NCutSegmentation
 
struct  NCutSegmentationParam
 
class  NmsCuda
 
class  ObjectBuilder
 
struct  ObjectBuilderInitOptions
 
struct  ObjectBuilderOptions
 
class  ObjectFilterBank
 
struct  ObjectFilterInitOptions
 
struct  ObjectFilterOptions
 
class  ObjectSequence
 
class  ObjectSplitFilter
 
struct  ObjectSplitFilterConfig
 
class  OfflineLidarCPDetection
 
class  OfflineLidarDetection
 
class  OfflinePointcloudGroundDetection
 
class  Params
 
class  PclDownSample
 
struct  PclDownSampleConfig
 
struct  PclMethodConfig
 
class  PclPCDownSample
 
struct  PCLPointXYZIT
 
struct  PCLPointXYZL
 
class  PfeCuda
 
class  PointCloudGroundDetectComponent
 
struct  PointCloudGroundDetectComponentConfig
 
class  PointCloudMapROIComponent
 
struct  PointCloudMapROIComponentConfig
 
class  PointCloudMotionComponent
 
struct  PointCloudMotionComponentConfig
 
struct  PointCloudParserInitOptions
 
struct  PointCloudParserOptions
 
class  PointCloudPreprocessComponent
 
struct  PointCloudPreprocessComponentConfig
 
class  PointCloudPreprocessor
 
struct  PointCloudPreprocessorConfig
 
struct  PointCloudPreprocessorInitOptions
 
struct  PointCloudPreprocessorOptions
 
class  PointCloudSemanticComponent
 
struct  PointCloudSemanticComponentConfig
 
class  PointPillars
 
class  PointPillarsDetection
 
class  PointWiseUnet
 
class  PolygonScanCvter
 
class  PostprocessCuda
 
class  PreprocessPoints
 
class  PreprocessPointsCuda
 
struct  ResultsOutput
 
struct  rgb
 
class  ROIBoundaryFilter
 
struct  ROIBoundaryFilterConfig
 
struct  ROIFilterInitOptions
 
struct  ROIFilterOptions
 
class  ROIService
 
struct  ROIServiceConfig
 
class  ROIServiceContent
 
class  ROIServiceFilter
 
class  ScatterCuda
 
class  SceneManager
 
struct  SceneManagerConfig
 
struct  SceneManagerInitOptions
 
class  SceneService
 
class  SceneServiceContent
 
struct  SceneServiceInitOptions
 
class  SemanticBuilder
 
struct  SemanticBuilderInitOptions
 
struct  SemanticBuilderOptions
 
class  SemanticFilter
 
struct  SemanticFilterConfig
 
class  SpatioTemporalGroundDetector
 
struct  SpatioTemporalGroundDetectorConfig
 
class  SppCCDetector
 
struct  SppCluster
 
struct  SppClusterInitializer
 
class  SppClusterList
 
struct  SppData
 
class  SppEngine
 
class  SppLabelImage
 
struct  SppParams
 
struct  SppPoint
 
struct  StatusTrackerInitOptions
 
struct  StraightPoleBarrierConfig
 
class  StraightPoleRecognizer
 
class  StrategyFilter
 
struct  StrategyFilterConfig
 
class  Timer
 
class  TrackData
 
struct  TrackDataInitializer
 
struct  TrackedObject
 
struct  TrackedObjectInitializer
 
struct  TypeFilterInitOption
 
struct  TypeFilterOption
 
struct  TypeFusionInitOption
 
struct  TypeFusionOption
 
struct  UnetNode
 
struct  uni_elt
 
class  Universe
 
struct  Unode
 
struct  voxel
 
class  VoxelDownSampleCuda
 

类型定义

typedef base::ConcurrentObjectPool< LidarFrame, kLidarFramePoolSize, LidarFrameInitializer > LidarFramePool
 
using ObjectPtr = std::shared_ptr< apollo::perception::base::Object >
 
using PointFCloud = apollo::perception::base::PointCloud< PointF >
 
using PolygonDType = apollo::perception::base::PointCloud< PointD >
 
typedef pcl::PointXYZRGB CPoint
 
typedef pcl::PointCloud< CPoint > CPointCloud
 
typedef pcl::PointCloud< CPoint >::Ptr CPointCloudPtr
 
typedef pcl::PointCloud< CPoint >::ConstPtr CPointCloudConstPtr
 
typedef std::shared_ptr< GroundServiceContent > GroundServiceContentPtr
 
typedef std::shared_ptr< const GroundServiceContent > GroundServiceContentConstPtr
 
typedef std::shared_ptr< GroundService > GroundServicePtr
 
typedef std::shared_ptr< const GroundService > GroundServiceConstPtr
 
typedef std::shared_ptr< ROIServiceContent > ROIServiceContentPtr
 
typedef std::shared_ptr< const ROIServiceContent > ROIServiceContentConstPtr
 
typedef std::shared_ptr< ROIService > ROIServicePtr
 
typedef std::shared_ptr< const ROIService > ROIServiceConstPtr
 
typedef std::shared_ptr< SceneServiceContent > SceneServiceContentPtr
 
typedef std::shared_ptr< const SceneServiceContent > SceneServiceContentConstPtr
 
typedef std::shared_ptr< SceneService > SceneServicePtr
 
typedef std::shared_ptr< const SceneService > SceneServiceConstPtr
 
typedef std::shared_ptr< SppCluster > SppClusterPtr
 
typedef std::shared_ptr< const SppCluster > SppClusterConstPtr
 
typedef std::shared_ptr< SppLabelImage > SppLabelImagePtr
 
typedef std::shared_ptr< const SppLabelImage > SppLabelImageConstPtr
 
typedef base::LightObjectPool< SppCluster, kSppClusterPoolSize, SppClusterInitializer, base::SensorType::VELODYNE_64 > SppClusterPool
 
typedef unsigned char uchar
 
typedef Eigen::Matrix< double, VALID_OBJECT_TYPE, 1 > Vectord
 
typedef Eigen::Matrix< int, VALID_OBJECT_TYPE, 1 > Vectori
 
typedef Eigen::Matrix< double, VALID_OBJECT_TYPE, VALID_OBJECT_TYPE > Matrixd
 
typedef std::shared_ptr< MlfTrackData > MlfTrackDataPtr
 
typedef std::shared_ptr< const MlfTrackData > MlfTrackDataConstPtr
 
typedef std::shared_ptr< TrackData > TrackDataPtr
 
typedef std::shared_ptr< const TrackData > TrackDataConstPtr
 
typedef base::ConcurrentObjectPool< TrackedObject, kTrackedObjectPoolSize, TrackedObjectInitializer > TrackedObjectPool
 
typedef base::ConcurrentObjectPool< TrackData, kTrackDataPoolSize, TrackDataInitializer > TrackDataPool
 
typedef base::ConcurrentObjectPool< MlfTrackData, kTrackDataPoolSize, MlfTrackDataInitializer > MlfTrackDataPool
 
typedef std::shared_ptr< TrackedObject > TrackedObjectPtr
 
typedef std::shared_ptr< const TrackedObject > TrackedObjectConstPtr
 
using DirectionMajor = Bitmap2D::DirectionMajor
 
template<typename T >
using Polygon = typename PolygonScanCvter< T >::Polygon
 

枚举

enum class  LidarErrorCode {
  Succeed = 0 , InitError = 1 , PointCloudPreprocessorError = 2 , MapManagerError = 3 ,
  DetectionError = 4 , ObjectBuilderError = 5 , ObjectFilterError = 6 , ClassifierError = 7 ,
  TrackerError = 8
}
 
enum class  LidarPointLabel {
  UNKNOWN = 0 , ROI = 1 , GROUND = 2 , OBJECT = 3 ,
  MAX_LABEL
}
 
enum class  PointSemanticLabel {
  UNKNOWN = 0 , IGNORE = 1 , GROUND = 2 , OBJECT = 3 ,
  CURB = 4 , VEGETATION = 5 , FENCE = 6 , NOISE = 7 ,
  WALL = 8 , MAX_LABEL
}
 
enum class  PointMotionLabel { UNKNOWN = 0 , MOVING = 1 , STATIONARY = 2 , MAX_LABEL }
 
enum class  SppClassType {
  OTHERS = 0 , SMALLMOT = 1 , BIGMOT = 2 , CYCLIST = 3 ,
  PEDESTRIAN = 4 , CONE = 5 , MAX_TYPE = 6
}
 
enum class  MetaType {
  META_UNKNOWN = 0 , META_SMALLMOT = 1 , META_BIGMOT = 2 , META_NONMOT = 3 ,
  META_PEDESTRIAN = 4 , MAX_META_TYPE
}
 
enum  { VALID_OBJECT_TYPE = static_cast<int>(base::ObjectType::MAX_OBJECT_TYPE) - 2 }
 
enum class  MotionState { STATIC = 0 , SKEPTICAL_MOVE = 1 , TRUSTED_MOVE = 2 }
 
enum  { VALID_OBJECT_TYPE = static_cast<int>(base::ObjectType::MAX_OBJECT_TYPE) - 2 }
 

函数

 CYBER_REGISTER_COMPONENT (BarrierRecognitionComponent)
 
 PERCEPTION_REGISTER_CURB_DETECTOR (StraightPoleRecognizer)
 
 PERCEPTION_REGISTER_REGISTERER (BaseBarrierRecognizer)
 
 __attribute__ ((constructor)) void LidarFramePoolInitialize()
 
void GetBoundingBox2d (const std::shared_ptr< Object > &object, PointCloud< PointD > *box, double expand)
 
void ComputeObjectShapeFromPolygon (std::shared_ptr< Object > object, bool use_world_cloud)
 
void ComputePolygonDirection (const Eigen::Vector3d &ref_center, const base::ObjectPtr &object, Eigen::Vector3f *direction)
 Compute polygon direction
 
void ComputeMinMaxDirectionPoint (const base::ObjectPtr &object, const Eigen::Vector3d &ref_center, size_t *max_point_index, size_t *min_point_index)
 Compute min max direction
 
void GetBoundingBox2d (const std::shared_ptr< base::Object > &object, base::PointCloud< base::PointD > *box, double expand=0.0)
 Get the Bounding Box vertices and save in polygon type
 
void ComputeObjectShapeFromPolygon (std::shared_ptr< base::Object > object, bool use_world_cloud=false)
 compute object shape(center, size) from given direction and polygon
 
void SetSemanticLabel (PointSemanticLabel label, uint8_t *value)
 
PointSemanticLabel GetSemanticLabel (uint8_t value)
 
bool IsSemanticLabelEqual (PointSemanticLabel label, uint8_t value)
 
void SetMotionLabel (PointMotionLabel label, uint8_t *value)
 
PointMotionLabel GetMotionLabel (uint8_t value)
 
bool IsMotionLabelEqual (PointMotionLabel label, uint8_t value)
 
bool LoadPCLPCD (const std::string &file_path, base::PointFCloud *cloud_out)
 
bool WritePcdByLabel (const std::string &file_path, const base::PointFCloud &cloud, const LidarPointLabel &label)
 
template<typename PointT >
void TransformToPCLXYZI (const base::AttributePointCloud< PointT > &org_cloud, const pcl::PointCloud< pcl::PointXYZI >::Ptr &out_cloud_ptr)
 
void TransformFromPCLXYZI (const pcl::PointCloud< pcl::PointXYZI >::Ptr &org_cloud_ptr, const base::PointFCloudPtr &out_cloud_ptr)
 
void DownSampleCloudByVoxelGrid (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud_ptr, const pcl::PointCloud< pcl::PointXYZI >::Ptr &filtered_cloud_ptr, float lx=0.01f, float ly=0.01f, float lz=0.01f)
 
template<typename PointT >
void DownSampleCloudByVoxelGrid (const typename pcl::PointCloud< PointT >::Ptr &input_cloud_ptr, typename pcl::PointCloud< PointT >::Ptr output_cloud_ptr, float lx=0.01f, float ly=0.01f, float lz=0.01f)
 
template<typename PointT >
void FilterPointsOutsideRange (const typename pcl::PointCloud< PointT >::Ptr &input_cloud_ptr, const std::string &filter_axis, const double &limit_min, const double &limit_max, typename pcl::PointCloud< PointT >::Ptr output_cloud_ptr)
 
template<typename PointT >
void LoadPointCloud (const std::string &filename, typename pcl::PointCloud< PointT >::Ptr point_cloud)
 
template<typename PointT >
void DownSamplePointCloud (const typename pcl::PointCloud< PointT >::Ptr &intput_cloud_ptr, typename pcl::PointCloud< PointT >::Ptr out_cloud_ptr, int num_points)
 
uint32_t GetIndex (uint32_t r, uint32_t c, uint32_t cols)
 
 PERCEPTION_REGISTER_SCENESERVICECONTENT (GroundServiceContent)
 
 PERCEPTION_REGISTER_SCENESERVICE (GroundService)
 
 PERCEPTION_REGISTER_SCENESERVICECONTENT (ROIServiceContent)
 
 PERCEPTION_REGISTER_SCENESERVICE (ROIService)
 
 PERCEPTION_REGISTER_REGISTERER (SceneServiceContent)
 
 PERCEPTION_REGISTER_REGISTERER (SceneService)
 
 PERCEPTION_REGISTER_LIDARDETECTOR (CPDetection)
 
 PERCEPTION_REGISTER_REGISTERER (BaseCPDetector)
 
 CYBER_REGISTER_COMPONENT (LidarCPDetectionComponent)
 
float get_3Dbox_iou_len (float center1, float len1, float center2, float len2)
 
float get_3dbox_iou (base::ObjectPtr obj1, base::ObjectPtr obj2)
 
 PERCEPTION_REGISTER_LIDARDETECTOR (CenterPointDetection)
 
 PERCEPTION_REGISTER_LIDARDETECTOR (CNNSegmentation)
 
template<class T >
void DisjointSetMakeSet (T *x)
 
template<class T >
T * DisjointSetFindRecursive (T *x)
 
template<class T >
T * DisjointSetFindLoop (T *x)
 
template<class T >
T * DisjointSetFind (T *x)
 
template<class T >
void DisjointSetMerge (T *x, const T *y)
 
template<class T >
void DisjointSetUnion (T *x, T *y)
 
int F2I (float val, float ori, float scale)
 
void GroupPc2Pixel (float pc_x, float pc_y, float scale, float range, int *x, int *y)
 
int Pc2Pixel (float in_pc, float in_range, float out_size)
 
float Pixel2Pc (int in_pixel, float in_size, float out_range)
 
 PERCEPTION_REGISTER_LIDARDETECTOR (MaskPillarsDetection)
 
void GPUAssert (cudaError_t code, const char *file, int line, bool abort=true)
 
 PERCEPTION_REGISTER_LIDARDETECTOR (PointPillarsDetection)
 
 PERCEPTION_REGISTER_REGISTERER (BaseLidarDetector)
 
 CYBER_REGISTER_COMPONENT (LidarDetectionComponent)
 
 CYBER_REGISTER_COMPONENT (LidarDetectionFilterComponent)
 
 CYBER_REGISTER_COMPONENT (LidarOutputComponent)
 
bool BgObjectBuilder (std::vector< base::ObjectPtr > *objects, Eigen::Affine3d &lidar2novatel_pose)
 background objects builder
 
void SplitObject (const base::ObjectPtr &obj, std::vector< base::ObjectPtr > *split_objs, float split_distance)
 split object
 
bool LineFit2D (const base::PointFCloud &cloud, Eigen::Vector3f *params)
 line fitting according to max variance direction of pointcloud
 
 CYBER_REGISTER_COMPONENT (LidarSegmentationComponent)
 
 PERCEPTION_REGISTER_LIDARDETECTOR (GraphSegmentation)
 
void convolve_even (Image< float > *src, Image< float > *dst, const std::vector< float > &mask)
 convolve src with mask.
 
void convolve_odd (Image< float > *src, Image< float > *dst, const std::vector< float > &mask)
 convolve src with mask.
 
void normalize (std::vector< float > *mask_input)
 Normalize mask so it integrates to one
 
 MAKE_FILTER (fgauss, exp(-0.5 *square(i/sigma)))
 
Image< float > * smooth (Image< float > *src, float sigma)
 Convolve image with gaussian filter
 
Image< float > * smooth (Image< uchar > *src, float sigma)
 Convolve image with gaussian filter
 
Image< float > * laplacian (Image< float > *src)
 Compute laplacian
 
Image< uchar > * image_rgb2gray (Image< rgb > *input)
 Transform rgb to gray
 
Image< rgb > * image_gray2rgb (Image< uchar > *input)
 Tranform gray to rgb
 
Image< float > * image_uchar2float (Image< uchar > *input)
 Transform uchar to float
 
Image< float > * image_int2float (Image< int > *input)
 Transform int to float
 
Image< uchar > * image_float2uchar (Image< float > *input, float min, float max)
 Transform float to uchar
 
Image< uchar > * image_float2uchar (Image< float > *input)
 Transform float to uchar
 
Image< uint32_t > * image_uchar2long (Image< uchar > *input)
 Transform unchar to long
 
Image< uchar > * image_long2uchar (Image< uint32_t > *input, uint32_t min, uint32_t max)
 Transform long to uchar
 
Image< uchar > * image_long2uchar (Image< uint32_t > *input)
 Transform long to uchar
 
Image< uchar > * image_short2uchar (Image< uint16_t > *input, uint16_t min, uint16_t max)
 Transform short to uchar
 
Image< uchar > * image_short2uchar (Image< uint16_t > *input)
 Transform short to uchar
 
template<class T >
void min_max (Image< T > *im, T *ret_min, T *ret_max)
 Compute minimum and maximum value in an image
 
template<class T >
Image< uchar > * threshold (Image< T > *src, int t)
 Threshold image
 
bool operator== (const rgb &a, const rgb &b)
 Definition of equal sign
 
template<class T >
T abs (const T &x)
 Get absolute value of x
 
template<class T >
int sign (const T &x)
 Get sign of value x
 
template<class T >
T square (const T &x)
 get square of value x
 
template<class T >
T bound (const T &x, const T &min, const T &max)
 Get bound of value x
 
template<class T >
bool check_bound (const T &x, const T &min, const T &max)
 Check bound of x
 
int vlib_round (float x)
 Get round value of x
 
int vlib_round (double x)
 Get round value of x
 
double gaussian (double val, double sigma)
 Get gaussian value of val based on sigma
 
bool operator< (const edge &a, const edge &b)
 
Universe * segment_graph (int num_vertices, int num_edges, edge *edges, float c)
 Segment a graph
 
float diff (Image< float > *I, int x1, int y1, int x2, int y2)
 Dissimilarity measure between pixels
 
Image< int > * segment_image (Image< float > *im, float sigma, float c, int min_size, int *num_ccs)
 Segment an image
 
 PERCEPTION_REGISTER_LIDARDETECTOR (NCutSegmentation)
 
 PERCEPTION_REGISTER_ONESHOTTYPEFUSION (CCRFOneShotTypeFusion)
 
 PERCEPTION_REGISTER_SEQUENCETYPEFUSION (CCRFSequenceTypeFusion)
 
 PERCEPTION_REGISTER_CLASSIFIER (FusedClassifier)
 
 PERCEPTION_REGISTER_REGISTERER (BaseOneShotTypeFusion)
 
 PERCEPTION_REGISTER_REGISTERER (BaseSequenceTypeFusion)
 
 PERCEPTION_REGISTER_REGISTERER (BaseBipartiteGraphMatcher)
 
 PERCEPTION_REGISTER_REGISTERER (BaseClassifier)
 
 PERCEPTION_REGISTER_REGISTERER (BaseMultiTargetTracker)
 
 CYBER_REGISTER_COMPONENT (LidarTrackingComponent)
 
float EuclideanDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
 : compute euclidean distance for given track & object
 
float LocationDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
 Compute location distance for given track & object
 
float DirectionDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
 Compute direction distance for given track & object
 
float BboxSizeDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
 Compute bbox size distance for given track & object
 
float PointNumDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
 Compute point num distance for given track & object
 
float HistogramDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
 Compute histogram distance for given track & object
 
float CentroidShiftDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &cur_obj, const double time_diff)
 Compute centroid shift distance for object and background match
 
float BboxIouDistance (const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &cur_obj, const double time_diff, double match_threshold)
 Compute bbox iou distance for object and background match
 
bool operator< (const MatchCost &m1, const MatchCost &m2)
 
std::ostream & operator<< (std::ostream &os, const MatchCost &m)
 
 PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER (GnnBipartiteGraphMatcher)
 
 PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER (MultiHmBipartiteGraphMatcher)
 
void RemoveStaleDataFromMap (double timestamp, std::map< double, TrackedObjectPtr > *data)
 
void MeasureAnchorPointVelocity (TrackedObjectPtr new_object, const TrackedObjectConstPtr &old_object, const double &time_diff)
 Measure anchor point velocity
 
void MeasureBboxCenterVelocity (TrackedObjectPtr new_object, const TrackedObjectConstPtr &old_object, const double &time_diff)
 Measure bbox center velocity
 
void MeasureBboxCenterHistoryVelocity (const MlfTrackDataConstPtr &track_data, TrackedObjectPtr new_object)
 
void MeasureBboxCornerVelocity (TrackedObjectPtr new_object, const TrackedObjectConstPtr &old_object, const double &time_diff)
 Measure bbox corner velocity
 
void MeasureBboxCornerHistoryVelocity (const MlfTrackDataConstPtr &track_data, TrackedObjectPtr new_object)
 
void ComputeBboxCornerHistoryVelocity (TrackedObjectPtr new_object, const TrackedObjectConstPtr &old_object, const double &time_diff, TrackedObjectPtr curr_object)
 
void MeasureObjectDetectionVelocity (TrackedObjectPtr new_object, const TrackedObjectConstPtr &old_object, const double &time_diff)
 Measure object-detection center and corner velocity
 
void MeasureObjectDetectionHistoryVelocity (const MlfTrackDataConstPtr &track_data, TrackedObjectPtr new_object)
 
 PERCEPTION_REGISTER_REGISTERER (MlfBaseFilter)
 
 PERCEPTION_REGISTER_MLFFILTER (MlfDirectionFilter)
 
 PERCEPTION_REGISTER_MULTITARGET_TRACKER (MlfEngine)
 
 PERCEPTION_REGISTER_MLFFILTER (MlfMotionFilter)
 
 PERCEPTION_REGISTER_MLFFILTER (MlfShapeFilter)
 
 PERCEPTION_REGISTER_MLFFILTER (MlfTypeFilter)
 
bool JudgeBlindTrafficCone (const MlfTrackDataConstPtr &track_data, double frame_timestamp, const Eigen::Vector3d &local_to_global_offset, Eigen::Affine3d &lidar2world_pose, Eigen::Affine3d &lidar2novatel_pose)
 
 PERCEPTION_REGISTER_ONESHOTTYPEFUSION (CCRFSingleShotTypeFusion)
 
 PERCEPTION_REGISTER_SEQUENCETYPEFUSION (CCRFMultiShotTypeFusion)
 
 PERCEPTION_REGISTER_REGISTERER (BaseSingleShotTypeFusion)
 
 PERCEPTION_REGISTER_REGISTERER (BaseMultiShotTypeFusion)
 
 PERCEPTION_REGISTER_GROUNDDETECTOR (GroundServiceDetector)
 
 PERCEPTION_REGISTER_GROUNDDETECTOR (SpatioTemporalGroundDetector)
 
 PERCEPTION_REGISTER_REGISTERER (BaseGroundDetector)
 
 CYBER_REGISTER_COMPONENT (PointCloudGroundDetectComponent)
 
 CYBER_REGISTER_COMPONENT (PointCloudMapROIComponent)
 
template<typename T >
bool DrawPolygonMask (const typename PolygonScanCvter< T >::Polygon &polygon, Bitmap2D *bitmap, const double extend_dist=0.0, const bool no_edge_table=false)
 
template<typename T >
bool DrawPolygonsMask (const std::vector< typename PolygonScanCvter< T >::Polygon > &polygons, Bitmap2D *bitmap, const double extend_dist=0.0, const bool no_edge_table=false)
 
 PERCEPTION_REGISTER_REGISTERER (BaseMotionParser)
 
 PERCEPTION_REGISTER_POINTCLOUDPARSER (MotionUnet)
 
 CYBER_REGISTER_COMPONENT (PointCloudMotionComponent)
 
 PERCEPTION_REGISTER_REGISTERER (BasePointCloudPreprocessor)
 
 CYBER_REGISTER_COMPONENT (PointCloudPreprocessComponent)
 
 PERCEPTION_REGISTER_POINTCLOUDPREPROCESSOR (PointCloudPreprocessor)
 
 PERCEPTION_REGISTER_REGISTERER (BasePointCloudParser)
 
 PERCEPTION_REGISTER_POINTCLOUDPARSER (PointWiseUnet)
 
 CYBER_REGISTER_COMPONENT (PointCloudSemanticComponent)
 

变量

const std::string kBarrierId2Type []
 
struct apollo::perception::lidar::PCLPointXYZIT EIGEN_ALIGN16
 
const float MIN_X_RANGE = -51.2
 
const float MAX_X_RANGE = 51.2
 
const float MIN_Y_RANGE = -51.2
 
const float MAX_Y_RANGE = 51.2
 
const float MIN_Z_RANGE = -3.5
 
const float MAX_Z_RANGE = 3.5
 
const double kPI = 3.1415926535897932384626433832795
 
const double WIDTH = 4.0
 
const double RED_WEIGHT = 0.299
 
const double GREEN_WEIGHT = 0.587
 
const double BLUE_WEIGHT = 0.114
 
const float STATIC_VELOCITY = 0.01
 

类型定义说明

◆ CPoint

typedef pcl::PointXYZRGB apollo::perception::lidar::CPoint

在文件 pcl_util.h 第 32 行定义.

◆ CPointCloud

在文件 pcl_util.h 第 33 行定义.

◆ CPointCloudConstPtr

typedef pcl::PointCloud<CPoint>::ConstPtr apollo::perception::lidar::CPointCloudConstPtr

在文件 pcl_util.h 第 35 行定义.

◆ CPointCloudPtr

typedef pcl::PointCloud<CPoint>::Ptr apollo::perception::lidar::CPointCloudPtr

在文件 pcl_util.h 第 34 行定义.

◆ DirectionMajor

◆ GroundServiceConstPtr

在文件 ground_service.h 第 110 行定义.

◆ GroundServiceContentConstPtr

◆ GroundServiceContentPtr

◆ GroundServicePtr

在文件 ground_service.h 第 109 行定义.

◆ LidarFramePool

◆ Matrixd

在文件 util.h 第 40 行定义.

◆ MlfTrackDataConstPtr

在文件 mlf_track_data.h 第 198 行定义.

◆ MlfTrackDataPool

◆ MlfTrackDataPtr

在文件 mlf_track_data.h 第 197 行定义.

◆ ObjectPtr

◆ PointFCloud

◆ Polygon

template<typename T >
using apollo::perception::lidar::Polygon = typedef typename PolygonScanCvter<T>::Polygon

在文件 hdmap_roi_filter.cc 第 36 行定义.

◆ PolygonDType

◆ ROIServiceConstPtr

在文件 roi_service.h 第 98 行定义.

◆ ROIServiceContentConstPtr

在文件 roi_service.h 第 95 行定义.

◆ ROIServiceContentPtr

在文件 roi_service.h 第 94 行定义.

◆ ROIServicePtr

在文件 roi_service.h 第 97 行定义.

◆ SceneServiceConstPtr

在文件 scene_service.h 第 101 行定义.

◆ SceneServiceContentConstPtr

在文件 scene_service.h 第 60 行定义.

◆ SceneServiceContentPtr

◆ SceneServicePtr

在文件 scene_service.h 第 100 行定义.

◆ SppClusterConstPtr

在文件 spp_cluster.h 第 132 行定义.

◆ SppClusterPool

◆ SppClusterPtr

在文件 spp_cluster.h 第 131 行定义.

◆ SppLabelImageConstPtr

在文件 spp_label_image.h 第 149 行定义.

◆ SppLabelImagePtr

在文件 spp_label_image.h 第 148 行定义.

◆ TrackDataConstPtr

在文件 track_data.h 第 155 行定义.

◆ TrackDataPool

◆ TrackDataPtr

在文件 track_data.h 第 154 行定义.

◆ TrackedObjectConstPtr

在文件 tracked_object.h 第 231 行定义.

◆ TrackedObjectPool

◆ TrackedObjectPtr

在文件 tracked_object.h 第 230 行定义.

◆ uchar

typedef unsigned char apollo::perception::lidar::uchar

在文件 misc.h 第 38 行定义.

◆ Vectord

typedef Eigen::Matrix< double, VALID_OBJECT_TYPE, 1 > apollo::perception::lidar::Vectord

在文件 util.h 第 38 行定义.

◆ Vectori

typedef Eigen::Matrix< int, VALID_OBJECT_TYPE, 1 > apollo::perception::lidar::Vectori

在文件 util.h 第 39 行定义.

枚举类型说明

◆ anonymous enum

anonymous enum
枚举值
VALID_OBJECT_TYPE 

在文件 util.h 第 34 行定义.

34 {
35 VALID_OBJECT_TYPE = static_cast<int>(base::ObjectType::MAX_OBJECT_TYPE) - 2
36};

◆ anonymous enum

anonymous enum
枚举值
VALID_OBJECT_TYPE 

在文件 util.h 第 34 行定义.

34 {
35 VALID_OBJECT_TYPE = static_cast<int>(base::ObjectType::MAX_OBJECT_TYPE) - 2
36};

◆ LidarErrorCode

◆ LidarPointLabel

枚举值
UNKNOWN 
ROI 
GROUND 
OBJECT 
MAX_LABEL 

在文件 lidar_point_label.h 第 22 行定义.

22 {
23 UNKNOWN = 0,
24 ROI = 1,
25 GROUND = 2,
26 OBJECT = 3,
28}; // enum class LidarPointLabel

◆ MetaType

枚举值
META_UNKNOWN 
META_SMALLMOT 
META_BIGMOT 
META_NONMOT 
META_PEDESTRIAN 
MAX_META_TYPE 

在文件 util.h 第 22 行定义.

◆ MotionState

枚举值
STATIC 
SKEPTICAL_MOVE 
TRUSTED_MOVE 

在文件 track_data.h 第 29 行定义.

◆ PointMotionLabel

枚举值
UNKNOWN 
MOVING 
STATIONARY 
MAX_LABEL 

在文件 lidar_point_label.h 第 43 行定义.

43 {
44 UNKNOWN = 0,
45 MOVING = 1,
46 STATIONARY = 2,
48}; // enum class PointMotionLabel

◆ PointSemanticLabel

枚举值
UNKNOWN 
IGNORE 
GROUND 
OBJECT 
CURB 
VEGETATION 
FENCE 
NOISE 
WALL 
MAX_LABEL 

在文件 lidar_point_label.h 第 30 行定义.

30 {
31 UNKNOWN = 0,
32 IGNORE = 1,
33 GROUND = 2,
34 OBJECT = 3,
35 CURB = 4,
36 VEGETATION = 5,
37 FENCE = 6,
38 NOISE = 7,
39 WALL = 8,
41}; // enum class PointSemanticLabel

◆ SppClassType

枚举值
OTHERS 
SMALLMOT 
BIGMOT 
CYCLIST 
PEDESTRIAN 
CONE 
MAX_TYPE 

在文件 spp_cluster.h 第 30 行定义.

30 {
31 OTHERS = 0,
32 SMALLMOT = 1,
33 BIGMOT = 2,
34 CYCLIST = 3,
35 PEDESTRIAN = 4,
36 CONE = 5,
37 MAX_TYPE = 6,
38};

函数说明

◆ __attribute__()

apollo::perception::lidar::__attribute__ ( (constructor)  )

在文件 lidar_frame_pool.cc 第 25 行定义.

25 {
26 LidarFramePool::Instance();
27 AINFO << "Initialize lidar frame pool.";
28}
#define AINFO
Definition log.h:42

◆ abs()

template<class T >
T apollo::perception::lidar::abs ( const T &  x)
inline

Get absolute value of x

模板参数
T
参数
x
返回
T

在文件 misc.h 第 63 行定义.

63 {
64 return (x > 0 ? x : -x);
65}

◆ BboxIouDistance()

float apollo::perception::lidar::BboxIouDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  cur_obj,
const double  time_diff,
double  match_threshold 
)

Compute bbox iou distance for object and background match

参数
last_objectobject for computing distance
track_predictunused
cur_objnew detected object for computing distance
time_diffunused
match_thresholdmatch threshold
返回
float distance

在文件 distance_collection.cc 第 202 行定义.

205 {
206 // Step 1: unify bbox direction, change the one with less pts,
207 // for efficiency.
208 Eigen::Vector3f old_dir = last_object->output_direction.cast<float>();
209 Eigen::Vector3f old_size = last_object->output_size.cast<float>();
210 Eigen::Vector3d old_center = last_object->output_center;
211 Eigen::Vector3f new_dir = new_object->direction.cast<float>();
212 Eigen::Vector3f new_size = new_object->size.cast<float>();
213 Eigen::Vector3d new_center = new_object->center;
214 old_dir.normalize();
215 new_dir.normalize();
216 // handle randomness
217 old_size(0) = old_size(0) > 0.3f ? old_size(0) : 0.3f;
218 old_size(1) = old_size(1) > 0.3f ? old_size(1) : 0.3f;
219 new_size(0) = new_size(0) > 0.3f ? new_size(0) : 0.3f;
220 new_size(1) = new_size(1) > 0.3f ? new_size(1) : 0.3f;
221 int last_object_num_pts = static_cast<int>(
222 (last_object->object_ptr->lidar_supplement).cloud_world.size());
223 int cur_obj_num_pts = static_cast<int>(
224 (new_object->object_ptr->lidar_supplement).cloud_world.size());
225 bool change_cur_obj_bbox = last_object_num_pts > cur_obj_num_pts;
226 float minimum_edge_length = 0.01f;
227 base::PointDCloud& cloud =
228 (new_object->object_ptr->lidar_supplement).cloud_world;
229 if (change_cur_obj_bbox) {
230 new_dir = old_dir;
231 algorithm::CalculateBBoxSizeCenter2DXY(
232 cloud, new_dir, &new_size, &new_center, minimum_edge_length);
233 } else {
234 old_dir = new_dir;
235 algorithm::CalculateBBoxSizeCenter2DXY(
236 cloud, old_dir, &old_size, &old_center, minimum_edge_length);
237 }
238 // Step 2: compute 2d iou bbox to bbox
239 Eigen::Matrix2d trans_mat;
240 trans_mat(0, 0) = (old_dir.cast<double>())(0);
241 trans_mat(0, 1) = (old_dir.cast<double>())(1);
242 trans_mat(1, 0) = -(old_dir.cast<double>())(1);
243 trans_mat(1, 1) = (old_dir.cast<double>())(0);
244 Eigen::Vector2d old_center_transformed_2d =
245 static_cast<Eigen::Matrix<double, 2, 1, 0, 2, 1>>(trans_mat *
246 old_center.head(2));
247 Eigen::Vector2d new_center_transformed_2d =
248 static_cast<Eigen::Matrix<double, 2, 1, 0, 2, 1>>(trans_mat *
249 new_center.head(2));
250 old_center(0) = old_center_transformed_2d(0);
251 old_center(1) = old_center_transformed_2d(1);
252 new_center(0) = new_center_transformed_2d(0);
253 new_center(1) = new_center_transformed_2d(1);
254 Eigen::Vector3d old_size_tmp = old_size.cast<double>();
255 Eigen::Vector3d new_size_tmp = new_size.cast<double>();
256 double iou = algorithm::CalculateIou2DXY<double>(old_center, old_size_tmp,
257 new_center, new_size_tmp);
258 // Step 4: compute dist
259 double dist = (1 - iou) * match_threshold;
260 return static_cast<float>(dist);
261}

◆ BboxSizeDistance()

float apollo::perception::lidar::BboxSizeDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  new_object,
const double  time_diff 
)

Compute bbox size distance for given track & object

参数
last_objectobject for computing distance
track_predictpredicted state of track for computing distance
new_objectnew detected object for computing distance
time_difftime interval from last matching
返回
float distance

在文件 distance_collection.cc 第 111 行定义.

114 {
115 // Compute bbox size distance for last object and new object
116 // range from 0 to 1
117
118 Eigen::Vector3f old_bbox_dir = last_object->output_direction.cast<float>();
119 Eigen::Vector3f new_bbox_dir = new_object->direction.cast<float>();
120 Eigen::Vector3f old_bbox_size = last_object->output_size.cast<float>();
121 Eigen::Vector3f new_bbox_size = new_object->size.cast<float>();
122
123 float size_dist = 0.0f;
124 double dot_val_00 = fabs(old_bbox_dir(0) * new_bbox_dir(0) +
125 old_bbox_dir(1) * new_bbox_dir(1));
126 double dot_val_01 = fabs(old_bbox_dir(0) * new_bbox_dir(1) -
127 old_bbox_dir(1) * new_bbox_dir(0));
128 float temp_val_0 = 0.0f;
129 float temp_val_1 = 0.0f;
130 if (dot_val_00 > dot_val_01) {
131 temp_val_0 = static_cast<float>(fabs(old_bbox_size(0) - new_bbox_size(0))) /
132 std::max(old_bbox_size(0), new_bbox_size(0));
133 temp_val_1 = static_cast<float>(fabs(old_bbox_size(1) - new_bbox_size(1))) /
134 std::max(old_bbox_size(1), new_bbox_size(1));
135 size_dist = std::min(temp_val_0, temp_val_1);
136 } else {
137 temp_val_0 = static_cast<float>(fabs(old_bbox_size(0) - new_bbox_size(1))) /
138 std::max(old_bbox_size(0), new_bbox_size(1));
139 temp_val_1 = static_cast<float>(fabs(old_bbox_size(1) - new_bbox_size(0))) /
140 std::max(old_bbox_size(1), new_bbox_size(0));
141 size_dist = std::min(temp_val_0, temp_val_1);
142 }
143
144 return size_dist;
145}

◆ BgObjectBuilder()

bool apollo::perception::lidar::BgObjectBuilder ( std::vector< base::ObjectPtr > *  objects,
Eigen::Affine3d &  lidar2novatel_pose 
)

background objects builder

参数
objectsbackground objects
返回
true
false

在文件 bg_object_builder.cc 第 27 行定义.

27 {
28 if (objects == nullptr) {
29 AINFO << "objects is null.";
30 return false;
31 }
32 ObjectBuilder object_builder;
33 object_builder.Init();
34 for (size_t i = 0; i < objects->size(); i++) {
35 if (objects->at(i)) {
36 object_builder.ComputePolygon2D(objects->at(i));
37 ComputePolygonDirection(Eigen::Vector3d(0, 0, 0), objects->at(i), &objects->at(i)->direction);
38 object_builder.ComputePolygonSizeCenter(objects->at(i));
39 object_builder.ComputeOtherObjectInformation(objects->at(i));
40 object_builder.ComputeHeightAboveGround(objects->at(i));
41 if (FLAGS_need_judge_front_critical) {
42 objects->at(i)->lidar_supplement.is_clustered = true;
43 object_builder.JudgeFrontCritical(objects->at(i), lidar2novatel_pose);
44 }
45 }
46 }
47 return true;
48}

◆ bound()

template<class T >
T apollo::perception::lidar::bound ( const T &  x,
const T &  min,
const T &  max 
)
inline

Get bound of value x

模板参数
T
参数
x
min
max
返回
T

在文件 misc.h 第 98 行定义.

98 {
99 return (x < min ? min : (x > max ? max : x));
100}

◆ CentroidShiftDistance()

float apollo::perception::lidar::CentroidShiftDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  cur_obj,
const double  time_diff 
)

Compute centroid shift distance for object and background match

参数
last_objectobject for computing distance
track_predictunused
cur_objnew detected object for computing distance
time_diffunused
返回
float distance

在文件 distance_collection.cc 第 192 行定义.

195 {
196 float dist = static_cast<float>(
197 (last_object->barycenter.head(2) - new_object->barycenter.head(2))
198 .norm());
199 return dist;
200}

◆ check_bound()

template<class T >
bool apollo::perception::lidar::check_bound ( const T &  x,
const T &  min,
const T &  max 
)
inline

Check bound of x

模板参数
T
参数
x
min
max
返回
true
false

在文件 misc.h 第 112 行定义.

112 {
113 return ((x < min) || (x > max));
114}

◆ ComputeBboxCornerHistoryVelocity()

void apollo::perception::lidar::ComputeBboxCornerHistoryVelocity ( TrackedObjectPtr  new_object,
const TrackedObjectConstPtr &  old_object,
const double &  time_diff,
TrackedObjectPtr  curr_object 
)

在文件 measurement_collection.cc 第 237 行定义.

239 {
240 // Compute 2D bbxo corner velocity measurement
241 Eigen::Vector3f old_dir_tmp = old_object->output_direction.cast<float>();
242 Eigen::Vector3d old_size = old_object->output_size;
243 Eigen::Vector3d old_center = old_object->output_center;
244 Eigen::Vector3f new_size_tmp;
245 Eigen::Vector3d new_center;
246 float minimum_edge_length = 0.01f;
247 base::PointDCloud& cloud =
248 (new_object->object_ptr->lidar_supplement).cloud_world;
249 algorithm::CalculateBBoxSizeCenter2DXY(
250 cloud, old_dir_tmp, &new_size_tmp, &new_center, minimum_edge_length);
251 Eigen::Vector3d old_dir = old_dir_tmp.cast<double>();
252 Eigen::Vector3d new_size = new_size_tmp.cast<double>();
253 Eigen::Vector3d ortho_old_dir(-old_dir(1), old_dir(0), 0.0);
254 Eigen::Vector3d old_bbox_corner_list[4];
255 Eigen::Vector3d new_bbox_corner_list[4];
256 Eigen::Vector3d old_bbox_corner = old_center + old_dir * old_size(0) * 0.5
257 + ortho_old_dir * old_size(1) * 0.5;
258 Eigen::Vector3d new_bbox_corner = new_center + old_dir * new_size(0) * 0.5
259 + ortho_old_dir * new_size(1) * 0.5;
260 old_bbox_corner_list[0] = old_bbox_corner;
261 new_bbox_corner_list[0] = new_bbox_corner;
262 old_bbox_corner = old_center - old_dir * old_size(0) * 0.5 +
263 ortho_old_dir * old_size(1) * 0.5;
264 new_bbox_corner = new_center - old_dir * new_size(0) * 0.5 +
265 ortho_old_dir * new_size(1) * 0.5;
266 old_bbox_corner_list[1] = old_bbox_corner;
267 new_bbox_corner_list[1] = new_bbox_corner;
268 old_bbox_corner = old_center + old_dir * old_size(0) * 0.5 -
269 ortho_old_dir * old_size(1) * 0.5;
270 new_bbox_corner = new_center + old_dir * new_size(0) * 0.5 -
271 ortho_old_dir * new_size(1) * 0.5;
272 old_bbox_corner_list[2] = old_bbox_corner;
273 new_bbox_corner_list[2] = new_bbox_corner;
274 old_bbox_corner = old_center - old_dir * old_size(0) * 0.5 -
275 ortho_old_dir * old_size(1) * 0.5;
276 new_bbox_corner = new_center - old_dir * new_size(0) * 0.5 -
277 ortho_old_dir * new_size(1) * 0.5;
278 old_bbox_corner_list[3] = old_bbox_corner;
279 new_bbox_corner_list[3] = new_bbox_corner;
280
281 // select project_dir by change of size
282 Eigen::Vector3d direct_old_size = old_object->size;
283 Eigen::Vector3d direct_new_size = new_object->size;
284 double length_change =
285 fabs(direct_old_size(0) - direct_new_size(0)) / direct_old_size(0);
286 double width_change =
287 fabs(direct_old_size(1) - direct_new_size(1)) / direct_old_size(1);
288
289 const double max_change_thres = 0.1;
290 Eigen::Vector3d project_dir;
291 if (length_change < max_change_thres && width_change < max_change_thres) {
292 project_dir = new_object->center - old_object->center;
293 } else {
294 project_dir = new_object->anchor_point - old_object->belief_anchor_point;
295 }
296 for (size_t i = 0; i < 4; ++i) {
297 old_bbox_corner = old_bbox_corner_list[i];
298 new_bbox_corner = new_bbox_corner_list[i];
299 Eigen::Vector3d bbox_corner_velocity =
300 ((new_bbox_corner - old_bbox_corner) / time_diff);
301 Eigen::Vector3d bbox_corner_velocity_on_project_dir =
302 algorithm::Calculate2DXYProjectVector<double>(bbox_corner_velocity,
303 project_dir);
304 // set velocity as 0 when conflict
305 if (bbox_corner_velocity_on_project_dir.dot(project_dir) <= 0) {
306 bbox_corner_velocity_on_project_dir = Eigen::Vector3d::Zero();
307 }
308 curr_object->measured_history_corners_velocity[i] =
309 bbox_corner_velocity_on_project_dir;
310 }
311}

◆ ComputeMinMaxDirectionPoint()

void apollo::perception::lidar::ComputeMinMaxDirectionPoint ( const base::ObjectPtr &  object,
const Eigen::Vector3d &  ref_center,
size_t *  max_point_index,
size_t *  min_point_index 
)

Compute min max direction

参数
objectnew object
ref_centerview point
max_point_indexmax point index
min_point_indexmin point index

在文件 lidar_object_util.cc 第 216 行定义.

220 {
221 Eigen::Vector3d p_0;
222 p_0[0] = object->polygon[0].x;
223 p_0[1] = object->polygon[0].y;
224 p_0[2] = object->polygon[0].z;
225 Eigen::Vector3d max_point = p_0 - ref_center;
226 Eigen::Vector3d min_point = p_0 - ref_center;
227 for (size_t i = 1; i < object->polygon.size(); ++i) {
228 Eigen::Vector3d p;
229 p[0] = object->polygon[i].x;
230 p[1] = object->polygon[i].y;
231 p[2] = object->polygon[i].z;
232 Eigen::Vector3d ray = p - ref_center;
233 // clock direction
234 if (max_point[0] * ray[1] - ray[0] * max_point[1] < kEpsilon) {
235 max_point = ray;
236 *max_point_index = i;
237 }
238 // unclock direction
239 if (min_point[0] * ray[1] - ray[0] * min_point[1] > kEpsilon) {
240 min_point = ray;
241 *min_point_index = i;
242 }
243 }
244}

◆ ComputeObjectShapeFromPolygon() [1/2]

void apollo::perception::lidar::ComputeObjectShapeFromPolygon ( std::shared_ptr< base::Object >  object,
bool  use_world_cloud = false 
)

compute object shape(center, size) from given direction and polygon

参数
objectobject, center and size will be updated
use_world_cloudwhether use world cloud or local cloud

◆ ComputeObjectShapeFromPolygon() [2/2]

void apollo::perception::lidar::ComputeObjectShapeFromPolygon ( std::shared_ptr< Object >  object,
bool  use_world_cloud 
)

在文件 lidar_object_util.cc 第 63 行定义.

64 {
65 const PointCloud<PointD>& polygon = object->polygon;
66 const PointCloud<PointF>& cloud = object->lidar_supplement.cloud;
67 const PointCloud<PointD>& world_cloud = object->lidar_supplement.cloud_world;
68
69 if (polygon.empty() || cloud.empty()) {
70 AINFO << "Failed to compute box, polygon size: " << polygon.size()
71 << " cloud size: " << cloud.size();
72 return;
73 }
74
75 // note here we assume direction is not changed
76 Eigen::Vector2d polygon_xy;
77 Eigen::Vector2d projected_polygon_xy;
78 Eigen::Vector3d raw_direction = object->direction.cast<double>();
79 Eigen::Vector2d direction = raw_direction.head<2>();
80 Eigen::Vector2d odirection(-direction(1), direction(0));
81
82 constexpr double kDoubleMax = std::numeric_limits<double>::max();
83 Eigen::Vector2d min_polygon_xy(kDoubleMax, kDoubleMax);
84 Eigen::Vector2d max_polygon_xy(-kDoubleMax, -kDoubleMax);
85
86 // note we keep this offset to avoid numeric precision issues in world frame
87 Eigen::Vector2d offset(object->polygon[0].x, object->polygon[0].y);
88
89 for (const auto& point : object->polygon.points()) {
90 polygon_xy << point.x, point.y;
91 polygon_xy -= offset;
92 projected_polygon_xy(0) = direction.dot(polygon_xy);
93 projected_polygon_xy(1) = odirection.dot(polygon_xy);
94 min_polygon_xy(0) = std::min(min_polygon_xy(0), projected_polygon_xy(0));
95 min_polygon_xy(1) = std::min(min_polygon_xy(1), projected_polygon_xy(1));
96 max_polygon_xy(0) = std::max(max_polygon_xy(0), projected_polygon_xy(0));
97 max_polygon_xy(1) = std::max(max_polygon_xy(1), projected_polygon_xy(1));
98 }
99
100 double min_z = 0.0;
101 double max_z = 0.0;
102 if (use_world_cloud) {
103 min_z = world_cloud[0].z;
104 max_z = world_cloud[0].z;
105 for (const auto& point : world_cloud.points()) {
106 min_z = std::min(min_z, point.z);
107 max_z = std::max(max_z, point.z);
108 }
109 } else {
110 min_z = cloud[0].z;
111 max_z = cloud[0].z;
112 for (const auto& point : cloud.points()) {
113 min_z = std::min(min_z, static_cast<double>(point.z));
114 max_z = std::max(max_z, static_cast<double>(point.z));
115 }
116 }
117
118 // update size
119 object->size << static_cast<float>(max_polygon_xy(0) - min_polygon_xy(0)),
120 static_cast<float>(max_polygon_xy(1) - min_polygon_xy(1)),
121 static_cast<float>(max_z - min_z);
122 // for safety issues, set a default minmium value
123 object->size(0) = std::max(object->size(0), 0.01f);
124 object->size(1) = std::max(object->size(1), 0.01f);
125 object->size(2) = std::max(object->size(2), 0.01f);
126 // update center
127 projected_polygon_xy << (min_polygon_xy(0) + max_polygon_xy(0)) * 0.5,
128 (min_polygon_xy(1) + max_polygon_xy(1)) * 0.5;
129 polygon_xy = projected_polygon_xy(0) * direction +
130 projected_polygon_xy(1) * odirection;
131 object->center << polygon_xy(0) + offset(0), polygon_xy(1) + offset(1), min_z;
132}

◆ ComputePolygonDirection()

void apollo::perception::lidar::ComputePolygonDirection ( const Eigen::Vector3d &  ref_center,
const base::ObjectPtr &  object,
Eigen::Vector3f *  direction 
)

Compute polygon direction

参数
ref_centerview point
objectnew object
directionorintation

在文件 lidar_object_util.cc 第 134 行定义.

137 {
138 if (object->polygon.size() == 0 ||
139 object->lidar_supplement.cloud.size() < 4u) {
140 return;
141 }
142 size_t max_point_index = 0;
143 size_t min_point_index = 0;
144 ComputeMinMaxDirectionPoint(
145 object, ref_center, &max_point_index, &min_point_index);
146 Eigen::Vector3d max_point(
147 object->polygon[max_point_index].x,
148 object->polygon[max_point_index].y,
149 object->polygon[max_point_index].z);
150 Eigen::Vector3d min_point(
151 object->polygon[min_point_index].x,
152 object->polygon[min_point_index].y,
153 object->polygon[min_point_index].z);
154 Eigen::Vector3d line = max_point - min_point;
155 double max_dis = 0;
156 bool vertices_in_vision = false;
157 size_t visible_max_start_point_index = 0;
158 size_t visible_max_end_point_index = 0;
159 for (size_t i = min_point_index, count = 0; count < object->polygon.size();
160 i = (i + 1) % object->polygon.size(), ++count) {
161 size_t j = (i + 1) % object->polygon.size();
162 Eigen::Vector3d p_i;
163 p_i[0] = object->polygon[i].x;
164 p_i[1] = object->polygon[i].y;
165 p_i[2] = object->polygon[i].z;
166 Eigen::Vector3d p_j;
167 p_j[0] = object->polygon[j].x;
168 p_j[1] = object->polygon[j].y;
169 p_j[2] = object->polygon[j].z;
170 Eigen::Vector3d ray;
171 if ((i == min_point_index && j == max_point_index) ||
172 (i == max_point_index && j == min_point_index)) {
173 continue;
174 } else {
175 if (j != min_point_index && j != max_point_index) {
176 ray = p_j - min_point;
177 } else { // j == min_point_index || j == max_point_index
178 ray = p_i - min_point;
179 }
180 if (line[0] * ray[1] - ray[0] * line[1] < kEpsilon) {
181 double dist = sqrt((p_j[0] - p_i[0]) * (p_j[0] - p_i[0]) +
182 (p_j[1] - p_i[1]) * (p_j[1] - p_i[1]));
183 if (dist > max_dis) {
184 max_dis = dist;
185 visible_max_start_point_index = i;
186 visible_max_end_point_index = j;
187 }
188 vertices_in_vision = true;
189 }
190 }
191 }
192 size_t start_point_index = 0;
193 size_t end_point_index = 0;
194 if (vertices_in_vision) {
195 start_point_index = visible_max_start_point_index;
196 end_point_index = visible_max_end_point_index;
197 } else {
198 start_point_index = min_point_index;
199 end_point_index = max_point_index;
200 }
201 Eigen::Vector3d start_point(
202 object->polygon[start_point_index].x,
203 object->polygon[start_point_index].y,
204 object->polygon[start_point_index].z);
205 Eigen::Vector3d end_point(
206 object->polygon[end_point_index].x,
207 object->polygon[end_point_index].y,
208 object->polygon[end_point_index].z);
209 Eigen::Vector3d dir = end_point - start_point;
210 *direction << static_cast<float>(dir[0]),
211 static_cast<float>(dir[1]),
212 static_cast<float>(dir[2]);
213 direction->normalize();
214}

◆ convolve_even()

void apollo::perception::lidar::convolve_even ( Image< float > *  src,
Image< float > *  dst,
const std::vector< float > &  mask 
)

convolve src with mask.

dst is flipped

参数
src
dst
mask

在文件 convolve.h 第 49 行定义.

49 {
50 int width = src->width();
51 int height = src->height();
52 int len = mask.size();
53 for (int y = 0; y < height; y++) {
54 for (int x = 0; x < width; x++) {
55 float sum = mask[0] * imRef(src, x, y);
56 for (int i = 1; i < len; i++) {
57 sum += mask[i] * (imRef(src, std::max(x - i, 0), y) + imRef(src, std::min(x + i, width - 1), y));
58 }
59 imRef(dst, y, x) = sum;
60 }
61 }
62}
int height() const
Get the height of an image
Definition image.h:73
int width() const
Get the width of an image
Definition image.h:64
#define imRef(im, x, y)
Definition image.h:88

◆ convolve_odd()

void apollo::perception::lidar::convolve_odd ( Image< float > *  src,
Image< float > *  dst,
const std::vector< float > &  mask 
)

convolve src with mask.

dst is flipped

参数
src
dst
mask

在文件 convolve.h 第 71 行定义.

71 {
72 int width = src->width();
73 int height = src->height();
74 int len = mask.size();
75 for (int y = 0; y < height; y++) {
76 for (int x = 0; x < width; x++) {
77 float sum = mask[0] * imRef(src, x, y);
78 for (int i = 1; i < len; i++) {
79 sum += mask[i] * (imRef(src, std::max(x - i, 0), y) - imRef(src, std::min(x + i, width - 1), y));
80 }
81 imRef(dst, y, x) = sum;
82 }
83 }
84}

◆ CYBER_REGISTER_COMPONENT() [1/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( BarrierRecognitionComponent  )

◆ CYBER_REGISTER_COMPONENT() [2/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( LidarCPDetectionComponent  )

◆ CYBER_REGISTER_COMPONENT() [3/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( LidarDetectionComponent  )

◆ CYBER_REGISTER_COMPONENT() [4/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( LidarDetectionFilterComponent  )

◆ CYBER_REGISTER_COMPONENT() [5/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( LidarOutputComponent  )

◆ CYBER_REGISTER_COMPONENT() [6/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( LidarSegmentationComponent  )

◆ CYBER_REGISTER_COMPONENT() [7/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( LidarTrackingComponent  )

◆ CYBER_REGISTER_COMPONENT() [8/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( PointCloudGroundDetectComponent  )

◆ CYBER_REGISTER_COMPONENT() [9/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( PointCloudMapROIComponent  )

◆ CYBER_REGISTER_COMPONENT() [10/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( PointCloudMotionComponent  )

◆ CYBER_REGISTER_COMPONENT() [11/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( PointCloudPreprocessComponent  )

◆ CYBER_REGISTER_COMPONENT() [12/12]

apollo::perception::lidar::CYBER_REGISTER_COMPONENT ( PointCloudSemanticComponent  )

◆ diff()

float apollo::perception::lidar::diff ( Image< float > *  I,
int  x1,
int  y1,
int  x2,
int  y2 
)
inline

Dissimilarity measure between pixels

参数
Iimage data
x1
y1
x2
y2
返回
float

在文件 segment_image.h 第 55 行定义.

55 {
56 return std::fabs(imRef(I, x1, y1) - imRef(I, x2, y2));
57}

◆ DirectionDistance()

float apollo::perception::lidar::DirectionDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  new_object,
const double  time_diff 
)

Compute direction distance for given track & object

参数
last_objectobject for computing distance
track_predictpredicted state of track for computing distance
new_objectnew detected object for computing distance
time_difftime interval from last matching
返回
float distance

在文件 distance_collection.cc 第 82 行定义.

85 {
86 // Compute direction distance for last object and new object
87 // range from 0 to 2
88
89 Eigen::Vector3f old_anchor_point =
90 (last_object->belief_anchor_point).cast<float>();
91 Eigen::Vector3f new_anchor_point = (new_object->anchor_point).cast<float>();
92 Eigen::Vector3f anchor_point_shift_dir = new_anchor_point - old_anchor_point;
93 anchor_point_shift_dir[2] = 0.0;
94
95 Eigen::Vector3f track_motion_dir = track_predict.head(6).tail(3);
96 track_motion_dir[2] = 0.0;
97
98 double cos_theta = 0.994; // average cos
99 if (!track_motion_dir.head(2).isZero() &&
100 !anchor_point_shift_dir.head(2).isZero()) {
101 // cos_theta = vector_cos_theta_2d_xy(track_motion_dir,
102 // anchor_point_shift_dir);
103 cos_theta = algorithm::CalculateCosTheta2DXY<float>(track_motion_dir,
104 anchor_point_shift_dir);
105 }
106 float direction_dist = static_cast<float>(-cos_theta) + 1.0f;
107
108 return direction_dist;
109}

◆ DisjointSetFind()

template<class T >
T * apollo::perception::lidar::DisjointSetFind ( T *  x)

在文件 disjoint_set.h 第 55 行定义.

55 {
56 T* y = x->parent;
57 if (y == x || y->parent == y) {
58 return y;
59 }
60 T* root = DisjointSetFindLoop(y->parent);
61 x->parent = root;
62 y->parent = root;
63 return root;
64}

◆ DisjointSetFindLoop()

template<class T >
T * apollo::perception::lidar::DisjointSetFindLoop ( T *  x)

在文件 disjoint_set.h 第 37 行定义.

37 {
38 T* y = x;
39 while (y->parent != y) {
40 y = y->parent;
41 }
42
43 T* w = x;
44 T* temp = x;
45 while (w->parent != w) {
46 temp = w->parent;
47 w->parent = y;
48 w = temp;
49 }
50
51 return y;
52}

◆ DisjointSetFindRecursive()

template<class T >
T * apollo::perception::lidar::DisjointSetFindRecursive ( T *  x)

在文件 disjoint_set.h 第 29 行定义.

29 {
30 if (x->parent != x) {
31 x->parent = DisjointSetFindRecursive(x->parent);
32 }
33 return x->parent;
34}

◆ DisjointSetMakeSet()

template<class T >
void apollo::perception::lidar::DisjointSetMakeSet ( T *  x)

在文件 disjoint_set.h 第 23 行定义.

23 {
24 x->parent = x;
25 x->node_rank = 0;
26}

◆ DisjointSetMerge()

template<class T >
void apollo::perception::lidar::DisjointSetMerge ( T *  x,
const T *  y 
)

在文件 disjoint_set.h 第 67 行定义.

67{}

◆ DisjointSetUnion()

template<class T >
void apollo::perception::lidar::DisjointSetUnion ( T *  x,
T *  y 
)

在文件 disjoint_set.h 第 70 行定义.

70 {
71 x = DisjointSetFind(x);
72 y = DisjointSetFind(y);
73 if (x == y) {
74 return;
75 }
76 if (x->node_rank < y->node_rank) {
77 x->parent = y;
78 // DisjointSetMerge(y, x);
79 } else if (y->node_rank < x->node_rank) {
80 y->parent = x;
81 // DisjointSetMerge(x, y);
82 } else {
83 y->parent = x;
84 x->node_rank++;
85 // DisjointSetMerge(x, y);
86 }
87}

◆ DownSampleCloudByVoxelGrid() [1/2]

void apollo::perception::lidar::DownSampleCloudByVoxelGrid ( const pcl::PointCloud< pcl::PointXYZI >::Ptr &  cloud_ptr,
const pcl::PointCloud< pcl::PointXYZI >::Ptr &  filtered_cloud_ptr,
float  lx = 0.01f,
float  ly = 0.01f,
float  lz = 0.01f 
)
inline

在文件 pcl_util.h 第 128 行定义.

131 {
132 pcl::VoxelGrid<pcl::PointXYZI> voxel_grid;
133 voxel_grid.setInputCloud(cloud_ptr);
134 voxel_grid.setLeafSize(lx, ly, lz);
135 voxel_grid.filter(*filtered_cloud_ptr);
136}

◆ DownSampleCloudByVoxelGrid() [2/2]

template<typename PointT >
void apollo::perception::lidar::DownSampleCloudByVoxelGrid ( const typename pcl::PointCloud< PointT >::Ptr &  input_cloud_ptr,
typename pcl::PointCloud< PointT >::Ptr  output_cloud_ptr,
float  lx = 0.01f,
float  ly = 0.01f,
float  lz = 0.01f 
)

在文件 pointcloud_util.h 第 46 行定义.

49 {
50 pcl::VoxelGrid<PointT> voxel_grid;
51 voxel_grid.setInputCloud(input_cloud_ptr);
52 voxel_grid.setLeafSize(lx, ly, lz);
53 voxel_grid.filter(*output_cloud_ptr);
54}

◆ DownSamplePointCloud()

template<typename PointT >
void apollo::perception::lidar::DownSamplePointCloud ( const typename pcl::PointCloud< PointT >::Ptr &  intput_cloud_ptr,
typename pcl::PointCloud< PointT >::Ptr  out_cloud_ptr,
int  num_points 
)

在文件 pointcloud_util.h 第 81 行定义.

83 {
84 if (num_points <= 0) {
85 std::cerr << "Invalid number of points to downsample: " << num_points
86 << std::endl;
87 }
88
89 pcl::RandomSample<PointT> sampler;
90 sampler.setInputCloud(intput_cloud_ptr);
91 sampler.setSample(num_points);
92 sampler.filter(*out_cloud_ptr);
93}

◆ DrawPolygonMask()

template<typename T >
bool apollo::perception::lidar::DrawPolygonMask ( const typename PolygonScanCvter< T >::Polygon &  polygon,
Bitmap2D *  bitmap,
const double  extend_dist = 0.0,
const bool  no_edge_table = false 
)

在文件 polygon_mask.h 第 43 行定义.

45 {
46 typedef typename PolygonScanCvter<T>::IntervalIn IntervalIn;
47 typedef typename PolygonScanCvter<T>::IntervalOut IntervalOut;
48 typedef typename PolygonScanCvter<T>::DirectionMajor PolyDirMajor;
49 if (bitmap->Empty()) {
50 AERROR << "bitmap is empty";
51 return false;
52 }
53 Eigen::Vector2d poly_min_p, poly_max_p;
54 poly_min_p.setConstant(std::numeric_limits<double>::max());
55 poly_max_p = -poly_min_p;
56 for (const auto& pt : polygon) {
57 poly_min_p.x() = std::min(pt.x(), poly_min_p.x());
58 poly_min_p.y() = std::min(pt.y(), poly_min_p.y());
59
60 poly_max_p.x() = std::max(pt.x(), poly_max_p.x());
61 poly_max_p.y() = std::max(pt.y(), poly_max_p.y());
62 }
63 if (poly_max_p.x() <= poly_min_p.x()) {
64 AERROR << "Invalid polygon";
65 return false;
66 }
67 if (poly_max_p.y() <= poly_min_p.y()) {
68 AERROR << "Invalid polygon";
69 return false;
70 }
71 const Eigen::Vector2d& bitmap_min_range = bitmap->min_range();
72 const Eigen::Vector2d& bitmap_max_range = bitmap->max_range();
73 const Eigen::Vector2d& cell_size = bitmap->cell_size();
74 const int major_dir = bitmap->dir_major();
75 const int op_major_dir = bitmap->op_dir_major();
76
77 // check major x range
78 IntervalIn valid_range;
79 valid_range.first =
80 std::max(poly_min_p[major_dir], bitmap_min_range[major_dir]);
81 valid_range.second =
82 std::min(poly_max_p[major_dir], bitmap_max_range[major_dir]);
83
84 // for numerical stability
85 valid_range.first =
86 (static_cast<int>((valid_range.first - bitmap_min_range[major_dir]) /
87 cell_size[major_dir]) +
88 0.5) *
89 cell_size[major_dir] +
90 bitmap_min_range[major_dir];
91
92 if (valid_range.second < valid_range.first + cell_size[major_dir]) {
93 AWARN << "Invalid range: " << valid_range.first << " " << valid_range.second
94 << ". polygon major directory range: " << poly_min_p[major_dir] << " "
95 << poly_max_p[major_dir] << ". cell size: " << cell_size[major_dir];
96 return true;
97 }
98
99 // start calculating intervals of scans
100 PolygonScanCvter<T> poly_scan_cvter;
101 poly_scan_cvter.Init(polygon);
102 std::vector<std::vector<IntervalOut>> scans_intervals;
103 if (no_edge_table) {
104 size_t scans_size = static_cast<size_t>(
105 (valid_range.second - valid_range.first) / cell_size[major_dir]);
106 scans_intervals.resize(scans_size);
107 for (size_t i = 0; i < scans_size; ++i) {
108 double scan_loc = valid_range.first + i * cell_size[major_dir];
109 poly_scan_cvter.ScanCvt(scan_loc, static_cast<PolyDirMajor>(major_dir),
110 &(scans_intervals[i]));
111 }
112 } else {
113 poly_scan_cvter.ScansCvt(valid_range, static_cast<PolyDirMajor>(major_dir),
114 cell_size[major_dir], &(scans_intervals));
115 }
116 // start to draw
117 double x = valid_range.first;
118 for (size_t i = 0; i < scans_intervals.size();
119 x += cell_size[major_dir], ++i) {
120 for (auto scan_interval : scans_intervals[i]) {
121 if (scan_interval.first > scan_interval.second) {
122 AERROR << "The input polygon is illegal(complex polygon)";
123 return false;
124 }
125
126 // extend
127 scan_interval.first -= extend_dist;
128 scan_interval.second += extend_dist;
129
130 IntervalOut valid_y_range;
131 valid_y_range.first =
132 std::max(bitmap_min_range[op_major_dir], scan_interval.first);
133 valid_y_range.second =
134 std::min(bitmap_max_range[op_major_dir], scan_interval.second);
135 if (valid_y_range.first > valid_y_range.second) {
136 continue;
137 }
138 bitmap->Set(x, valid_y_range.first, valid_y_range.second);
139 }
140 }
141 return true;
142}
const Eigen::Vector2d & max_range() const
Return the max_range_
Definition bitmap2d.h:68
void Set(const Eigen::Vector2d &p)
Set the vector p
Definition bitmap2d.cc:128
int dir_major() const
Return the dir_major_
Definition bitmap2d.h:103
const Eigen::Vector2d & min_range() const
Return the min_range_
Definition bitmap2d.h:61
int op_dir_major() const
Return the op_dir_major
Definition bitmap2d.h:110
bool Empty() const
cehck the bitmap_ is emtpy
Definition bitmap2d.h:136
const Eigen::Vector2d & cell_size() const
Return the cell_size_
Definition bitmap2d.h:75
#define AERROR
Definition log.h:44
#define AWARN
Definition log.h:43

◆ DrawPolygonsMask()

template<typename T >
bool apollo::perception::lidar::DrawPolygonsMask ( const std::vector< typename PolygonScanCvter< T >::Polygon > &  polygons,
Bitmap2D *  bitmap,
const double  extend_dist = 0.0,
const bool  no_edge_table = false 
)

在文件 polygon_mask.h 第 145 行定义.

147 {
148 for (const auto& polygon : polygons) {
149 bool flag = DrawPolygonMask<T>(polygon, bitmap, extend_dist, no_edge_table);
150 if (!flag) {
151 return false;
152 }
153 }
154 return true;
155}

◆ EuclideanDistance()

float apollo::perception::lidar::EuclideanDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  new_object,
const double  time_diff 
)

: compute euclidean distance for given track & object

参数
last_objectobject for computing distance
track_predictpredicted state of track for computing distance
new_objectnew detected object for computing distance
time_difftime interval from last matching
返回
: euclidean distance

在文件 distance_collection.cc 第 31 行定义.

34 {
35 Eigen::Vector3f measured_anchor = (new_object->barycenter).cast<float>();
36 Eigen::Vector3f predicted_anchor = track_predict.head(3);
37 Eigen::Vector3f measured_diff = measured_anchor - predicted_anchor;
38
39 float location_dist = measured_diff.head(2).norm();
40 return location_dist;
41}

◆ F2I()

int apollo::perception::lidar::F2I ( float  val,
float  ori,
float  scale 
)
inline

在文件 util.h 第 33 行定义.

33 {
34 return static_cast<int>(std::floor((ori - val) * scale));
35}

◆ FilterPointsOutsideRange()

template<typename PointT >
void apollo::perception::lidar::FilterPointsOutsideRange ( const typename pcl::PointCloud< PointT >::Ptr &  input_cloud_ptr,
const std::string &  filter_axis,
const double &  limit_min,
const double &  limit_max,
typename pcl::PointCloud< PointT >::Ptr  output_cloud_ptr 
)

在文件 pointcloud_util.h 第 57 行定义.

61 {
62 pcl::PassThrough<PointT> pass;
63 pass.setInputCloud(input_cloud_ptr);
64 pass.setFilterFieldName(filter_axis);
65 pass.setFilterLimits(limit_min, limit_max);
66 pass.filter(*output_cloud_ptr);
67}

◆ gaussian()

double apollo::perception::lidar::gaussian ( double  val,
double  sigma 
)
inline

Get gaussian value of val based on sigma

参数
val
sigma
返回
double

在文件 misc.h 第 140 行定义.

140 {
141 return exp(-square(val / sigma) / 2) / (sqrt(2 * M_PI) * sigma);
142}
T square(const T &x)
get square of value x
Definition misc.h:85

◆ get_3dbox_iou()

float apollo::perception::lidar::get_3dbox_iou ( base::ObjectPtr  obj1,
base::ObjectPtr  obj2 
)

在文件 center_point_detection.cc 第 150 行定义.

150 {
151 auto center1 = obj1->center;
152 auto center2 = obj2->center;
153 auto size1 = obj1->size;
154 auto size2 = obj2->size;
155 float x_len = get_3Dbox_iou_len(center1(0), size1(0), center2(0), size2(0));
156 float y_len = get_3Dbox_iou_len(center1(1), size1(1), center2(1), size2(1));
157 float z_len = get_3Dbox_iou_len(center1(2), size1(2), center2(2), size2(2));
158 float v1 = size1(0) * size1(1) * size1(2);
159 float v2 = size2(0) * size2(1) * size2(2);
160 float vo = x_len * y_len * z_len;
161 return vo / (v1 + v2 - vo);
162}
float get_3Dbox_iou_len(float center1, float len1, float center2, float len2)

◆ get_3Dbox_iou_len()

float apollo::perception::lidar::get_3Dbox_iou_len ( float  center1,
float  len1,
float  center2,
float  len2 
)

在文件 center_point_detection.cc 第 139 行定义.

139 {
140 float x11 = center1 - len1 / 2;
141 float x12 = center2 - len2 / 2;
142 float x21 = center1 + len1 / 2;
143 float x22 = center2 + len2 / 2;
144 if (std::min(x22, x21) - std::max(x12, x11) < 0) {
145 return 0;
146 }
147 return std::min(x22, x21) - std::max(x12, x11);
148}

◆ GetBoundingBox2d() [1/2]

void apollo::perception::lidar::GetBoundingBox2d ( const std::shared_ptr< base::Object > &  object,
base::PointCloud< base::PointD > *  box,
double  expand = 0.0 
)

Get the Bounding Box vertices and save in polygon type

参数
object
boxbounding box vertices(4 in xy plane)
expandexpand valud, in meter

◆ GetBoundingBox2d() [2/2]

void apollo::perception::lidar::GetBoundingBox2d ( const std::shared_ptr< Object > &  object,
PointCloud< PointD > *  box,
double  expand 
)

在文件 lidar_object_util.cc 第 35 行定义.

36 {
37 box->clear();
38 box->resize(4);
39
40 Eigen::Vector3d direction = object->direction.cast<double>();
41 Eigen::Vector3d odirection(-direction(1), direction(0), 0.0);
42 double half_length = object->size(0) * 0.5 + expand;
43 double half_width = object->size(1) * 0.5 + expand;
44
45 box->at(0).x = half_length * direction(0) + half_width * odirection(0) +
46 object->center(0);
47 box->at(0).y = half_length * direction(1) + half_width * odirection(1) +
48 object->center(1);
49 box->at(1).x = -half_length * direction(0) + half_width * odirection(0) +
50 object->center(0);
51 box->at(1).y = -half_length * direction(1) + half_width * odirection(1) +
52 object->center(1);
53 box->at(2).x = -half_length * direction(0) - half_width * odirection(0) +
54 object->center(0);
55 box->at(2).y = -half_length * direction(1) - half_width * odirection(1) +
56 object->center(1);
57 box->at(3).x = half_length * direction(0) - half_width * odirection(0) +
58 object->center(0);
59 box->at(3).y = half_length * direction(1) - half_width * odirection(1) +
60 object->center(1);
61}
const PointT * at(size_t col, size_t row) const
Definition point_cloud.h:63
virtual void resize(size_t size)
Definition point_cloud.h:88

◆ GetIndex()

uint32_t apollo::perception::lidar::GetIndex ( uint32_t  r,
uint32_t  c,
uint32_t  cols 
)
inline

在文件 ground_service.cc 第 69 行定义.

69 {
70 return (r * cols + c);
71}

◆ GetMotionLabel()

PointMotionLabel apollo::perception::lidar::GetMotionLabel ( uint8_t  value)
inline

在文件 lidar_point_label.h 第 70 行定义.

70 {
71 return static_cast<PointMotionLabel>(value >> 4);
72}

◆ GetSemanticLabel()

PointSemanticLabel apollo::perception::lidar::GetSemanticLabel ( uint8_t  value)
inline

在文件 lidar_point_label.h 第 56 行定义.

56 {
57 return static_cast<PointSemanticLabel>(value & 15);
58}

◆ GPUAssert()

void apollo::perception::lidar::GPUAssert ( cudaError_t  code,
const char *  file,
int  line,
bool  abort = true 
)
inline

在文件 common.h 第 80 行定义.

81 {
82 if (code != cudaSuccess) {
83 fprintf(stderr, "GPUassert: %s %s %d\n", cudaGetErrorString(code), file,
84 line);
85 if (abort) exit(code);
86 }
87}

◆ GroupPc2Pixel()

void apollo::perception::lidar::GroupPc2Pixel ( float  pc_x,
float  pc_y,
float  scale,
float  range,
int *  x,
int *  y 
)
inline

在文件 util.h 第 38 行定义.

39 {
40 float fx = (range - (0.707107f * (pc_x + pc_y))) * scale;
41 float fy = (range - (0.707107f * (pc_x - pc_y))) * scale;
42 *x = fx < 0 ? -1 : static_cast<int>(fx);
43 *y = fy < 0 ? -1 : static_cast<int>(fy);
44}

◆ HistogramDistance()

float apollo::perception::lidar::HistogramDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  new_object,
const double  time_diff 
)

Compute histogram distance for given track & object

参数
last_objectobject for computing distance
track_predictpredicted state of track for computing distance
new_objectnew detected object for computing distance
time_difftime interval from last matching
返回
float distance

在文件 distance_collection.cc 第 166 行定义.

169 {
170 // Compute histogram distance for last object and new object
171 // range from 0 to 3
172
173 const std::vector<float>& old_object_shape_features =
174 last_object->shape_features;
175 const std::vector<float>& new_object_shape_features =
176 new_object->shape_features;
177
178 if (old_object_shape_features.size() != new_object_shape_features.size()) {
179 AINFO << "sizes of compared features not matched. TrackObjectDistance";
180 return 100;
181 }
182
183 float histogram_dist = 0.0f;
184 for (size_t i = 0; i < old_object_shape_features.size(); ++i) {
185 histogram_dist +=
186 std::fabs(old_object_shape_features[i] - new_object_shape_features[i]);
187 }
188
189 return histogram_dist;
190}

◆ image_float2uchar() [1/2]

Image< uchar > * apollo::perception::lidar::image_float2uchar ( Image< float > *  input)

Transform float to uchar

参数
input
返回
Image<uchar>*

在文件 imconv.h 第 147 行定义.

147 {
148 float min, max;
149 min_max(input, &min, &max);
150 return image_float2uchar(input, min, max);
151}
void min_max(Image< T > *im, T *ret_min, T *ret_max)
Compute minimum and maximum value in an image
Definition imutil.h:50
Image< uchar > * image_float2uchar(Image< float > *input, float min, float max)
Transform float to uchar
Definition imconv.h:125

◆ image_float2uchar() [2/2]

Image< uchar > * apollo::perception::lidar::image_float2uchar ( Image< float > *  input,
float  min,
float  max 
)

Transform float to uchar

参数
input
min
max
返回
Image<uchar>*

在文件 imconv.h 第 125 行定义.

125 {
126 int width = input->width();
127 int height = input->height();
128 Image<uchar> *output = new Image<uchar>(width, height, false);
129 if (max == min) {
130 return output;
131 }
132 float scale = std::numeric_limits<unsigned char>::max() / (max - min);
133 for (int y = 0; y < height; y++) {
134 for (int x = 0; x < width; x++) {
135 uchar val = (uchar)((imRef(input, x, y) - min) * scale);
136 imRef(output, x, y) = bound(val, (uchar)0, (uchar)std::numeric_limits<unsigned char>::max());
137 }
138 }
139 return output;
140}

◆ image_gray2rgb()

Image< rgb > * apollo::perception::lidar::image_gray2rgb ( Image< uchar > *  input)

Tranform gray to rgb

参数
input
返回
Image<rgb>*

在文件 imconv.h 第 70 行定义.

70 {
71 int width = input->width();
72 int height = input->height();
73 Image<rgb> *output = new Image<rgb>(width, height, false);
74 for (int y = 0; y < height; y++) {
75 for (int x = 0; x < width; x++) {
76 imRef(output, x, y).r = imRef(input, x, y);
77 imRef(output, x, y).g = imRef(input, x, y);
78 imRef(output, x, y).b = imRef(input, x, y);
79 }
80 }
81 return output;
82}

◆ image_int2float()

Image< float > * apollo::perception::lidar::image_int2float ( Image< int > *  input)

Transform int to float

参数
input
返回
Image<float>*

在文件 imconv.h 第 106 行定义.

106 {
107 int width = input->width();
108 int height = input->height();
109 Image<float> *output = new Image<float>(width, height, false);
110 for (int y = 0; y < height; y++) {
111 for (int x = 0; x < width; x++) {
112 imRef(output, x, y) = imRef(input, x, y);
113 }
114 }
115 return output;
116}

◆ image_long2uchar() [1/2]

Image< uchar > * apollo::perception::lidar::image_long2uchar ( Image< uint32_t > *  input)

Transform long to uchar

参数
input
返回
Image<uchar>*

在文件 imconv.h 第 199 行定义.

199 {
200 uint32_t min, max;
201 min_max(input, &min, &max);
202 return image_long2uchar(input, min, max);
203}
Image< uchar > * image_long2uchar(Image< uint32_t > *input, uint32_t min, uint32_t max)
Transform long to uchar
Definition imconv.h:177

◆ image_long2uchar() [2/2]

Image< uchar > * apollo::perception::lidar::image_long2uchar ( Image< uint32_t > *  input,
uint32_t  min,
uint32_t  max 
)

Transform long to uchar

参数
input
min
max
返回
Image<uchar>*

在文件 imconv.h 第 177 行定义.

177 {
178 int width = input->width();
179 int height = input->height();
180 Image<uchar> *output = new Image<uchar>(width, height, false);
181 if (max == min) {
182 return output;
183 }
184 float scale = std::numeric_limits<unsigned char>::max() / static_cast<float>(max - min);
185 for (int y = 0; y < height; y++) {
186 for (int x = 0; x < width; x++) {
187 uchar val = (uchar)((imRef(input, x, y) - min) * scale);
188 imRef(output, x, y) = bound(val, (uchar)0, (uchar)std::numeric_limits<unsigned char>::max());
189 }
190 }
191 return output;
192}

◆ image_rgb2gray()

Image< uchar > * apollo::perception::lidar::image_rgb2gray ( Image< rgb > *  input)

Transform rgb to gray

参数
input
返回
Image<uchar>*

在文件 imconv.h 第 52 行定义.

52 {
53 int width = input->width();
54 int height = input->height();
55 Image<uchar> *output = new Image<uchar>(width, height, false);
56 for (int y = 0; y < height; y++) {
57 for (int x = 0; x < width; x++) {
58 imRef(output, x, y) = (uchar)(imRef(input, x, y).r * RED_WEIGHT + imRef(input, x, y).g * GREEN_WEIGHT
59 + imRef(input, x, y).b * BLUE_WEIGHT);
60 }
61 }
62 return output;
63}
const double BLUE_WEIGHT
Definition imconv.h:45
unsigned char uchar
Definition misc.h:38
const double RED_WEIGHT
Definition imconv.h:43
const double GREEN_WEIGHT
Definition imconv.h:44

◆ image_short2uchar() [1/2]

Image< uchar > * apollo::perception::lidar::image_short2uchar ( Image< uint16_t > *  input)

Transform short to uchar

参数
input
返回
Image<uchar>*

在文件 imconv.h 第 234 行定义.

234 {
235 uint16_t min, max;
236 min_max(input, &min, &max);
237 return image_short2uchar(input, min, max);
238}
Image< uchar > * image_short2uchar(Image< uint16_t > *input, uint16_t min, uint16_t max)
Transform short to uchar
Definition imconv.h:212

◆ image_short2uchar() [2/2]

Image< uchar > * apollo::perception::lidar::image_short2uchar ( Image< uint16_t > *  input,
uint16_t  min,
uint16_t  max 
)

Transform short to uchar

参数
input
min
max
返回
Image<uchar>*

在文件 imconv.h 第 212 行定义.

212 {
213 int width = input->width();
214 int height = input->height();
215 Image<uchar> *output = new Image<uchar>(width, height, false);
216 if (max == min) {
217 return output;
218 }
219 float scale = std::numeric_limits<unsigned char>::max() / static_cast<float>(max - min);
220 for (int y = 0; y < height; y++) {
221 for (int x = 0; x < width; x++) {
222 uchar val = (uchar)((imRef(input, x, y) - min) * scale);
223 imRef(output, x, y) = bound(val, (uchar)0, (uchar)std::numeric_limits<unsigned char>::max());
224 }
225 }
226 return output;
227}

◆ image_uchar2float()

Image< float > * apollo::perception::lidar::image_uchar2float ( Image< uchar > *  input)

Transform uchar to float

参数
input
返回
Image<float>*

在文件 imconv.h 第 89 行定义.

89 {
90 int width = input->width();
91 int height = input->height();
92 Image<float> *output = new Image<float>(width, height, false);
93 for (int y = 0; y < height; y++) {
94 for (int x = 0; x < width; x++) {
95 imRef(output, x, y) = imRef(input, x, y);
96 }
97 }
98 return output;
99}

◆ image_uchar2long()

Image< uint32_t > * apollo::perception::lidar::image_uchar2long ( Image< uchar > *  input)

Transform unchar to long

参数
input
返回
Image<uint32_t>*

在文件 imconv.h 第 158 行定义.

158 {
159 int width = input->width();
160 int height = input->height();
161 Image<uint32_t> *output = new Image<uint32_t>(width, height, false);
162 for (int y = 0; y < height; y++) {
163 for (int x = 0; x < width; x++) {
164 imRef(output, x, y) = imRef(input, x, y);
165 }
166 }
167 return output;
168}

◆ IsMotionLabelEqual()

bool apollo::perception::lidar::IsMotionLabelEqual ( PointMotionLabel  label,
uint8_t  value 
)
inline

在文件 lidar_point_label.h 第 74 行定义.

74 {
75 return (value >> 4) == static_cast<uint8_t>(label);
76}

◆ IsSemanticLabelEqual()

bool apollo::perception::lidar::IsSemanticLabelEqual ( PointSemanticLabel  label,
uint8_t  value 
)
inline

在文件 lidar_point_label.h 第 60 行定义.

60 {
61 return (value & 15) == static_cast<uint8_t>(label);
62}

◆ JudgeBlindTrafficCone()

bool apollo::perception::lidar::JudgeBlindTrafficCone ( const MlfTrackDataConstPtr &  track_data,
double  frame_timestamp,
const Eigen::Vector3d &  local_to_global_offset,
Eigen::Affine3d &  lidar2world_pose,
Eigen::Affine3d &  lidar2novatel_pose 
)

在文件 util.cc 第 24 行定义.

26 {
27 TrackedObjectConstPtr latest_object = track_data->GetLatestObject().second;
28 if (!FLAGS_need_reserve_blind_cone || latest_object == nullptr) {
29 return false;
30 }
31 // reserve condition: TrafficCone
32 // reserve condition: static
33 // reserve condition: within reserve time
34 double time_diff = frame_timestamp - track_data->GetLatestObject().first;
35 if (latest_object->output_velocity.head<2>().norm() > 0.01 ||
36 latest_object->object_ptr->sub_type != base::ObjectSubType::TRAFFICCONE
37 || time_diff >= FLAGS_cone_reserve_time) {
38 return false;
39 }
40
41 // reserve condition: front
42 Eigen::Vector3d world_center = Eigen::Vector3d(
43 latest_object->center(0) + local_to_global_offset(0),
44 latest_object->center(1) + local_to_global_offset(1),
45 latest_object->center(2) + local_to_global_offset(2));
46
47 // from world to lidar to imu
48 Eigen::Vector3d lidar_center = Eigen::Vector3d(1, 0, 0);
49 lidar_center = lidar2world_pose.inverse() * world_center;
50
51 Eigen::Vector3d imu_center = Eigen::Vector3d(1, 0, 0);
52 imu_center = lidar2novatel_pose * lidar_center;
53
54 if (imu_center(0) <= FLAGS_cone_x_front &&
55 imu_center(0) >= FLAGS_cone_x_back &&
56 imu_center(1) <= FLAGS_cone_y_front &&
57 imu_center(1) >= FLAGS_cone_y_back) {
58 AINFO << "[JudgeBlindTrafficCone] track_id: " << track_data->track_id_
59 << " loc: (x) " << imu_center(0) << " (y) " << imu_center(1)
60 << " reserve. time_diff: " << time_diff;
61 return true;
62 }
63 return false;
64}
std::shared_ptr< const TrackedObject > TrackedObjectConstPtr

◆ laplacian()

Image< float > * apollo::perception::lidar::laplacian ( Image< float > *  src)

Compute laplacian

参数
src
返回
Image<float>*

在文件 filter.h 第 115 行定义.

115 {
116 int width = src->width();
117 int height = src->height();
118 Image<float> *dst = new Image<float>(width, height);
119 for (int y = 1; y < height - 1; y++) {
120 for (int x = 1; x < width - 1; x++) {
121 float d2x = imRef(src, x - 1, y) + imRef(src, x + 1, y) - 2 * imRef(src, x, y);
122 float d2y = imRef(src, x, y - 1) + imRef(src, x, y + 1) - 2 * imRef(src, x, y);
123 imRef(dst, x, y) = d2x + d2y;
124 }
125 }
126 return dst;
127}

◆ LineFit2D()

bool apollo::perception::lidar::LineFit2D ( const base::PointFCloud &  cloud,
Eigen::Vector3f *  params 
)

line fitting according to max variance direction of pointcloud

模板参数
PointCloudT
参数
cloud
params
返回
true
false

在文件 object_split.cc 第 91 行定义.

91 {
92 if (cloud.size() < 2) {
93 return false;
94 }
95 Eigen::Vector2f mean(0, 0);
96 Eigen::Matrix2f covariance = Eigen::Matrix2f::Zero();
97 for (size_t i = 0; i < cloud.size(); ++i) {
98 const auto& pt = cloud.at(i);
99 mean(0) += pt.x;
100 mean(1) += pt.y;
101 }
102 mean /= cloud.size();
103 for (size_t i = 0; i < cloud.size(); ++i) {
104 const auto& pt = cloud.at(i);
105 float dx = pt.x - mean(0);
106 float dy = pt.y - mean(1);
107 covariance(0, 0) += dx * dx;
108 covariance(1, 1) += dy * dy;
109 covariance(0, 1) += dx * dy;
110 }
111 covariance(1, 0) = covariance(0, 1);
112 covariance /= cloud.size();
113 Eigen::SelfAdjointEigenSolver<Eigen::Matrix2f> solver(covariance);
114 if (solver.info() != Eigen::Success) {
115 return false;
116 }
117 Eigen::Vector2f values = solver.eigenvalues();
118 Eigen::Vector2f normal
119 = std::abs(values(0)) < std::abs(values(1)) ? solver.eigenvectors().col(0) : solver.eigenvectors().col(1);
120 normal.normalize();
121 params->head(2) = normal;
122 (*params)[2] = -normal.dot(mean);
123 return true;
124}

◆ LoadPCLPCD()

bool apollo::perception::lidar::LoadPCLPCD ( const std::string &  file_path,
base::PointFCloud *  cloud_out 
)
inline

在文件 pcl_util.h 第 54 行定义.

55 {
56 pcl::PointCloud<PCLPointXYZIT> org_cloud;
57 if (pcl::io::loadPCDFile(file_path, org_cloud) < 0) {
58 AERROR << "Failed to load pcd file " << file_path;
59 return false;
60 }
61 cloud_out->resize(org_cloud.size());
62 for (size_t i = 0; i < org_cloud.size(); ++i) {
63 auto& pt = org_cloud.points[i];
64 auto& new_pt = cloud_out->at(i);
65 new_pt.x = pt.x;
66 new_pt.y = pt.y;
67 new_pt.z = pt.z;
68 new_pt.intensity = pt.intensity;
69 cloud_out->mutable_points_timestamp()->at(i) = pt.timestamp;
70 }
71 return true;
72}
void resize(const size_t size) override
std::vector< double > * mutable_points_timestamp()

◆ LoadPointCloud()

template<typename PointT >
void apollo::perception::lidar::LoadPointCloud ( const std::string &  filename,
typename pcl::PointCloud< PointT >::Ptr  point_cloud 
)

在文件 pointcloud_util.h 第 70 行定义.

71 {
72 typename pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>);
73 if (pcl::io::loadPCDFile<PointT>(filename, *point_cloud) == -1) {
74 throw std::runtime_error("Couldn't read file " + filename);
75 }
76 std::cout << "Loaded " << point_cloud->width * point_cloud->height
77 << " data points from " << filename << std::endl;
78}

◆ LocationDistance()

float apollo::perception::lidar::LocationDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  new_object,
const double  time_diff 
)

Compute location distance for given track & object

参数
last_objectobject for computing distance
track_predictpredicted state of track for computing distance
new_objectnew detected object for computing distance
time_difftime interval from last matching
返回
float distance

在文件 distance_collection.cc 第 43 行定义.

46 {
47 // Compute locatin distance for last object and new object
48 // range from 0 to positive infinity
49
50 Eigen::Vector3f measured_anchor_point =
51 (new_object->anchor_point).cast<float>();
52 Eigen::Vector3f predicted_anchor_point = track_predict.head(3);
53 Eigen::Vector3f measure_predict_diff =
54 measured_anchor_point - predicted_anchor_point;
55
56 float location_dist = static_cast<float>(sqrt(
57 (measure_predict_diff.head(2).cwiseProduct(measure_predict_diff.head(2)))
58 .sum()));
59
60 /* NEED TO NOTICE: All the states would be collected mainly based on
61 * states of tracked objects. Thus, update tracked object when you
62 * update the state of track !!!!! */
63 Eigen::Vector2d ref_dir = last_object->output_velocity.head(2);
64 double speed = ref_dir.norm();
65 ref_dir /= speed;
66
67 /* Let location distance generated from a normal distribution with
68 * symmetric variance. Modify its variance when speed greater than
69 * a threshold. Penalize variance other than motion direction. */
70 if (speed > 2) {
71 Eigen::Vector2d ref_o_dir = Eigen::Vector2d(ref_dir[1], -ref_dir[0]);
72 double dx = ref_dir(0) * measure_predict_diff(0) +
73 ref_dir(1) * measure_predict_diff(1);
74 double dy = ref_o_dir(0) * measure_predict_diff(0) +
75 ref_o_dir(1) * measure_predict_diff(1);
76 location_dist = static_cast<float>(sqrt(dx * dx * 0.5 + dy * dy * 2));
77 }
78
79 return location_dist;
80}

◆ MAKE_FILTER()

apollo::perception::lidar::MAKE_FILTER ( fgauss  ,
exp(-0.5 *square(i/sigma))   
)

◆ MeasureAnchorPointVelocity()

void apollo::perception::lidar::MeasureAnchorPointVelocity ( TrackedObjectPtr  new_object,
const TrackedObjectConstPtr &  old_object,
const double &  time_diff 
)

Measure anchor point velocity

参数
new_objectfor current updating
old_objectfor last updating
time_difftime interval from last updating

在文件 measurement_collection.cc 第 28 行定义.

30 {
31 // Compute 2D anchor point velocity measurement
32 Eigen::Vector3d measured_anchor_point_velocity =
33 new_object->anchor_point - old_object->belief_anchor_point;
34 measured_anchor_point_velocity /= time_diff;
35 measured_anchor_point_velocity(2) = 0.0;
36 new_object->measured_barycenter_velocity = measured_anchor_point_velocity;
37}

◆ MeasureBboxCenterHistoryVelocity()

void apollo::perception::lidar::MeasureBboxCenterHistoryVelocity ( const MlfTrackDataConstPtr &  track_data,
TrackedObjectPtr  new_object 
)

在文件 measurement_collection.cc 第 69 行定义.

70 {
71 const int history_size = 10;
72 auto history_objs = track_data->GetHistoryObjects();
73 if (history_objs.empty() || history_objs.size() == 1) {
74 new_object->measured_history_center_velocity = Eigen::Vector3d::Zero();
75 return;
76 }
77 if (history_objs.size() <= history_size) {
78 auto new_obj = history_objs.rbegin();
79 auto old_obj = history_objs.cbegin();
80 double time_diff = new_obj->first - old_obj->first;
81 if (time_diff < std::numeric_limits<double>::epsilon()) {
82 return;
83 }
84 if (new_obj->second == nullptr || old_obj->second == nullptr) {
85 return;
86 }
87 new_object->measured_history_center_velocity =
88 (new_obj->second->center - old_obj->second->center) / time_diff;
89 return;
90 }
91 auto new_obj = history_objs.rbegin();
92 auto old_obj = track_data->GetHistoryObject(1 - history_size);
93 double time_diff = new_obj->first - old_obj.first;
94 if (time_diff < std::numeric_limits<double>::epsilon()) {
95 return;
96 }
97 if (new_obj->second == nullptr || old_obj.second == nullptr) {
98 return;
99 }
100 new_object->measured_history_center_velocity =
101 (new_obj->second->center - old_obj.second->center) / time_diff;
102}

◆ MeasureBboxCenterVelocity()

void apollo::perception::lidar::MeasureBboxCenterVelocity ( TrackedObjectPtr  new_object,
const TrackedObjectConstPtr &  old_object,
const double &  time_diff 
)

Measure bbox center velocity

参数
new_objectfor current updating
old_objectfor last updating
time_difftime interval from last updating

在文件 measurement_collection.cc 第 39 行定义.

41 {
42 // Compute 2D bbox center velocity measurement
43 Eigen::Vector3f old_dir_tmp = old_object->output_direction.cast<float>();
44 // Eigen::Vector3d old_size = old_object->output_size;
45 Eigen::Vector3d old_center = old_object->output_center;
46 Eigen::Vector3f new_size_tmp;
47 Eigen::Vector3d new_center;
48 float minimum_edge_length = 0.01f;
49 base::PointDCloud& cloud =
50 (new_object->object_ptr->lidar_supplement).cloud_world;
51 algorithm::CalculateBBoxSizeCenter2DXY(cloud, old_dir_tmp, &new_size_tmp,
52 &new_center, minimum_edge_length);
53 // Eigen::Vector3d old_dir = old_dir_tmp.cast<double>();
54 // Eigen::Vector3d new_size = new_size_tmp.cast<double>();
55 Eigen::Vector3d measured_bbox_center_velocity_with_old_dir =
56 (new_center - old_center);
57 measured_bbox_center_velocity_with_old_dir /= time_diff;
58 measured_bbox_center_velocity_with_old_dir(2) = 0.0;
59 Eigen::Vector3d measured_bbox_center_velocity =
60 measured_bbox_center_velocity_with_old_dir;
61 Eigen::Vector3d project_dir =
62 new_object->anchor_point - old_object->belief_anchor_point;
63 if (measured_bbox_center_velocity.dot(project_dir) <= 0) {
64 measured_bbox_center_velocity = Eigen::Vector3d::Zero();
65 }
66 new_object->measured_center_velocity = measured_bbox_center_velocity;
67}

◆ MeasureBboxCornerHistoryVelocity()

void apollo::perception::lidar::MeasureBboxCornerHistoryVelocity ( const MlfTrackDataConstPtr &  track_data,
TrackedObjectPtr  new_object 
)

在文件 measurement_collection.cc 第 199 行定义.

200 {
201 const int history_size = 10;
202 auto history_objs = track_data->GetHistoryObjects();
203 if (history_objs.empty() || history_objs.size() == 1) {
204 for (size_t i = 0; i < 4; ++i) {
205 new_object->measured_history_corners_velocity[i] =
206 Eigen::Vector3d::Zero();
207 }
208 return;
209 }
210 if (history_objs.size() <= history_size) {
211 auto new_obj = history_objs.rbegin();
212 auto old_obj = history_objs.cbegin();
213 double time_diff = new_obj->first - old_obj->first;
214 if (time_diff < std::numeric_limits<double>::epsilon()) {
215 return;
216 }
217 if (new_obj->second == nullptr || old_obj->second == nullptr) {
218 return;
219 }
221 new_obj->second, old_obj->second, time_diff, new_object);
222 return;
223 }
224 auto new_obj = history_objs.rbegin();
225 auto old_obj = track_data->GetHistoryObject(1 - history_size);
226 double time_diff = new_obj->first - old_obj.first;
227 if (time_diff < std::numeric_limits<double>::epsilon()) {
228 return;
229 }
230 if (new_obj->second == nullptr || old_obj.second == nullptr) {
231 return;
232 }
234 new_obj->second, old_obj.second, time_diff, new_object);
235}
void ComputeBboxCornerHistoryVelocity(TrackedObjectPtr new_object, const TrackedObjectConstPtr &old_object, const double &time_diff, TrackedObjectPtr curr_object)

◆ MeasureBboxCornerVelocity()

void apollo::perception::lidar::MeasureBboxCornerVelocity ( TrackedObjectPtr  new_object,
const TrackedObjectConstPtr &  old_object,
const double &  time_diff 
)

Measure bbox corner velocity

参数
new_objectfor current updating
old_objectfor last updating
time_difftime interval from last updating

在文件 measurement_collection.cc 第 104 行定义.

106 {
107 // Compute 2D bbxo corner velocity measurement
108 Eigen::Vector3f old_dir_tmp = old_object->output_direction.cast<float>();
109 Eigen::Vector3d old_size = old_object->output_size;
110 Eigen::Vector3d old_center = old_object->output_center;
111 Eigen::Vector3f new_size_tmp;
112 Eigen::Vector3d new_center;
113 float minimum_edge_length = 0.01f;
114 base::PointDCloud& cloud =
115 (new_object->object_ptr->lidar_supplement).cloud_world;
116 algorithm::CalculateBBoxSizeCenter2DXY(cloud, old_dir_tmp, &new_size_tmp,
117 &new_center, minimum_edge_length);
118 Eigen::Vector3d old_dir = old_dir_tmp.cast<double>();
119 Eigen::Vector3d new_size = new_size_tmp.cast<double>();
120 Eigen::Vector3d ortho_old_dir(-old_dir(1), old_dir(0), 0.0);
121 Eigen::Vector3d old_bbox_corner_list[4];
122 Eigen::Vector3d new_bbox_corner_list[4];
123 Eigen::Vector3d old_bbox_corner = old_center + old_dir * old_size(0) * 0.5 +
124 ortho_old_dir * old_size(1) * 0.5;
125 Eigen::Vector3d new_bbox_corner = new_center + old_dir * new_size(0) * 0.5 +
126 ortho_old_dir * new_size(1) * 0.5;
127 old_bbox_corner_list[0] = old_bbox_corner;
128 new_bbox_corner_list[0] = new_bbox_corner;
129 old_bbox_corner = old_center - old_dir * old_size(0) * 0.5 +
130 ortho_old_dir * old_size(1) * 0.5;
131 new_bbox_corner = new_center - old_dir * new_size(0) * 0.5 +
132 ortho_old_dir * new_size(1) * 0.5;
133 old_bbox_corner_list[1] = old_bbox_corner;
134 new_bbox_corner_list[1] = new_bbox_corner;
135 old_bbox_corner = old_center + old_dir * old_size(0) * 0.5 -
136 ortho_old_dir * old_size(1) * 0.5;
137 new_bbox_corner = new_center + old_dir * new_size(0) * 0.5 -
138 ortho_old_dir * new_size(1) * 0.5;
139 old_bbox_corner_list[2] = old_bbox_corner;
140 new_bbox_corner_list[2] = new_bbox_corner;
141 old_bbox_corner = old_center - old_dir * old_size(0) * 0.5 -
142 ortho_old_dir * old_size(1) * 0.5;
143 new_bbox_corner = new_center - old_dir * new_size(0) * 0.5 -
144 ortho_old_dir * new_size(1) * 0.5;
145 old_bbox_corner_list[3] = old_bbox_corner;
146 new_bbox_corner_list[3] = new_bbox_corner;
147
148 // calculate the nearest corner
149 Eigen::Vector3d ref_location = new_object->sensor_to_local_pose.translation();
150 Eigen::Vector3d nearest_old_bbox_corner = old_bbox_corner_list[0];
151 Eigen::Vector3d nearest_new_bbox_corner = new_bbox_corner_list[0];
152 double min_center_distance = (ref_location - nearest_new_bbox_corner).norm();
153 for (size_t i = 1; i < 4; ++i) {
154 double center_distance = (ref_location - new_bbox_corner_list[i]).norm();
155 if (center_distance < min_center_distance) {
156 min_center_distance = center_distance;
157 nearest_old_bbox_corner = old_bbox_corner_list[i];
158 nearest_new_bbox_corner = new_bbox_corner_list[i];
159 }
160 }
161 // no projection
162 new_object->measured_nearest_corner_velocity =
163 (nearest_new_bbox_corner - nearest_old_bbox_corner) / time_diff;
164
165 // select project_dir by change of size
166 Eigen::Vector3d direct_old_size = old_object->size;
167 Eigen::Vector3d direct_new_size = new_object->size;
168 double length_change =
169 fabs(direct_old_size(0) - direct_new_size(0)) / direct_old_size(0);
170 double width_change =
171 fabs(direct_old_size(1) - direct_new_size(1)) / direct_old_size(1);
172
173 const double max_change_thresh = 0.1;
174 Eigen::Vector3d project_dir;
175 if (length_change < max_change_thresh && width_change < max_change_thresh) {
176 project_dir = new_object->center - old_object->center;
177 } else {
178 project_dir = new_object->anchor_point - old_object->belief_anchor_point;
179 }
180
181 for (size_t i = 0; i < 4; ++i) {
182 old_bbox_corner = old_bbox_corner_list[i];
183 new_bbox_corner = new_bbox_corner_list[i];
184 new_object->corners[i] = new_bbox_corner_list[i];
185 Eigen::Vector3d bbox_corner_velocity =
186 ((new_bbox_corner - old_bbox_corner) / time_diff);
187 Eigen::Vector3d bbox_corner_velocity_on_project_dir =
188 algorithm::Calculate2DXYProjectVector<double>(bbox_corner_velocity,
189 project_dir);
190 // set velocity as 0 when conflict
191 if (bbox_corner_velocity_on_project_dir.dot(project_dir) <= 0) {
192 bbox_corner_velocity_on_project_dir = Eigen::Vector3d::Zero();
193 }
194 new_object->measured_corners_velocity[i] =
195 bbox_corner_velocity_on_project_dir;
196 }
197}

◆ MeasureObjectDetectionHistoryVelocity()

void apollo::perception::lidar::MeasureObjectDetectionHistoryVelocity ( const MlfTrackDataConstPtr &  track_data,
TrackedObjectPtr  new_object 
)

在文件 measurement_collection.cc 第 322 行定义.

323 {
324 const int history_size = 10;
325 auto history_objs = track_data->GetHistoryObjects();
326 if (history_objs.empty() || history_objs.size() == 1) {
327 for (size_t i = 0; i < 4; i++) {
328 new_object->measured_detection_history_corners_velocity[i] =
329 Eigen::Vector3d::Zero();
330 }
331 new_object->measured_detection_history_center_velocity =
332 Eigen::Vector3d::Zero();
333 return;
334 }
335 if (history_objs.size() <= history_size) {
336 auto new_obj = history_objs.rbegin();
337 auto old_obj = history_objs.cbegin();
338 double time_diff = new_obj->first - old_obj->first;
339 if (time_diff < std::numeric_limits<double>::epsilon()) {
340 return;
341 }
342 if (new_obj->second == nullptr || old_obj->second == nullptr) {
343 return;
344 }
345 Eigen::Vector3d center_diff = new_obj->second->detection_center
346 - old_obj->second->detection_center;
347 new_object->measured_detection_history_center_velocity =
348 center_diff / time_diff;
349 for (size_t i = 0; i < 4; i++) {
350 Eigen::Vector3d corner_diff = new_obj->second->detection_corners[i]
351 - old_obj->second->detection_corners[i];
352 new_object->measured_detection_history_corners_velocity[i] =
353 corner_diff / time_diff;
354 }
355 return;
356 }
357 auto new_obj = history_objs.rbegin();
358 auto old_obj = track_data->GetHistoryObject(1 - history_size);
359 double time_diff = new_obj->first - old_obj.first;
360 if (time_diff < std::numeric_limits<double>::epsilon()) {
361 return;
362 }
363 if (new_obj->second == nullptr || old_obj.second == nullptr) {
364 return;
365 }
366 Eigen::Vector3d center_diff =
367 new_obj->second->detection_center - old_obj.second->detection_center;
368 new_object->measured_detection_history_center_velocity =
369 center_diff / time_diff;
370 for (size_t i = 0; i < 4; i++) {
371 Eigen::Vector3d cor_diff = new_obj->second->detection_corners[i]
372 - old_obj.second->detection_corners[i];
373 new_object->measured_detection_history_corners_velocity[i] =
374 cor_diff / time_diff;
375 }
376}

◆ MeasureObjectDetectionVelocity()

void apollo::perception::lidar::MeasureObjectDetectionVelocity ( TrackedObjectPtr  new_object,
const TrackedObjectConstPtr &  old_object,
const double &  time_diff 
)

Measure object-detection center and corner velocity

参数
new_objectfor current updating
old_objectfor last updating
time_difftime interval from last updating

在文件 measurement_collection.cc 第 313 行定义.

314 {
315 Eigen::Vector3d mea_single_model_velocity =
316 new_object->detection_center - old_object->detection_center;
317 mea_single_model_velocity /= time_diff;
318 mea_single_model_velocity(2) = 0.0;
319 new_object->measured_detection_center_velocity = mea_single_model_velocity;
320}

◆ min_max()

template<class T >
void apollo::perception::lidar::min_max ( Image< T > *  im,
T *  ret_min,
T *  ret_max 
)

Compute minimum and maximum value in an image

模板参数
T
参数
im
ret_min
ret_max

在文件 imutil.h 第 50 行定义.

50 {
51 int width = im->width();
52 int height = im->height();
53 T min = imRef(im, 0, 0);
54 T max = imRef(im, 0, 0);
55 for (int y = 0; y < height; y++) {
56 for (int x = 0; x < width; x++) {
57 T val = imRef(im, x, y);
58 if (min > val) {
59 min = val;
60 }
61 if (max < val) {
62 max = val;
63 }
64 }
65 }
66 *ret_min = min;
67 *ret_max = max;
68}

◆ normalize()

void apollo::perception::lidar::normalize ( std::vector< float > *  mask_input)

Normalize mask so it integrates to one

参数
mask_input

在文件 filter.h 第 51 行定义.

51 {
52 std::vector<float> &mask = *mask_input;
53 int len = mask.size();
54 float sum = 0;
55 for (int i = 1; i < len; i++) {
56 sum += fabs(mask[i]);
57 }
58 sum = 2 * sum + fabs(mask[0]);
59 for (int i = 0; i < len; i++) {
60 mask[i] /= sum;
61 }
62}

◆ operator<() [1/2]

bool apollo::perception::lidar::operator< ( const edge &  a,
const edge &  b 
)

在文件 segment_graph.h 第 53 行定义.

53 {
54 return a.w < b.w;
55}

◆ operator<() [2/2]

bool apollo::perception::lidar::operator< ( const MatchCost &  m1,
const MatchCost &  m2 
)

在文件 gnn_bipartite_graph_matcher.cc 第 37 行定义.

37 {
38 return m1.cost_ < m2.cost_;
39}

◆ operator<<()

std::ostream & apollo::perception::lidar::operator<< ( std::ostream &  os,
const MatchCost &  m 
)

在文件 gnn_bipartite_graph_matcher.cc 第 41 行定义.

41 {
42 os << "MatchCost ridx:" << m.RowIdx() << " cidx:" << m.ColIdx()
43 << " Cost:" << m.Cost();
44 return os;
45}

◆ operator==()

bool apollo::perception::lidar::operator== ( const rgb &  a,
const rgb &  b 
)
inline

Definition of equal sign

参数
a
b
返回
true
false

在文件 misc.h 第 52 行定义.

52 {
53 return ((a.r == b.r) && (a.g == b.g) && (a.b == b.b));
54}

◆ Pc2Pixel()

int apollo::perception::lidar::Pc2Pixel ( float  in_pc,
float  in_range,
float  out_size 
)
inline

在文件 util.h 第 47 行定义.

47 {
48 float inv_res = 0.5f * out_size / in_range;
49 return static_cast<int>(std::floor((in_range - in_pc) * inv_res));
50}

◆ PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER() [1/2]

apollo::perception::lidar::PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER ( GnnBipartiteGraphMatcher  )

◆ PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER() [2/2]

apollo::perception::lidar::PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER ( MultiHmBipartiteGraphMatcher  )

◆ PERCEPTION_REGISTER_CLASSIFIER()

apollo::perception::lidar::PERCEPTION_REGISTER_CLASSIFIER ( FusedClassifier  )

◆ PERCEPTION_REGISTER_CURB_DETECTOR()

apollo::perception::lidar::PERCEPTION_REGISTER_CURB_DETECTOR ( StraightPoleRecognizer  )

◆ PERCEPTION_REGISTER_GROUNDDETECTOR() [1/2]

apollo::perception::lidar::PERCEPTION_REGISTER_GROUNDDETECTOR ( GroundServiceDetector  )

◆ PERCEPTION_REGISTER_GROUNDDETECTOR() [2/2]

apollo::perception::lidar::PERCEPTION_REGISTER_GROUNDDETECTOR ( SpatioTemporalGroundDetector  )

◆ PERCEPTION_REGISTER_LIDARDETECTOR() [1/7]

apollo::perception::lidar::PERCEPTION_REGISTER_LIDARDETECTOR ( CenterPointDetection  )

◆ PERCEPTION_REGISTER_LIDARDETECTOR() [2/7]

apollo::perception::lidar::PERCEPTION_REGISTER_LIDARDETECTOR ( CNNSegmentation  )

◆ PERCEPTION_REGISTER_LIDARDETECTOR() [3/7]

apollo::perception::lidar::PERCEPTION_REGISTER_LIDARDETECTOR ( CPDetection  )

◆ PERCEPTION_REGISTER_LIDARDETECTOR() [4/7]

apollo::perception::lidar::PERCEPTION_REGISTER_LIDARDETECTOR ( GraphSegmentation  )

◆ PERCEPTION_REGISTER_LIDARDETECTOR() [5/7]

apollo::perception::lidar::PERCEPTION_REGISTER_LIDARDETECTOR ( MaskPillarsDetection  )

◆ PERCEPTION_REGISTER_LIDARDETECTOR() [6/7]

apollo::perception::lidar::PERCEPTION_REGISTER_LIDARDETECTOR ( NCutSegmentation  )

◆ PERCEPTION_REGISTER_LIDARDETECTOR() [7/7]

apollo::perception::lidar::PERCEPTION_REGISTER_LIDARDETECTOR ( PointPillarsDetection  )

◆ PERCEPTION_REGISTER_MLFFILTER() [1/4]

apollo::perception::lidar::PERCEPTION_REGISTER_MLFFILTER ( MlfDirectionFilter  )

◆ PERCEPTION_REGISTER_MLFFILTER() [2/4]

apollo::perception::lidar::PERCEPTION_REGISTER_MLFFILTER ( MlfMotionFilter  )

◆ PERCEPTION_REGISTER_MLFFILTER() [3/4]

apollo::perception::lidar::PERCEPTION_REGISTER_MLFFILTER ( MlfShapeFilter  )

◆ PERCEPTION_REGISTER_MLFFILTER() [4/4]

apollo::perception::lidar::PERCEPTION_REGISTER_MLFFILTER ( MlfTypeFilter  )

◆ PERCEPTION_REGISTER_MULTITARGET_TRACKER()

apollo::perception::lidar::PERCEPTION_REGISTER_MULTITARGET_TRACKER ( MlfEngine  )

◆ PERCEPTION_REGISTER_ONESHOTTYPEFUSION() [1/2]

apollo::perception::lidar::PERCEPTION_REGISTER_ONESHOTTYPEFUSION ( CCRFOneShotTypeFusion  )

◆ PERCEPTION_REGISTER_ONESHOTTYPEFUSION() [2/2]

apollo::perception::lidar::PERCEPTION_REGISTER_ONESHOTTYPEFUSION ( CCRFSingleShotTypeFusion  )

◆ PERCEPTION_REGISTER_POINTCLOUDPARSER() [1/2]

apollo::perception::lidar::PERCEPTION_REGISTER_POINTCLOUDPARSER ( MotionUnet  )

◆ PERCEPTION_REGISTER_POINTCLOUDPARSER() [2/2]

apollo::perception::lidar::PERCEPTION_REGISTER_POINTCLOUDPARSER ( PointWiseUnet  )

◆ PERCEPTION_REGISTER_POINTCLOUDPREPROCESSOR()

apollo::perception::lidar::PERCEPTION_REGISTER_POINTCLOUDPREPROCESSOR ( PointCloudPreprocessor  )

◆ PERCEPTION_REGISTER_REGISTERER() [1/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseBarrierRecognizer  )

◆ PERCEPTION_REGISTER_REGISTERER() [2/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseBipartiteGraphMatcher  )

◆ PERCEPTION_REGISTER_REGISTERER() [3/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseClassifier  )

◆ PERCEPTION_REGISTER_REGISTERER() [4/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseCPDetector  )

◆ PERCEPTION_REGISTER_REGISTERER() [5/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseGroundDetector  )

◆ PERCEPTION_REGISTER_REGISTERER() [6/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseLidarDetector  )

◆ PERCEPTION_REGISTER_REGISTERER() [7/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseMotionParser  )

◆ PERCEPTION_REGISTER_REGISTERER() [8/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseMultiShotTypeFusion  )

◆ PERCEPTION_REGISTER_REGISTERER() [9/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseMultiTargetTracker  )

◆ PERCEPTION_REGISTER_REGISTERER() [10/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseOneShotTypeFusion  )

◆ PERCEPTION_REGISTER_REGISTERER() [11/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BasePointCloudParser  )

◆ PERCEPTION_REGISTER_REGISTERER() [12/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BasePointCloudPreprocessor  )

◆ PERCEPTION_REGISTER_REGISTERER() [13/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseSequenceTypeFusion  )

◆ PERCEPTION_REGISTER_REGISTERER() [14/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( BaseSingleShotTypeFusion  )

◆ PERCEPTION_REGISTER_REGISTERER() [15/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( MlfBaseFilter  )

◆ PERCEPTION_REGISTER_REGISTERER() [16/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( SceneService  )

◆ PERCEPTION_REGISTER_REGISTERER() [17/17]

apollo::perception::lidar::PERCEPTION_REGISTER_REGISTERER ( SceneServiceContent  )

◆ PERCEPTION_REGISTER_SCENESERVICE() [1/2]

apollo::perception::lidar::PERCEPTION_REGISTER_SCENESERVICE ( GroundService  )

◆ PERCEPTION_REGISTER_SCENESERVICE() [2/2]

apollo::perception::lidar::PERCEPTION_REGISTER_SCENESERVICE ( ROIService  )

◆ PERCEPTION_REGISTER_SCENESERVICECONTENT() [1/2]

apollo::perception::lidar::PERCEPTION_REGISTER_SCENESERVICECONTENT ( GroundServiceContent  )

◆ PERCEPTION_REGISTER_SCENESERVICECONTENT() [2/2]

apollo::perception::lidar::PERCEPTION_REGISTER_SCENESERVICECONTENT ( ROIServiceContent  )

◆ PERCEPTION_REGISTER_SEQUENCETYPEFUSION() [1/2]

apollo::perception::lidar::PERCEPTION_REGISTER_SEQUENCETYPEFUSION ( CCRFMultiShotTypeFusion  )

◆ PERCEPTION_REGISTER_SEQUENCETYPEFUSION() [2/2]

apollo::perception::lidar::PERCEPTION_REGISTER_SEQUENCETYPEFUSION ( CCRFSequenceTypeFusion  )

◆ Pixel2Pc()

float apollo::perception::lidar::Pixel2Pc ( int  in_pixel,
float  in_size,
float  out_range 
)
inline

在文件 util.h 第 52 行定义.

52 {
53 float res = 2.0f * out_range / in_size;
54 return out_range - (static_cast<float>(in_pixel) + 0.5f) * res;
55}

◆ PointNumDistance()

float apollo::perception::lidar::PointNumDistance ( const TrackedObjectConstPtr &  last_object,
const Eigen::VectorXf &  track_predict,
const TrackedObjectConstPtr &  new_object,
const double  time_diff 
)

Compute point num distance for given track & object

参数
last_objectobject for computing distance
track_predictpredicted state of track for computing distance
new_objectnew detected object for computing distance
time_difftime interval from last matching
返回
float distance

在文件 distance_collection.cc 第 147 行定义.

150 {
151 // Compute point num distance for last object and new object
152 // range from 0 and 1
153
154 int old_point_number = static_cast<int>(
155 (last_object->object_ptr->lidar_supplement).cloud_world.size());
156 int new_point_number = static_cast<int>(
157 (new_object->object_ptr->lidar_supplement).cloud_world.size());
158
159 float point_num_dist =
160 static_cast<float>(fabs(old_point_number - new_point_number)) * 1.0f /
161 static_cast<float>(std::max(old_point_number, new_point_number));
162
163 return point_num_dist;
164}

◆ RemoveStaleDataFromMap()

void apollo::perception::lidar::RemoveStaleDataFromMap ( double  timestamp,
std::map< double, TrackedObjectPtr > *  data 
)

在文件 mlf_track_data.cc 第 186 行定义.

187 {
188 auto iter = data->begin();
189 while (iter != data->end()) {
190 if (iter->first < timestamp) {
191 data->erase(iter++);
192 } else {
193 break;
194 }
195 }
196}

◆ segment_graph()

Universe * apollo::perception::lidar::segment_graph ( int  num_vertices,
int  num_edges,
edge *  edges,
float  c 
)

Segment a graph

参数
num_verticesnumber of vertices in graph
num_edgesnumber of edges in graph
edgesarray of edges
cconstant for threshold function
返回
Universe* returns a disjoint-set forest representing the segmentation

在文件 segment_graph.h 第 66 行定义.

66 {
67 // sort edges by weight
68 std::sort(edges, edges + num_edges);
69
70 // make a disjoint-set forest
71 Universe *u = new Universe(num_vertices);
72
73 // init thresholds
74 float *threshold = new float[num_vertices];
75 for (int i = 0; i < num_vertices; i++) {
76 threshold[i] = THRESHOLD(1, c);
77 }
78
79 // for each edge, in non-decreasing weight order...
80 for (int i = 0; i < num_edges; i++) {
81 edge *pedge = &edges[i];
82
83 // components connected by this edge
84 int a = u->find(pedge->a);
85 int b = u->find(pedge->b);
86 if (a != b) {
87 if ((pedge->w <= threshold[a]) && (pedge->w <= threshold[b])) {
88 u->join(a, b);
89 a = u->find(a);
90 threshold[a] = pedge->w + THRESHOLD(u->size(a), c);
91 }
92 }
93 }
94
95 // free up
96 delete threshold;
97 return u;
98}
int find(int x)
Find parent of x
void join(int x, int y)
Join set x and set y
int size(int x) const
Get size of set x
Image< uchar > * threshold(Image< T > *src, int t)
Threshold image
Definition imutil.h:79
#define THRESHOLD(size, c)

◆ segment_image()

Image< int > * apollo::perception::lidar::segment_image ( Image< float > *  im,
float  sigma,
float  c,
int  min_size,
int *  num_ccs 
)

Segment an image

参数
imimage to segment
sigmato smooth the image
cconstant for threshold function
min_sizeminimum component size (enforced by post-processing stage)
num_ccsnumber of connected components in the segmentation
返回
Image<int>* returns a color image representing the segmentation

在文件 segment_image.h 第 69 行定义.

69 {
70 int width = im->width();
71 int height = im->height();
72 // smooth each color channel
73 Image<float> *smooth_r = smooth(im, sigma);
74 // build graph
75 edge *edges = new edge[width * height * 4];
76 int num = 0;
77 for (int y = 0; y < height; y++) {
78 for (int x = 0; x < width; x++) {
79 if (x < width - 1) {
80 edges[num].a = y * width + x;
81 edges[num].b = y * width + (x + 1);
82 edges[num].w = diff(smooth_r, x, y, x + 1, y);
83 num++;
84 }
85 if (y < height - 1) {
86 edges[num].a = y * width + x;
87 edges[num].b = (y + 1) * width + x;
88 edges[num].w = diff(smooth_r, x, y, x, y + 1);
89 num++;
90 }
91 if ((x < width - 1) && (y < height - 1)) {
92 edges[num].a = y * width + x;
93 edges[num].b = (y + 1) * width + (x + 1);
94 edges[num].w = diff(smooth_r, x, y, x + 1, y + 1);
95 num++;
96 }
97 if ((x < width - 1) && (y > 0)) {
98 edges[num].a = y * width + x;
99 edges[num].b = (y - 1) * width + (x + 1);
100 edges[num].w = diff(smooth_r, x, y, x + 1, y - 1);
101 num++;
102 }
103 }
104 }
105 delete smooth_r;
106 // segment
107 Universe *u = segment_graph(width * height, num, edges, c);
108 // post process small components
109 for (int i = 0; i < num; i++) {
110 int a = u->find(edges[i].a);
111 int b = u->find(edges[i].b);
112 if ((a != b) && ((u->size(a) < min_size) || (u->size(b) < min_size)))
113 u->join(a, b);
114 }
115 delete[] edges;
116 *num_ccs = u->num_sets();
117 Image<int> *output = new Image<int>(width, height);
118 for (int y = 0; y < height; y++) {
119 for (int x = 0; x < width; x++) {
120 int comp = u->find(y * width + x);
121 imRef(output, x, y) = comp;
122 }
123 }
124 delete u;
125 return output;
126}
uint32_t height
Height of point cloud
uint32_t width
Width of point cloud
Universe * segment_graph(int num_vertices, int num_edges, edge *edges, float c)
Segment a graph
Image< float > * smooth(Image< float > *src, float sigma)
Convolve image with gaussian filter
Definition filter.h:86
float diff(Image< float > *I, int x1, int y1, int x2, int y2)
Dissimilarity measure between pixels

◆ SetMotionLabel()

void apollo::perception::lidar::SetMotionLabel ( PointMotionLabel  label,
uint8_t *  value 
)
inline

在文件 lidar_point_label.h 第 65 行定义.

65 {
66 *value &= 15; // 15: 00001111
67 *value = (static_cast<uint8_t>(label) << 4) | (*value);
68}

◆ SetSemanticLabel()

void apollo::perception::lidar::SetSemanticLabel ( PointSemanticLabel  label,
uint8_t *  value 
)
inline

在文件 lidar_point_label.h 第 51 行定义.

51 {
52 *value &= 240; // 240: 11110000
53 *value |= static_cast<uint8_t>(label);
54}

◆ sign()

template<class T >
int apollo::perception::lidar::sign ( const T &  x)
inline

Get sign of value x

模板参数
T
参数
x
返回
int

在文件 misc.h 第 74 行定义.

74 {
75 return (x >= 0 ? 1 : -1);
76}

◆ smooth() [1/2]

Image< float > * apollo::perception::lidar::smooth ( Image< float > *  src,
float  sigma 
)

Convolve image with gaussian filter

参数
src
sigma
返回
Image<float>*

在文件 filter.h 第 86 行定义.

86 {
87 std::vector<float> mask = make_fgauss(sigma);
88 normalize(mask);
89 Image<float> *tmp = new Image<float>(src->height(), src->width(), false);
90 Image<float> *dst = new Image<float>(src->width(), src->height(), false);
91 convolve_even(src, tmp, mask);
92 convolve_even(tmp, dst, mask);
93 delete tmp;
94 return dst;
95}
void convolve_even(Image< float > *src, Image< float > *dst, const std::vector< float > &mask)
convolve src with mask.
Definition convolve.h:49
void normalize(std::vector< float > *mask_input)
Normalize mask so it integrates to one
Definition filter.h:51

◆ smooth() [2/2]

Image< float > * apollo::perception::lidar::smooth ( Image< uchar > *  src,
float  sigma 
)

Convolve image with gaussian filter

参数
src
sigma
返回
Image<float>*

在文件 filter.h 第 103 行定义.

103 {
105 Image<float> *dst = smooth(tmp, sigma);
106 delete tmp;
107 return dst;
108}
Image< float > * image_uchar2float(Image< uchar > *input)
Transform uchar to float
Definition imconv.h:89

◆ SplitObject()

void apollo::perception::lidar::SplitObject ( const base::ObjectPtr &  obj,
std::vector< base::ObjectPtr > *  split_objs,
float  split_distance 
)

split object

参数
obj
split_objs

在文件 object_split.cc 第 23 行定义.

23 {
24 split_objs->clear();
25 const auto max_edge = std::max(obj->size(0), obj->size(1));
26 if (max_edge < split_distance) {
27 split_objs->push_back(obj);
28 return;
29 }
30 const auto& cloud = obj->lidar_supplement.cloud;
31 const auto& cloud_world = obj->lidar_supplement.cloud_world;
32 const auto& point_ids = obj->lidar_supplement.point_ids;
33 Eigen::Vector3f params;
34 if (!LineFit2D(obj->lidar_supplement.cloud, &params)) {
35 split_objs->push_back(obj);
36 return;
37 }
38
39 Eigen::Vector2f offset(cloud.at(0).x, cloud.at(0).y);
40 Eigen::Vector2f min_xy(std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
41 Eigen::Vector2f max_xy(-std::numeric_limits<float>::max(), -std::numeric_limits<float>::max());
42 Eigen::Vector2f odirection = params.head(2);
43 Eigen::Vector2f direction(odirection(1), -odirection(0));
44 std::vector<Eigen::Vector2f> transfrom_cloud;
45 transfrom_cloud.resize(cloud.size());
46 for (size_t i = 0; i < cloud.size(); ++i) {
47 const auto& pt = cloud.at(i);
48 auto& vec_pt = transfrom_cloud.at(i);
49 Eigen::Vector2f vec(pt.x, pt.y);
50 vec -= offset;
51 vec_pt(0) = direction.dot(vec);
52 vec_pt(1) = odirection.dot(vec);
53 min_xy(0) = std::min(min_xy(0), vec_pt(0));
54 min_xy(1) = std::min(min_xy(1), vec_pt(1));
55 max_xy(0) = std::max(max_xy(0), vec_pt(0));
56 max_xy(1) = std::max(max_xy(1), vec_pt(1));
57 }
58
59 const auto size = max_xy - min_xy;
60 size_t segments = size(0) / split_distance + 1;
61 base::ObjectPool::Instance().BatchGet(segments, split_objs);
62 base::Object tmp_obj = *obj;
63 tmp_obj.polygon.clear();
64 tmp_obj.lidar_supplement.cloud.clear();
65 tmp_obj.lidar_supplement.cloud_world.clear();
66 tmp_obj.lidar_supplement.point_ids.clear();
67 tmp_obj.confidence = obj->confidence;
68 for (auto& obj : *split_objs) {
69 *obj = tmp_obj;
70 }
71
72 for (size_t i = 0; i < transfrom_cloud.size(); ++i) {
73 auto& vec_pt = transfrom_cloud.at(i);
74 const int section = (vec_pt(0) - min_xy(0)) / split_distance;
75 auto& obj = split_objs->at(section);
76 obj->lidar_supplement.cloud.push_back(cloud.at(i));
77 obj->lidar_supplement.cloud_world.push_back(cloud_world.at(i));
78 obj->lidar_supplement.point_ids.push_back(point_ids.at(i));
79 }
80
81 size_t valid = 0;
82 for (auto& obj : *split_objs) {
83 if (obj->lidar_supplement.cloud.size() > 3) {
84 obj->lidar_supplement.num_points_in_roi = obj->lidar_supplement.point_ids.size();
85 split_objs->at(valid++) = obj;
86 }
87 }
88 split_objs->resize(valid);
89}

◆ square()

template<class T >
T apollo::perception::lidar::square ( const T &  x)
inline

get square of value x

模板参数
T
参数
x
返回
T

在文件 misc.h 第 85 行定义.

85 {
86 return x * x;
87}

◆ threshold()

template<class T >
Image< uchar > * apollo::perception::lidar::threshold ( Image< T > *  src,
int  t 
)

Threshold image

模板参数
T
参数
src
t
返回
Image<uchar>*

在文件 imutil.h 第 79 行定义.

79 {
80 int width = src->width();
81 int height = src->height();
82 Image<uchar> *dst = new Image<uchar>(width, height);
83 for (int y = 0; y < height; y++) {
84 for (int x = 0; x < width; x++) {
85 imRef(dst, x, y) = (imRef(src, x, y) >= t);
86 }
87 }
88 return dst;
89}

◆ TransformFromPCLXYZI()

void apollo::perception::lidar::TransformFromPCLXYZI ( const pcl::PointCloud< pcl::PointXYZI >::Ptr &  org_cloud_ptr,
const base::PointFCloudPtr &  out_cloud_ptr 
)
inline

在文件 pcl_util.h 第 114 行定义.

116 {
117 for (size_t i = 0; i < org_cloud_ptr->size(); ++i) {
118 const auto& pt = org_cloud_ptr->at(i);
119 base::PointF point;
120 point.x = pt.x;
121 point.y = pt.y;
122 point.z = pt.z;
123 point.intensity = pt.intensity;
124 out_cloud_ptr->push_back(point);
125 }
126}

◆ TransformToPCLXYZI()

template<typename PointT >
void apollo::perception::lidar::TransformToPCLXYZI ( const base::AttributePointCloud< PointT > &  org_cloud,
const pcl::PointCloud< pcl::PointXYZI >::Ptr &  out_cloud_ptr 
)
inline

在文件 pcl_util.h 第 100 行定义.

102 {
103 for (size_t i = 0; i < org_cloud.size(); ++i) {
104 PointT pt = org_cloud.at(i);
105 pcl::PointXYZI point;
106 point.x = static_cast<float>(pt.x);
107 point.y = static_cast<float>(pt.y);
108 point.z = static_cast<float>(pt.z);
109 point.intensity = static_cast<float>(pt.intensity);
110 out_cloud_ptr->push_back(point);
111 }
112}

◆ vlib_round() [1/2]

int apollo::perception::lidar::vlib_round ( double  x)
inline

Get round value of x

参数
x
返回
int

在文件 misc.h 第 130 行定义.

130 {
131 return static_cast<int>(x + 0.5);
132}

◆ vlib_round() [2/2]

int apollo::perception::lidar::vlib_round ( float  x)
inline

Get round value of x

参数
x
返回
int

在文件 misc.h 第 121 行定义.

121 {
122 return static_cast<int>(x + 0.5F);
123}

◆ WritePcdByLabel()

bool apollo::perception::lidar::WritePcdByLabel ( const std::string &  file_path,
const base::PointFCloud &  cloud,
const LidarPointLabel &  label 
)
inline

在文件 pcl_util.h 第 74 行定义.

76 {
77 pcl::PointCloud<PCLPointXYZIT> pcl_cloud;
78 for (size_t i = 0; i < cloud.size(); ++i) {
79 if (cloud.points_label().at(i) != static_cast<uint8_t>(label))
80 continue;
81 PCLPointXYZIT point;
82 point.x = cloud[i].x;
83 point.y = cloud[i].y;
84 point.z = cloud[i].z;
85 point.intensity = cloud[i].intensity;
86 point.timestamp = cloud.points_timestamp().at(i);
87 pcl_cloud.push_back(point);
88 }
89 try {
90 pcl::PCDWriter writer;
91 writer.writeBinaryCompressed(file_path, pcl_cloud);
92 } catch (const pcl::IOException& ex) {
93 AERROR << ex.detailedMessage();
94 return false;
95 }
96 return true;
97}
const std::vector< double > & points_timestamp() const
const std::vector< uint8_t > & points_label() const

变量说明

◆ BLUE_WEIGHT

const double apollo::perception::lidar::BLUE_WEIGHT = 0.114

在文件 imconv.h 第 45 行定义.

◆ EIGEN_ALIGN16

struct apollo::perception::lidar::PointCloudPreprocessorOptions apollo::perception::lidar::EIGEN_ALIGN16

◆ GREEN_WEIGHT

const double apollo::perception::lidar::GREEN_WEIGHT = 0.587

在文件 imconv.h 第 44 行定义.

◆ kBarrierId2Type

const std::string apollo::perception::lidar::kBarrierId2Type[]
初始值:
= {
"UNKOWN", "ROD", "FENCE", "ADVERTISING", "TELESCOPIC", "OTHER"
}

在文件 barrier_recognition_component.cc 第 28 行定义.

28 {
29 "UNKOWN", "ROD", "FENCE", "ADVERTISING", "TELESCOPIC", "OTHER"
30};

◆ kPI

const double apollo::perception::lidar::kPI = 3.1415926535897932384626433832795

在文件 util.h 第 31 行定义.

◆ MAX_X_RANGE

const float apollo::perception::lidar::MAX_X_RANGE = 51.2

在文件 cpdet.cc 第 46 行定义.

◆ MAX_Y_RANGE

const float apollo::perception::lidar::MAX_Y_RANGE = 51.2

在文件 cpdet.cc 第 48 行定义.

◆ MAX_Z_RANGE

const float apollo::perception::lidar::MAX_Z_RANGE = 3.5

在文件 cpdet.cc 第 50 行定义.

◆ MIN_X_RANGE

const float apollo::perception::lidar::MIN_X_RANGE = -51.2

在文件 cpdet.cc 第 45 行定义.

◆ MIN_Y_RANGE

const float apollo::perception::lidar::MIN_Y_RANGE = -51.2

在文件 cpdet.cc 第 47 行定义.

◆ MIN_Z_RANGE

const float apollo::perception::lidar::MIN_Z_RANGE = -3.5

在文件 cpdet.cc 第 49 行定义.

◆ RED_WEIGHT

const double apollo::perception::lidar::RED_WEIGHT = 0.299

在文件 imconv.h 第 43 行定义.

◆ STATIC_VELOCITY

const float apollo::perception::lidar::STATIC_VELOCITY = 0.01

在文件 mlf_motion_measurement.cc 第 31 行定义.

◆ WIDTH

const double apollo::perception::lidar::WIDTH = 4.0

在文件 filter.h 第 45 行定义.