Apollo 11.0
自动驾驶开放平台
lossless_map_node.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <vector>
20
23
24namespace apollo {
25namespace localization {
26namespace msf {
27
29 public:
32
37 void SetValue(const Eigen::Vector3d& coordinate, unsigned char intensity);
43 bool SetValueIfInBound(const Eigen::Vector3d& coordinate,
44 unsigned char intensity);
50 void SetValueLayer(const Eigen::Vector3d& coordinate,
51 unsigned char intensity);
54 void GetValue(const Eigen::Vector3d& coordinate,
55 std::vector<unsigned char>* values) const;
58 void GetVar(const Eigen::Vector3d& coordinate,
59 std::vector<float>* vars) const;
62 void GetAlt(const Eigen::Vector3d& coordinate,
63 std::vector<float>* alts) const;
66 void GetAltVar(const Eigen::Vector3d& coordinate,
67 std::vector<float>* alt_vars) const;
70 void GetCount(const Eigen::Vector3d& coordinate,
71 std::vector<unsigned int>* counts) const;
74 unsigned char GetValue(const Eigen::Vector3d& coordinate) const;
77 float GetVar(const Eigen::Vector3d& coordinate) const;
80 float GetAlt(const Eigen::Vector3d& coordinate) const;
83 float GetAltVar(const Eigen::Vector3d& coordinate) const;
86 unsigned int GetCount(const Eigen::Vector3d& coordinate) const;
88 unsigned char GetValue(unsigned int row, unsigned int col) const {
89 return static_cast<LosslessMapMatrix*>(map_matrix_)
90 ->GetMapCell(row, col)
91 .GetValue();
92 }
94 float GetVar(unsigned int row, unsigned int col) const {
95 return static_cast<LosslessMapMatrix*>(map_matrix_)
96 ->GetMapCell(row, col)
97 .GetVar();
98 }
100 float GetAlt(unsigned int row, unsigned int col) const {
101 return static_cast<LosslessMapMatrix*>(map_matrix_)
102 ->GetMapCell(row, col)
103 .GetAlt();
104 }
106 float GetAltVar(unsigned int row, unsigned int col) const {
107 return static_cast<LosslessMapMatrix*>(map_matrix_)
108 ->GetMapCell(row, col)
109 .GetAltVar();
110 }
112 unsigned int GetCount(unsigned int row, unsigned int col) const {
113 return static_cast<LosslessMapMatrix*>(map_matrix_)
114 ->GetMapCell(row, col)
115 .GetCount();
116 }
118 inline const LosslessMapSingleCell& GetFirstMapCell(unsigned int row,
119 unsigned int col) const {
120 return static_cast<LosslessMapMatrix*>(map_matrix_)
121 ->GetMapCell(row, col)
122 .map_cells[0];
123 }
124 inline LosslessMapSingleCell& GetFirstMapCell(unsigned int row,
125 unsigned int col) {
126 return static_cast<LosslessMapMatrix*>(map_matrix_)
127 ->GetMapCell(row, col)
128 .map_cells[0];
129 }
130
132 inline float GetMinAltitude() const { return min_altitude_; }
134 inline void SetMinAltitude(float altitude) { min_altitude_ = altitude; }
135
136 protected:
139};
140
141} // namespace msf
142} // namespace localization
143} // namespace apollo
The data structure of a Node in the map.
BaseMapMatrix * map_matrix_
The data structure of the map datas, which is a matrix.
const LosslessMapSingleCell & GetFirstMapCell(unsigned int row, unsigned int col) const
Get the constant map cell given the coordinate.
float GetAltVar(unsigned int row, unsigned int col) const
Get the map cell's variance of the altitude
float GetMinAltitude() const
Get the min altitude of point cloud in the node.
float GetAlt(unsigned int row, unsigned int col) const
Get the map cell's average altitude.
float GetVar(unsigned int row, unsigned int col) const
Get the map cell variance of the intensity.
void SetValue(const Eigen::Vector3d &coordinate, unsigned char intensity)
Set the value of a pixel in the map node.
float min_altitude_
The min altitude of point cloud in the node.
void GetAlt(const Eigen::Vector3d &coordinate, std::vector< float > *alts) const
Given the 3D global coordinate, get the map cell's average altitude of each layer.
void SetValueLayer(const Eigen::Vector3d &coordinate, unsigned char intensity)
Set the value of a pixel in a layer in the map node.
bool SetValueIfInBound(const Eigen::Vector3d &coordinate, unsigned char intensity)
Set the value of a pixel in the map node if the pixel in the node.
void SetMinAltitude(float altitude)
Set the min altitude of point cloud in the node.
void GetAltVar(const Eigen::Vector3d &coordinate, std::vector< float > *alt_vars) const
Given the 3D global coordinate, get the map cell's variance of the altitude of each layer.
void GetValue(const Eigen::Vector3d &coordinate, std::vector< unsigned char > *values) const
Given the 3D global coordinate, get the map cell average intensity of each layer.
LosslessMapSingleCell & GetFirstMapCell(unsigned int row, unsigned int col)
void GetCount(const Eigen::Vector3d &coordinate, std::vector< unsigned int > *counts) const
Given the 3D global coordinate, get the map cell's count of the samples of each layer.
unsigned char GetValue(unsigned int row, unsigned int col) const
Get the map cell average intensity.
void GetVar(const Eigen::Vector3d &coordinate, std::vector< float > *vars) const
Given the 3D global coordinate, get the map cell variance of the intensity of each layer.
unsigned int GetCount(unsigned int row, unsigned int col) const
Get the map cell's count of the samples.
class register implement
Definition arena_queue.h:37