Apollo 10.0
自动驾驶开放平台
apollo::localization::msf::LosslessMapSingleCell结构体 参考

#include <lossless_map_matrix.h>

apollo::localization::msf::LosslessMapSingleCell 的协作图:

Public 成员函数

 LosslessMapSingleCell ()
 The default constructor.
 
void Reset ()
 Reset to default value.
 
void AddSample (const float new_altitude, const float new_intensity)
 Add a sample.
 
LosslessMapSingleCelloperator= (const LosslessMapSingleCell &ref)
 Overloading the assign operator.
 
unsigned int LoadBinary (unsigned char *buf)
 Load the map cell from a binary chunk.
 
unsigned int CreateBinary (unsigned char *buf, unsigned int buf_size) const
 Create the binary.
 
unsigned int GetBinarySize () const
 Get the binary size of the object.
 

Public 属性

float intensity
 The average intensity value.
 
float intensity_var
 The variance intensity value.
 
float altitude
 The average altitude of the cell.
 
float altitude_var
 The variance altitude value of the cell.
 
unsigned int count
 The number of samples in the cell.
 

详细描述

在文件 lossless_map_matrix.h33 行定义.

构造及析构函数说明

◆ LosslessMapSingleCell()

apollo::localization::msf::LosslessMapSingleCell::LosslessMapSingleCell ( )

The default constructor.

在文件 lossless_map_matrix.cc24 行定义.

25 : intensity(0.0),
26 intensity_var(0.0),
27 altitude(0.0),
28 altitude_var(0.0),
29 count(0) {}
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.
float intensity_var
The variance intensity value.

成员函数说明

◆ AddSample()

void apollo::localization::msf::LosslessMapSingleCell::AddSample ( const float  new_altitude,
const float  new_intensity 
)

Add a sample.

在文件 lossless_map_matrix.cc47 行定义.

48 {
49 ++count;
50 float fcount = static_cast<float>(count);
51 float v1 = new_intensity - intensity;
52 float value = v1 / fcount;
53 intensity += value;
54 float v2 = new_intensity - intensity;
55 intensity_var = (fcount - 1.0f) * intensity_var + v1 * v2 / fcount;
56
57 v1 = new_altitude - altitude;
58 value = v1 / fcount;
59 altitude += value;
60 v2 = new_altitude - altitude;
61 altitude_var = ((fcount - 1) * altitude_var + v1 * v2) / fcount;
62}

◆ CreateBinary()

unsigned int apollo::localization::msf::LosslessMapSingleCell::CreateBinary ( unsigned char *  buf,
unsigned int  buf_size 
) const

Create the binary.

Serialization of the object.

参数
<buf,buf_size>The buffer and its size.
<return>The required or the used size of is returned.

在文件 lossless_map_matrix.cc80 行定义.

81 {
82 unsigned int target_size = GetBinarySize();
83 if (buf_size >= target_size) {
84 float* p = reinterpret_cast<float*>(buf);
85 *p = intensity;
86 ++p;
87 *p = intensity_var;
88 ++p;
89 *p = altitude;
90 ++p;
91 *p = altitude_var;
92 ++p;
93 unsigned int* pp =
94 reinterpret_cast<unsigned int*>(reinterpret_cast<void*>(p));
95 *pp = count;
96 }
97 return target_size;
98}
unsigned int GetBinarySize() const
Get the binary size of the object.

◆ GetBinarySize()

unsigned int apollo::localization::msf::LosslessMapSingleCell::GetBinarySize ( ) const

Get the binary size of the object.

在文件 lossless_map_matrix.cc100 行定义.

100 {
101 return static_cast<unsigned int>(sizeof(float) * 4 + sizeof(unsigned int));
102}

◆ LoadBinary()

unsigned int apollo::localization::msf::LosslessMapSingleCell::LoadBinary ( unsigned char *  buf)

Load the map cell from a binary chunk.

参数
<return>The size read (the real size of object).

在文件 lossless_map_matrix.cc64 行定义.

64 {
65 float* p = reinterpret_cast<float*>(buf);
66 intensity = *p;
67 ++p;
68 intensity_var = *p;
69 ++p;
70 altitude = *p;
71 ++p;
72 altitude_var = *p;
73 ++p;
74 unsigned int* pp =
75 reinterpret_cast<unsigned int*>(reinterpret_cast<void*>(p));
76 count = *pp;
77 return GetBinarySize();
78}

◆ operator=()

LosslessMapSingleCell & apollo::localization::msf::LosslessMapSingleCell::operator= ( const LosslessMapSingleCell ref)

Overloading the assign operator.

在文件 lossless_map_matrix.cc38 行定义.

39 {
40 intensity = ref.intensity;
41 intensity_var = ref.intensity_var;
42 altitude = ref.altitude;
43 count = ref.count;
44 return *this;
45}

◆ Reset()

void apollo::localization::msf::LosslessMapSingleCell::Reset ( )
inline

Reset to default value.

在文件 lossless_map_matrix.cc31 行定义.

31 {
32 intensity = 0.0;
33 intensity_var = 0.0;
34 altitude = 0.0;
35 count = 0;
36}

类成员变量说明

◆ altitude

float apollo::localization::msf::LosslessMapSingleCell::altitude

The average altitude of the cell.

在文件 lossless_map_matrix.h59 行定义.

◆ altitude_var

float apollo::localization::msf::LosslessMapSingleCell::altitude_var

The variance altitude value of the cell.

在文件 lossless_map_matrix.h61 行定义.

◆ count

unsigned int apollo::localization::msf::LosslessMapSingleCell::count

The number of samples in the cell.

在文件 lossless_map_matrix.h63 行定义.

◆ intensity

float apollo::localization::msf::LosslessMapSingleCell::intensity

The average intensity value.

在文件 lossless_map_matrix.h55 行定义.

◆ intensity_var

float apollo::localization::msf::LosslessMapSingleCell::intensity_var

The variance intensity value.

在文件 lossless_map_matrix.h57 行定义.


该结构体的文档由以下文件生成: