Apollo  6.0
Open source self driving car software
ndt_map_node.h
Go to the documentation of this file.
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 
26 namespace apollo {
27 namespace localization {
28 namespace msf {
29 namespace pyramid_map {
30 
31 class NdtMapNode : public BaseMapNode {
32  public:
33  NdtMapNode();
34  ~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
static void Reduce(NdtMapNode *map_node, const NdtMapNode &map_node_new)
Combine two map nodes (Reduce operation in mapreduce). The result is saved in map_node.
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
unsigned int num_valid_cells_
The number of cells with elements.
Definition: ndt_map_node.h:63
Eigen::Vector3d GetCoordinate3D(unsigned int x, unsigned int y, int altitude_index) const
Given the local x, y, altitude index, return the global coordinate.
Eigen::Vector3d Vector3d
Definition: frame_transform.h:27
unsigned int num_valid_single_cells_
The number of single cells with elements.
Definition: ndt_map_node.h:65
MapNodeIndex index_
The index of this node.
Definition: base_map_node.h:189
unsigned int resolution_id_
The ID of the resolution. Should be less than BaseMapConfig::_map_resolutions.size().
Definition: base_map_node_index.h:68
void Init(const BaseMapConfig *map_config)
Initialize the map node. Call this function first before use it!
The data structure of a Node in the map.
Definition: base_map_node.h:37
The options of the reflectance map.
Definition: ndt_map_config.h:29
The options of the reflectance map.
Definition: base_map_config.h:42
float GetMapResolutionZ() const
Get the resolution of this map nodex.
Definition: ndt_map_node.h:41
Definition: base_map_node_index.h:33
Eigen::Vector3d GetCoordinateCenter3D(unsigned int x, unsigned int y, int altitude_index) const
Given the local x, y, altitude index, return the global coordinate.
const BaseMapConfig * map_config_
The map settings.
Definition: base_map_node.h:186