Apollo 10.0
自动驾驶开放平台
apollo::localization::msf::pyramid_map::MapNodeIndex类 参考

#include <base_map_node_index.h>

apollo::localization::msf::pyramid_map::MapNodeIndex 的协作图:

Public 成员函数

 MapNodeIndex ()
 The constructor.
 
bool operator< (const MapNodeIndex &index) const
 Overload the less than operator.
 
bool operator== (const MapNodeIndex &index) const
 Overload the equal operator.
 
bool operator!= (const MapNodeIndex &index) const
 Overload the unequal operator.
 
std::string ToString () const
 

静态 Public 成员函数

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 MapNodeIndex GetMapNodeIndex (const BaseMapConfig &option, const Eigen::Vector2d &coordinate, unsigned int resolution_id, int zone_id)
 
static unsigned int GetMapIndexRangeEast (const BaseMapConfig &option, unsigned int resolution_id)
 Get the index range (maximum possible index + 1) in the east direction.
 
static unsigned int GetMapIndexRangeNorth (const BaseMapConfig &option, unsigned int resolution_id)
 Get the index range (maximum possible index + 1) in the north direction.
 

Public 属性

unsigned int resolution_id_ = 0
 The ID of the resolution.
 
int zone_id_ = 10
 The zone ID.
 
unsigned int m_ = 0
 The map node ID at the northing direction.
 
unsigned int n_ = 0
 The map node ID at the easting direction.
 

友元

std::ostream & operator<< (std::ostream &cout, const MapNodeIndex &index)
 

详细描述

在文件 base_map_node_index.h33 行定义.

构造及析构函数说明

◆ MapNodeIndex()

apollo::localization::msf::pyramid_map::MapNodeIndex::MapNodeIndex ( )

The constructor.

在文件 base_map_node_index.cc28 行定义.

28 {
30 zone_id_ = 50;
31 m_ = 0;
32 n_ = 0;
33}
unsigned int m_
The map node ID at the northing direction.
unsigned int resolution_id_
The ID of the resolution.
unsigned int n_
The map node ID at the easting direction.

成员函数说明

◆ GetMapIndexRangeEast()

unsigned int apollo::localization::msf::pyramid_map::MapNodeIndex::GetMapIndexRangeEast ( const BaseMapConfig option,
unsigned int  resolution_id 
)
static

Get the index range (maximum possible index + 1) in the east direction.

在文件 base_map_node_index.cc95 行定义.

96 {
97 return static_cast<unsigned int>(
98 (option.map_range_.GetMaxX() - option.map_range_.GetMinX()) /
99 (static_cast<float>(option.map_node_size_x_) *
100 option.map_resolutions_[resolution_id]));
101}

◆ GetMapIndexRangeNorth()

unsigned int apollo::localization::msf::pyramid_map::MapNodeIndex::GetMapIndexRangeNorth ( const BaseMapConfig option,
unsigned int  resolution_id 
)
static

Get the index range (maximum possible index + 1) in the north direction.

在文件 base_map_node_index.cc103 行定义.

104 {
105 return static_cast<unsigned int>(
106 (option.map_range_.GetMaxY() - option.map_range_.GetMinY()) /
107 (static_cast<float>(option.map_node_size_y_) *
108 option.map_resolutions_[resolution_id]));
109}

◆ GetMapNodeIndex() [1/2]

MapNodeIndex apollo::localization::msf::pyramid_map::MapNodeIndex::GetMapNodeIndex ( const BaseMapConfig option,
const Eigen::Vector2d &  coordinate,
unsigned int  resolution_id,
int  zone_id 
)
static

在文件 base_map_node_index.cc67 行定义.

70 {
71 // assert(resolution_id < option.map_resolutions_.size());
72 MapNodeIndex index;
73 index.resolution_id_ = resolution_id;
74 index.zone_id_ = zone_id;
75 unsigned int n =
76 static_cast<int>((coordinate[0] - option.map_range_.GetMinX()) /
77 (static_cast<float>(option.map_node_size_x_) *
78 option.map_resolutions_[resolution_id]));
79 unsigned int m =
80 static_cast<int>((coordinate[1] - option.map_range_.GetMinY()) /
81 (static_cast<float>(option.map_node_size_y_) *
82 option.map_resolutions_[resolution_id]));
83 if (n < GetMapIndexRangeEast(option, resolution_id) &&
84 m < GetMapIndexRangeNorth(option, resolution_id)) {
85 index.m_ = m;
86 index.n_ = n;
87 } else {
88 std::cerr << "MapNodeIndex::get_map_node_index illegal n: " << n
89 << ",m: " << m << std::endl;
90 // assert(0 == 1); // should never reach here
91 }
92 return index;
93}
static unsigned int GetMapIndexRangeEast(const BaseMapConfig &option, unsigned int resolution_id)
Get the index range (maximum possible index + 1) in the east direction.
static unsigned int GetMapIndexRangeNorth(const BaseMapConfig &option, unsigned int resolution_id)
Get the index range (maximum possible index + 1) in the north direction.

◆ GetMapNodeIndex() [2/2]

MapNodeIndex apollo::localization::msf::pyramid_map::MapNodeIndex::GetMapNodeIndex ( const BaseMapConfig option,
const Eigen::Vector3d &  coordinate,
unsigned int  resolution_id,
int  zone_id 
)
static

Construct a map node index, given a global coordinate, eigen version.

在文件 base_map_node_index.cc59 行定义.

62 {
63 Vector2d coord2d(coordinate[0], coordinate[1]);
64 return GetMapNodeIndex(option, coord2d, resolution_id, zone_id);
65}
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.

◆ operator!=()

bool apollo::localization::msf::pyramid_map::MapNodeIndex::operator!= ( const MapNodeIndex index) const

Overload the unequal operator.

在文件 base_map_node_index.cc47 行定义.

47 {
48 return !(*this == index);
49}

◆ operator<()

bool apollo::localization::msf::pyramid_map::MapNodeIndex::operator< ( const MapNodeIndex index) const

Overload the less than operator.

在文件 base_map_node_index.cc35 行定义.

35 {
36 // Compare elements by priority.
37 return std::forward_as_tuple(resolution_id_, zone_id_, m_, n_) <
38 std::forward_as_tuple(index.resolution_id_, index.zone_id_, index.m_,
39 index.n_);
40}

◆ operator==()

bool apollo::localization::msf::pyramid_map::MapNodeIndex::operator== ( const MapNodeIndex index) const

Overload the equal operator.

在文件 base_map_node_index.cc42 行定义.

42 {
43 return resolution_id_ == index.resolution_id_ && zone_id_ == index.zone_id_ &&
44 m_ == index.m_ && n_ == index.n_;
45}

◆ ToString()

std::string apollo::localization::msf::pyramid_map::MapNodeIndex::ToString ( ) const

在文件 base_map_node_index.cc51 行定义.

51 {
52 std::ostringstream ss;
53 ss << "Map node (Resolution ID: " << resolution_id_
54 << " Zone ID: " << zone_id_ << " Easting: " << n_ << " Northing: " << m_
55 << ")";
56 return ss.str();
57}

友元及相关函数文档

◆ operator<<

std::ostream & operator<< ( std::ostream &  cout,
const MapNodeIndex index 
)
friend

在文件 base_map_node_index.cc111 行定义.

111 {
112 cerr << index.ToString();
113 return cerr;
114}

类成员变量说明

◆ m_

unsigned int apollo::localization::msf::pyramid_map::MapNodeIndex::m_ = 0

The map node ID at the northing direction.

在文件 base_map_node_index.h73 行定义.

◆ n_

unsigned int apollo::localization::msf::pyramid_map::MapNodeIndex::n_ = 0

The map node ID at the easting direction.

在文件 base_map_node_index.h75 行定义.

◆ resolution_id_

unsigned int apollo::localization::msf::pyramid_map::MapNodeIndex::resolution_id_ = 0

The ID of the resolution.

Should be less than BaseMapConfig::_map_resolutions.size().

在文件 base_map_node_index.h68 行定义.

◆ zone_id_

int apollo::localization::msf::pyramid_map::MapNodeIndex::zone_id_ = 10

The zone ID.

1 - 60 and -1 - -60. The positive value is the zone at the north hemisphere.

在文件 base_map_node_index.h71 行定义.


该类的文档由以下文件生成: