Apollo 10.0
自动驾驶开放平台
base_map_node_index.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 <iostream>
19#include <string>
20
23
24namespace apollo {
25namespace localization {
26namespace msf {
27namespace pyramid_map {
28
29class MapNodeIndex;
30
31std::ostream& operator<<(std::ostream& cout, const MapNodeIndex& index);
32
34 public:
38 bool operator<(const MapNodeIndex& index) const;
40 bool operator==(const MapNodeIndex& index) const;
42 bool operator!=(const MapNodeIndex& index) const;
43 std::string ToString() const;
44
47 static MapNodeIndex GetMapNodeIndex(const BaseMapConfig& option,
48 const Eigen::Vector3d& coordinate,
49 unsigned int resolution_id, int zone_id);
50 static MapNodeIndex GetMapNodeIndex(const BaseMapConfig& option,
51 const Eigen::Vector2d& coordinate,
52 unsigned int resolution_id, int zone_id);
53
56 static unsigned int GetMapIndexRangeEast(const BaseMapConfig& option,
57 unsigned int resolution_id);
60 static unsigned int GetMapIndexRangeNorth(const BaseMapConfig& option,
61 unsigned int resolution_id);
62
63 friend std::ostream& operator<<(std::ostream& cout,
64 const MapNodeIndex& index);
65
68 unsigned int resolution_id_ = 0;
71 int zone_id_ = 10;
73 unsigned int m_ = 0;
75 unsigned int n_ = 0;
76};
77
78} // namespace pyramid_map
79} // namespace msf
80} // namespace localization
81} // namespace apollo
unsigned int m_
The map node ID at the northing direction.
bool operator<(const MapNodeIndex &index) const
Overload the less than operator.
static unsigned int GetMapIndexRangeEast(const BaseMapConfig &option, unsigned int resolution_id)
Get the index range (maximum possible index + 1) in the east direction.
bool operator!=(const MapNodeIndex &index) const
Overload the unequal operator.
friend std::ostream & operator<<(std::ostream &cout, const MapNodeIndex &index)
unsigned int resolution_id_
The ID of the resolution.
unsigned int n_
The map node ID at the easting direction.
bool operator==(const MapNodeIndex &index) const
Overload the equal operator.
static MapNodeIndex GetMapNodeIndex(const BaseMapConfig &option, const Eigen::Vector3d &coordinate, unsigned int resolution_id, int zone_id)
Construct a map node index, given a global coordinate, eigen version.
static unsigned int GetMapIndexRangeNorth(const BaseMapConfig &option, unsigned int resolution_id)
Get the index range (maximum possible index + 1) in the north direction.
std::ostream & operator<<(std::ostream &cerr, const MapNodeIndex &index)
apollo::localization::msf::pyramid_map::MapNodeIndex MapNodeIndex
class register implement
Definition arena_queue.h:37