Apollo 10.0
自动驾驶开放平台
apollo::localization::msf::pyramid_map::LossyMapMatrixHandler类 参考

#include <pyramid_map_matrix_handler.h>

类 apollo::localization::msf::pyramid_map::LossyMapMatrixHandler 继承关系图:
apollo::localization::msf::pyramid_map::LossyMapMatrixHandler 的协作图:

Public 成员函数

 LossyMapMatrixHandler ()
 
virtual ~LossyMapMatrixHandler ()
 
- Public 成员函数 继承自 apollo::localization::msf::pyramid_map::BaseMapMatrixHandler
 BaseMapMatrixHandler ()
 
virtual ~BaseMapMatrixHandler ()
 
virtual size_t LoadBinary (const unsigned char *buf, std::shared_ptr< BaseMapMatrix > matrix)=0
 Load the map cell from a binary chunk.
 
virtual size_t CreateBinary (const std::shared_ptr< BaseMapMatrix > matrix, unsigned char *buf, size_t buf_size)=0
 Create the binary.
 
virtual size_t GetBinarySize (const std::shared_ptr< BaseMapMatrix > matrix)=0
 Get the binary size of the object.
 

Protected 成员函数

virtual unsigned char EncodeIntensity (float intensity) const
 
virtual void DecodeIntensity (unsigned char data, float *intensity) const
 
virtual uint16_t EncodeIntensityVar (float var) const
 
virtual void DecodeIntensityVar (uint16_t data, float *var) const
 
virtual uint16_t EncodeAltitude (float altitude, float min_altitude, float altitude_interval) const
 
virtual void DecodeAltitude (uint16_t data, float min_altitude, float altitude_interval, float *altitude) const
 
virtual unsigned char EncodeCount (unsigned int count, unsigned int count_range) const
 
virtual void DecodeCount (unsigned char data, unsigned int *count) const
 

Protected 属性

const unsigned int var_range_ = 1023
 
const unsigned int var_ratio_ = 4
 
const unsigned int count_range_ = 2
 
const float ground_alt_interval_ = 0.04f
 
const float alt_avg_interval_ = 0.04f
 
float alt_avg_min_ = 0.0f
 
float ground_alt_min_ = 0.0f
 
float alt_avg_max_ = 0.0f
 
float ground_alt_max_ = 0.0f
 

详细描述

在文件 pyramid_map_matrix_handler.h36 行定义.

构造及析构函数说明

◆ LossyMapMatrixHandler()

apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::LossyMapMatrixHandler ( )

在文件 pyramid_map_matrix_handler.cc51 行定义.

51{}

◆ ~LossyMapMatrixHandler()

apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::~LossyMapMatrixHandler ( )
virtual

在文件 pyramid_map_matrix_handler.cc53 行定义.

53{}

成员函数说明

◆ DecodeAltitude()

void apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::DecodeAltitude ( uint16_t  data,
float  min_altitude,
float  altitude_interval,
float *  altitude 
) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc109 行定义.

111 {
112 *altitude = min_altitude + data * altitude_interval;
113}

◆ DecodeCount()

void apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::DecodeCount ( unsigned char  data,
unsigned int *  count 
) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc128 行定义.

129 {
130 if (data == 0) {
131 *count = data;
132 } else {
133 *count = 1 << (data - 1);
134 }
135}

◆ DecodeIntensity()

void apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::DecodeIntensity ( unsigned char  data,
float *  intensity 
) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc67 行定义.

68 {
69 *intensity = static_cast<float>(data);
70}

◆ DecodeIntensityVar()

void apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::DecodeIntensityVar ( uint16_t  data,
float *  var 
) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc86 行定义.

87 {
88 *var = static_cast<float>(data);
89 *var = (static_cast<float>(var_range_) / (*var) - 1.0f) /
90 static_cast<float>(var_ratio_);
91 *var = (*var) * (*var);
92}

◆ EncodeAltitude()

uint16_t apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::EncodeAltitude ( float  altitude,
float  min_altitude,
float  altitude_interval 
) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc94 行定义.

96 {
97 float delta_alt = altitude - min_altitude;
98 delta_alt /= altitude_interval;
99 int encoded_altitude = static_cast<int>(delta_alt + 0.5f);
100 if (encoded_altitude > 0xffff) {
101 encoded_altitude = 0xffff;
102 }
103 if (encoded_altitude < 0) {
104 encoded_altitude = 0;
105 }
106 return static_cast<uint16_t>(encoded_altitude);
107}

◆ EncodeCount()

unsigned char apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::EncodeCount ( unsigned int  count,
unsigned int  count_range 
) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc115 行定义.

116 {
117 unsigned int encoded_count = 0;
118 while (count > 0) {
119 ++encoded_count;
120 count /= 2;
121 }
122 if (encoded_count > count_range) {
123 encoded_count = count_range;
124 }
125 return static_cast<unsigned char>(encoded_count);
126}

◆ EncodeIntensity()

unsigned char apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::EncodeIntensity ( float  intensity) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc55 行定义.

55 {
56 unsigned char encoded_intensity = 0;
57 if (intensity > 255) {
58 encoded_intensity = 255;
59 } else if (intensity < 0) {
60 encoded_intensity = 0;
61 } else {
62 encoded_intensity = static_cast<unsigned char>(intensity);
63 }
64 return encoded_intensity;
65}

◆ EncodeIntensityVar()

uint16_t apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::EncodeIntensityVar ( float  var) const
protectedvirtual

在文件 pyramid_map_matrix_handler.cc72 行定义.

72 {
73 var = std::sqrt(var);
74 unsigned int encoded_var =
75 static_cast<unsigned int>(static_cast<float>(var_range_) /
76 (var * static_cast<float>(var_ratio_) + 1.0));
77 if (encoded_var > var_range_) {
78 encoded_var = var_range_;
79 }
80 if (encoded_var < 1) {
81 encoded_var = 1;
82 }
83 return static_cast<uint16_t>(encoded_var);
84}

类成员变量说明

◆ alt_avg_interval_

const float apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::alt_avg_interval_ = 0.04f
protected

在文件 pyramid_map_matrix_handler.h57 行定义.

◆ alt_avg_max_

float apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::alt_avg_max_ = 0.0f
mutableprotected

在文件 pyramid_map_matrix_handler.h60 行定义.

◆ alt_avg_min_

float apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::alt_avg_min_ = 0.0f
mutableprotected

在文件 pyramid_map_matrix_handler.h58 行定义.

◆ count_range_

const unsigned int apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::count_range_ = 2
protected

在文件 pyramid_map_matrix_handler.h55 行定义.

◆ ground_alt_interval_

const float apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::ground_alt_interval_ = 0.04f
protected

在文件 pyramid_map_matrix_handler.h56 行定义.

◆ ground_alt_max_

float apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::ground_alt_max_ = 0.0f
mutableprotected

在文件 pyramid_map_matrix_handler.h61 行定义.

◆ ground_alt_min_

float apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::ground_alt_min_ = 0.0f
mutableprotected

在文件 pyramid_map_matrix_handler.h59 行定义.

◆ var_range_

const unsigned int apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::var_range_ = 1023
protected

在文件 pyramid_map_matrix_handler.h53 行定义.

◆ var_ratio_

const unsigned int apollo::localization::msf::pyramid_map::LossyMapMatrixHandler::var_ratio_ = 4
protected

在文件 pyramid_map_matrix_handler.h54 行定义.


该类的文档由以下文件生成: