Apollo  6.0
Open source self driving car software
ndt_map_node.h
Go to the documentation of this file.
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 "Eigen/Core"
20 
25 
26 namespace apollo {
27 namespace localization {
28 namespace msf {
29 
30 class NdtMapNode : public BaseMapNode {
31  public:
32  NdtMapNode();
33  ~NdtMapNode();
34 
36  inline float GetMapResolutionZ() const {
37  return static_cast<const NdtMapConfig*>(map_config_)
38  ->map_resolutions_z_[index_.resolution_id_];
39  }
40 
44  Eigen::Vector3d GetCoordinate3D(unsigned int x, unsigned int y,
45  int altitude_index) const;
46 
50  Eigen::Vector3d GetCoordinateCenter3D(unsigned int x, unsigned int y,
51  int altitude_index) const;
52 
55  static void Reduce(NdtMapNode* map_node, const NdtMapNode& map_node_new);
56 
58  unsigned int num_valid_cells_;
61 };
62 
63 } // namespace msf
64 } // namespace localization
65 } // 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_single_cells_
The number of single cells with elements.
Definition: ndt_map_node.h:60
Eigen::Vector3d Vector3d
Definition: frame_transform.h:27
float GetMapResolutionZ() const
Get the resolution of this map nodex.
Definition: ndt_map_node.h:36
The options of the reflectance map.
Definition: ndt_map_config.h:28
MapNodeIndex index_
The index of this node.
Definition: base_map_node.h:172
Eigen::Vector3d GetCoordinate3D(unsigned int x, unsigned int y, int altitude_index) const
Given the local x, y, altitude index, return the global coordinate.
unsigned int num_valid_cells_
The number of cells with elements.
Definition: ndt_map_node.h:58
Definition: ndt_map_node.h:30
const BaseMapConfig * map_config_
The map settings.
Definition: base_map_node.h:170
Eigen::Vector3d GetCoordinateCenter3D(unsigned int x, unsigned int y, int altitude_index) const
Given the local x, y, altitude index, return the global coordinate.
The data structure of a Node in the map.
Definition: base_map_node.h:32
unsigned int resolution_id_
The ID of the resolution. Should be less than BaseMapConfig::map_resolutions_.size().
Definition: base_map_node_index.h:79