Apollo 10.0
自动驾驶开放平台
ndt_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
17#pragma once
18
19#include "Eigen/Core"
20
25
26namespace apollo {
27namespace localization {
28namespace msf {
29namespace pyramid_map {
30
31class NdtMapNode : public BaseMapNode {
32 public:
33 NdtMapNode();
35
36 void Init(const BaseMapConfig* map_config);
37 void Init(const BaseMapConfig* map_config, const MapNodeIndex& index,
38 bool create_map_cells = true);
39
41 inline float GetMapResolutionZ() const {
42 return static_cast<const NdtMapConfig*>(map_config_)
43 ->map_resolutions_z_[index_.resolution_id_];
44 }
45
49 Eigen::Vector3d GetCoordinate3D(unsigned int x, unsigned int y,
50 int altitude_index) const;
51
55 Eigen::Vector3d GetCoordinateCenter3D(unsigned int x, unsigned int y,
56 int altitude_index) const;
57
60 static void Reduce(NdtMapNode* map_node, const NdtMapNode& map_node_new);
61
63 unsigned int num_valid_cells_;
66};
67
68} // namespace pyramid_map
69} // namespace msf
70} // namespace localization
71} // namespace apollo
The data structure of a Node in the map.
const BaseMapConfig * map_config_
The map settings.
MapNodeIndex index_
The index of this node
unsigned int resolution_id_
The ID of the resolution.
void Init(const BaseMapConfig *map_config)
Initialize the map node.
unsigned int num_valid_single_cells_
The number of single cells with elements.
unsigned int num_valid_cells_
The number of cells with elements.
Eigen::Vector3d GetCoordinateCenter3D(unsigned int x, unsigned int y, int altitude_index) const
Given the local x, y, altitude index, return the global coordinate.
static void Reduce(NdtMapNode *map_node, const NdtMapNode &map_node_new)
Combine two map nodes (Reduce operation in mapreduce).
float GetMapResolutionZ() const
Get the resolution of this map nodex.
Eigen::Vector3d GetCoordinate3D(unsigned int x, unsigned int y, int altitude_index) const
Given the local x, y, altitude index, return the global coordinate.
class register implement
Definition arena_queue.h:37