21 #include <unordered_map> 24 #include "Eigen/Eigenvalues" 30 namespace localization {
32 namespace pyramid_map {
49 size_t CreateBinary(
unsigned char* buf,
size_t buf_size)
const;
59 void AddSample(
const float intensity,
const float altitude,
63 void MergeCell(
const float intensity,
const float intensity_var,
64 const unsigned int road_pt_count,
const unsigned int count,
72 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
104 int AddSample(
const float intensity,
const float altitude,
106 bool is_road =
false);
116 size_t CreateBinary(
unsigned char* buf,
size_t buf_size)
const;
121 static int CalAltitudeIndex(
const float resolution,
const float altitude);
124 static float CalAltitude(
const float resolution,
const int altitude_index);
131 std::unordered_map<int, NdtMapSingleCell>
cells_;
153 virtual void Reset();
156 void Init(
unsigned int rows,
unsigned int cols);
158 void Reset(
unsigned int rows,
unsigned int cols);
162 virtual size_t LoadBinary(
const unsigned char* buf);
167 virtual size_t CreateBinary(
unsigned char* buf,
size_t buf_size)
const;
171 virtual bool GetIntensityImg(cv::Mat* intensity_img)
const;
175 unsigned int col)
const {
178 return map3d_cells_[row * cols_ + col];
184 return map3d_cells_[row * cols_ + col];
187 unsigned int GetRows()
const {
return rows_; }
189 unsigned int GetCols()
const {
return cols_; }
200 std::unique_ptr<NdtMapCells[]> map3d_cells_;
unsigned char is_icov_available_
the inverse covariance available flag.
Definition: ndt_map_matrix.h:91
void Reset()
Reset to default value.
std::vector< int > road_cell_indices_
The indices of road surface.
Definition: ndt_map_matrix.h:137
float intensity_
The average intensity value.
Definition: ndt_map_matrix.h:76
int min_altitude_index_
The index of smallest altitude.
Definition: ndt_map_matrix.h:135
Eigen::Vector3f Vector3f
Definition: base_map_fwd.h:29
float intensity_var_
The variance intensity value.
Definition: ndt_map_matrix.h:78
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
The data structure of ndt Map cell.
Definition: ndt_map_matrix.h:97
apollo::localization::msf::pyramid_map::NdtMapMatrix NdtMapMatrix
Definition: lidar_locator_ndt.h:71
Eigen::Matrix3f centroid_average_cov_
the pose covariance of the cell.
Definition: ndt_map_matrix.h:87
Eigen::Matrix3f Matrix3f
Definition: base_map_fwd.h:27
const NdtMapCells & GetMapCell(unsigned int row, unsigned int col) const
Get a const map cell.
Definition: ndt_map_matrix.h:174
void MergeCell(const float intensity, const float intensity_var, const unsigned int road_pt_count, const unsigned int count, const Eigen::Vector3f ¢roid, const Eigen::Matrix3f ¢roid_cov)
Merge two cells.
The data structure of the map cells in a map node.
Definition: base_map_matrix.h:30
Eigen::Matrix3f centroid_icov_
the pose inverse covariance of the cell.
Definition: ndt_map_matrix.h:89
void AddSample(const float intensity, const float altitude, const Eigen::Vector3f ¢roid, bool is_road=false)
Add an sample to the single 3d map cell.
unsigned int road_pt_count_
The number of samples belonging to road surface.
Definition: ndt_map_matrix.h:80
unsigned int GetCols() const
Get the size of cols.
Definition: ndt_map_matrix.h:189
unsigned int GetRows() const
Get the size of row.
Definition: ndt_map_matrix.h:187
bool Init(const char *binary_name)
std::unordered_map< int, NdtMapSingleCell > cells_
The multiple altitudes of the cell.
Definition: ndt_map_matrix.h:131
static void Reduce(NdtMapSingleCell *cell, const NdtMapSingleCell &cell_new)
Combine two NdtMapSingleCell instances (Reduce).
size_t LoadBinary(const unsigned char *buf)
Load the map cell from a binary chunk.
unsigned int count_
The number of samples in the cell.
Definition: ndt_map_matrix.h:82
The options of the reflectance map.
Definition: base_map_config.h:42
void CentroidEigenSolver(const Eigen::Matrix3f ¢roid_cov)
NdtMapSingleCell()
The default constructor.
NdtMapSingleCell & operator=(const NdtMapSingleCell &ref)
Overloading the assign operator.
int max_altitude_index_
The index of biggest altitude.
Definition: ndt_map_matrix.h:133
const unsigned int minimum_points_threshold_
minimum number of points needed.
Definition: ndt_map_matrix.h:93
The data structure of a single ndt map cell.
Definition: ndt_map_matrix.h:35
The data structure of ndt Map matrix.
Definition: ndt_map_matrix.h:141
apollo::localization::msf::pyramid_map::NdtMapCells NdtMapCells
Definition: lidar_locator_ndt.h:69
Eigen::Vector3f centroid_
the centroid of the cell.
Definition: ndt_map_matrix.h:85
size_t GetBinarySize() const
Get the binary size of the object.
NdtMapCells & GetMapCell(unsigned int row, unsigned int col)
Get a map cell.
Definition: ndt_map_matrix.h:181
size_t CreateBinary(unsigned char *buf, size_t buf_size) const
Create the binary. Serialization of the object.