26namespace 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;
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;
173 unsigned int col)
const {
174 DCHECK_LT(row,
rows_);
175 DCHECK_LT(col,
cols_);
180 DCHECK_LT(row,
rows_);
181 DCHECK_LT(col,
cols_);
The options of the reflectance map.
The data structure of the map cells in a map node.
virtual unsigned int CreateBinary(unsigned char *buf, unsigned int buf_size) const
Create the binary.
const LosslessMapCell & GetMapCell(unsigned int row, unsigned int col) const
Get a map cell.
virtual void Reset(const BaseMapConfig *config)
Reset map cells data.
virtual unsigned int GetBinarySize() const
Get the binary size of the object.
LosslessMapCell & GetMapCell(unsigned int row, unsigned int col)
Get a map cell.
LosslessMapCell * operator[](int row)
const LosslessMapCell * operator[](int row) const
unsigned int cols_
The number of columns.
virtual void Init(const BaseMapConfig *config)
Initialize the map matrix.
virtual unsigned int LoadBinary(unsigned char *buf)
Load the map cell from a binary chunk.
unsigned int rows_
The number of rows.
virtual void GetIntensityImg(cv::Mat *intensity_img) const
get intensity image of node.
LosslessMapCell * map_cells_
The matrix data structure.
#define IDL_CAR_NUM_RESERVED_MAP_LAYER
The first layer (layer 0) includes all the intensities from any layers.
The multiple layers of the cell.
float GetAlt() const
Get the average altitude of the map cell.
float GetVar() const
Get the variance of the intensity of the map cell.
unsigned int GetCount() const
Get the count of the samples in the map cell.
LosslessMapCell()
The default constructor.
LosslessMapSingleCell & GetLayer(unsigned int layer_id)
Get a particular layer in the map cell.
LosslessMapSingleCell map_cells[IDL_CAR_NUM_RESERVED_MAP_LAYER]
The multiple layers of the cell.
unsigned char GetValue() const
Get the average intensity of the map cell.
void Reset()
Reset to default value.
const LosslessMapSingleCell & GetLayer(unsigned int layer_id) const
Get a perticular layer in the map cell.
unsigned int GetBinarySize() const
Get the binary size of the object.
unsigned int CreateBinary(unsigned char *buf, unsigned int buf_size) const
Create the binary.
void SetValueLayer(double altitude, unsigned char intensity, double altitude_thres=10.0)
Set the value of a layer that layer_id > 0.
unsigned int layer_num
The layers of the cell.
float GetAltVar() const
Get the variance of the altitude of the map cell.
unsigned int GetLayerId(double altitude) const
Match a layer in the map cell given an altitude.
unsigned int LoadBinary(unsigned char *buf)
Load the map cell from a binary chunk.
void SetValue(double altitude, unsigned char intensity)
Set the value.
float altitude_var
The variance altitude value of the cell.
float altitude
The average altitude of the cell.
unsigned int count
The number of samples in the cell.
void Reset()
Reset to default value.
unsigned int LoadBinary(unsigned char *buf)
Load the map cell from a binary chunk.
void AddSample(const float new_altitude, const float new_intensity)
Add a sample.
float intensity_var
The variance intensity value.
float intensity
The average intensity value.
LosslessMapSingleCell()
The default constructor.
unsigned int GetBinarySize() const
Get the binary size of the object.
LosslessMapSingleCell & operator=(const LosslessMapSingleCell &ref)
Overloading the assign operator.
unsigned int CreateBinary(unsigned char *buf, unsigned int buf_size) const
Create the binary.