Apollo 10.0
自动驾驶开放平台
pyramid_map_node.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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#pragma once
17
18#include <vector>
19
20#include "Eigen/Core"
21
24
25namespace apollo {
26namespace localization {
27namespace msf {
28namespace pyramid_map {
29
31 public:
34
35 public:
36 virtual void Init(const BaseMapConfig* map_config);
37 virtual void Init(const BaseMapConfig* map_config, const MapNodeIndex& index,
38 bool create_map_cells = true);
39
41 void BottomUpSafe();
42
46 void BottomUpBase();
47
53 bool AddValueIfInBound(const Eigen::Vector3d& coordinate,
54 unsigned char intensity, unsigned int level = 0);
59 void AddValueIfInBound(const std::vector<Eigen::Vector3d>& coordinates,
60 const std::vector<unsigned char>& intensity,
61 unsigned int level = 0);
65 bool GetCoordinate(const Eigen::Vector2d& coordinate, unsigned int level,
66 unsigned int* x, unsigned int* y) const;
68 Eigen::Vector2d GetCoordinate(unsigned int level, unsigned int x,
69 unsigned int y) const;
70
71 virtual bool GetCoordinate(const Eigen::Vector2d& coordinate, unsigned int* x,
72 unsigned int* y) const;
73 virtual bool GetCoordinate(const Eigen::Vector3d& coordinate, unsigned int* x,
74 unsigned int* y) const;
75
76 virtual Eigen::Vector2d GetCoordinate(unsigned int x, unsigned int y) const;
77
80 float GetIntensitySafe(const Eigen::Vector3d& coordinate,
81 unsigned int level = 0) const;
84 float GetIntensityVarSafe(const Eigen::Vector3d& coordinate,
85 unsigned int level = 0) const;
88 float GetAltitudeSafe(const Eigen::Vector3d& coordinate,
89 unsigned int level = 0) const;
92 float GetAltitudeVarSafe(const Eigen::Vector3d& coordinate,
93 unsigned int level = 0) const;
96 float GetGroundAltitudeSafe(const Eigen::Vector3d& coordinate,
97 unsigned int level = 0) const;
100 unsigned int GetCountSafe(const Eigen::Vector3d& coordinate,
101 unsigned int level = 0) const;
104 unsigned int GetGroundCountSafe(const Eigen::Vector3d& coordinate,
105 unsigned int level = 0) const;
106
109 float GetIntensity(const Eigen::Vector3d& coordinate,
110 unsigned int level = 0) const;
113 float GetIntensityVar(const Eigen::Vector3d& coordinate,
114 unsigned int level = 0) const;
117 float GetAltitude(const Eigen::Vector3d& coordinate,
118 unsigned int level = 0) const;
121 float GetAltitudeVar(const Eigen::Vector3d& coordinate,
122 unsigned int level = 0) const;
125 float GetGroundAltitude(const Eigen::Vector3d& coordinate,
126 unsigned int level = 0) const;
129 unsigned int GetCount(const Eigen::Vector3d& coordinate,
130 unsigned int level = 0) const;
133 unsigned int GetGroundCount(const Eigen::Vector3d& coordinate,
134 unsigned int level = 0) const;
135
137 double ComputeMeanIntensity(unsigned int level = 0);
138
139 private:
140 std::vector<float> resolutions_mr_;
141};
142
143} // namespace pyramid_map
144} // namespace msf
145} // namespace localization
146} // namespace apollo
The data structure of a Node in the map.
void BottomUpSafe()
Propagate the data to the coarse resolution by check.
float GetAltitudeVar(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's variance of the altitude without check.
float GetIntensityVar(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell variance of the intensity without check.
bool GetCoordinate(const Eigen::Vector2d &coordinate, unsigned int level, unsigned int *x, unsigned int *y) const
Given the global coordinate, get the local 2D coordinate of the map cell matrix.
float GetAltitudeVarSafe(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's variance of the altitude with check.
float GetIntensity(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell intensity without check.
void BottomUpBase()
Propagate the data to the coarse resolution.
unsigned int GetGroundCount(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's count of the ground samples without check.
unsigned int GetCount(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's count of the samples without check.
double ComputeMeanIntensity(unsigned int level=0)
Compute mean intensity.
float GetAltitudeSafe(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's average altitude with check.
unsigned int GetGroundCountSafe(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's count of the ground samples with check.
unsigned int GetCountSafe(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's count of the samples with check.
float GetGroundAltitude(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's average ground altitude without check.
float GetIntensitySafe(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell intensity with check.
float GetIntensityVarSafe(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell variance of the intensity with check.
bool AddValueIfInBound(const Eigen::Vector3d &coordinate, unsigned char intensity, unsigned int level=0)
Add the value of a pixel in the map node if the pixel in the node.
virtual void Init(const BaseMapConfig *map_config)
Initialize the map node.
float GetAltitude(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's average altitude without check.
float GetGroundAltitudeSafe(const Eigen::Vector3d &coordinate, unsigned int level=0) const
Given the 3D global coordinate, get the map cell's average ground altitude with check.
class register implement
Definition arena_queue.h:37