26 namespace localization {
31 #define IDL_CAR_NUM_RESERVED_MAP_LAYER 2U 39 void AddSample(
const float new_altitude,
const float new_intensity);
50 unsigned int CreateBinary(
unsigned char* buf,
unsigned int buf_size)
const;
75 double altitude_thres = 10.0);
80 void SetValue(
double altitude,
unsigned char intensity);
89 unsigned int CreateBinary(
unsigned char* buf,
unsigned int buf_size)
const;
96 unsigned int GetLayerId(
double altitude)
const;
101 void GetValue(std::vector<unsigned char>* values)
const;
103 void GetVar(std::vector<float>* vars)
const;
105 void GetAlt(std::vector<float>* alts)
const;
107 void GetAltVar(std::vector<float>* alt_vars)
const;
109 void GetCount(std::vector<unsigned int>* counts)
const;
112 return static_cast<unsigned char>(map_cells[0].intensity);
115 inline float GetVar()
const {
return map_cells[0].intensity_var; }
117 inline float GetAlt()
const {
return map_cells[0].altitude; }
119 inline float GetAltVar()
const {
return map_cells[0].altitude_var; }
121 inline unsigned int GetCount()
const {
return map_cells[0].count; }
125 DCHECK_LT(layer_id, layer_num);
126 return map_cells[layer_id];
131 DCHECK_LT(layer_id, layer_num);
132 return map_cells[layer_id];
153 void Init(
unsigned int rows,
unsigned int cols);
154 void Reset(
unsigned int rows,
unsigned int cols);
159 virtual unsigned int LoadBinary(
unsigned char* buf);
165 unsigned int buf_size)
const;
169 virtual void GetIntensityImg(cv::Mat* intensity_img)
const;
173 unsigned int col)
const {
174 DCHECK_LT(row, rows_);
175 DCHECK_LT(col, cols_);
176 return map_cells_[row * cols_ + col];
180 DCHECK_LT(row, rows_);
181 DCHECK_LT(col, cols_);
182 return map_cells_[row * cols_ + col];
186 return map_cells_ + row * cols_;
189 return map_cells_ + row * cols_;
unsigned int rows_
The number of rows.
Definition: lossless_map_matrix.h:194
unsigned int GetBinarySize() const
Get the binary size of the object.
float GetVar() const
Get the variance of the intensity of the map cell.
Definition: lossless_map_matrix.h:115
The options of the reflectance map.
Definition: base_map_config.h:32
Definition: lossless_map_matrix.h:33
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
unsigned int CreateBinary(unsigned char *buf, unsigned int buf_size) const
Create the binary. Serialization of the object.
float intensity
The average intensity value.
Definition: lossless_map_matrix.h:55
unsigned int layer_num
The layers of the cell.
Definition: lossless_map_matrix.h:136
The multiple layers of the cell.
Definition: lossless_map_matrix.h:67
const LosslessMapCell & GetMapCell(unsigned int row, unsigned int col) const
Get a map cell.
Definition: lossless_map_matrix.h:172
LosslessMapCell * map_cells_
The matrix data structure.
Definition: lossless_map_matrix.h:198
The data structure of the map cells in a map node.
Definition: base_map_matrix.h:28
Definition: lossless_map_matrix.h:143
unsigned int cols_
The number of columns.
Definition: lossless_map_matrix.h:196
float intensity_var
The variance intensity value.
Definition: lossless_map_matrix.h:57
LosslessMapSingleCell()
The default constructor.
unsigned int LoadBinary(unsigned char *buf)
Load the map cell from a binary chunk.
const LosslessMapSingleCell & GetLayer(unsigned int layer_id) const
Get a perticular layer in the map cell. The layer 0 is the layer includes all the samples...
Definition: lossless_map_matrix.h:130
unsigned int count
The number of samples in the cell.
Definition: lossless_map_matrix.h:63
LosslessMapSingleCell & operator=(const LosslessMapSingleCell &ref)
Overloading the assign operator.
unsigned int GetCount() const
Get the count of the samples in the map cell.
Definition: lossless_map_matrix.h:121
float GetAltVar() const
Get the variance of the altitude of the map cell.
Definition: lossless_map_matrix.h:119
float altitude_var
The variance altitude value of the cell.
Definition: lossless_map_matrix.h:61
#define IDL_CAR_NUM_RESERVED_MAP_LAYER
The first layer (layer 0) includes all the intensities from any layers. Other layers only include the...
Definition: lossless_map_matrix.h:31
bool Init(const char *binary_name)
LosslessMapCell & GetMapCell(unsigned int row, unsigned int col)
Get a map cell.
Definition: lossless_map_matrix.h:179
void Reset()
Reset to default value.
void AddSample(const float new_altitude, const float new_intensity)
Add a sample.
unsigned char GetValue() const
Get the average intensity of the map cell.
Definition: lossless_map_matrix.h:111
LosslessMapSingleCell & GetLayer(unsigned int layer_id)
Get a particular layer in the map cell. The layer 0 is the layer includes all the samples...
Definition: lossless_map_matrix.h:124
const LosslessMapCell * operator[](int row) const
Definition: lossless_map_matrix.h:188
float altitude
The average altitude of the cell.
Definition: lossless_map_matrix.h:59
float GetAlt() const
Get the average altitude of the map cell.
Definition: lossless_map_matrix.h:117
LosslessMapCell * operator[](int row)
Definition: lossless_map_matrix.h:185