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

#include <base_map_node_index.h>

apollo::localization::msf::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_ = 50
 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.h32 行定义.

构造及析构函数说明

◆ MapNodeIndex()

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

The constructor.

在文件 base_map_node_index.cc25 行定义.

25{}

成员函数说明

◆ GetMapIndexRangeEast()

unsigned int apollo::localization::msf::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.cc84 行定义.

85 {
86 return static_cast<unsigned int>(
87 (option.map_range_.GetMaxX() - option.map_range_.GetMinX()) /
88 (static_cast<float>(option.map_node_size_x_) *
89 option.map_resolutions_[resolution_id]));
90}

◆ GetMapIndexRangeNorth()

unsigned int apollo::localization::msf::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.cc92 行定义.

93 {
94 return static_cast<unsigned int>(
95 (option.map_range_.GetMaxY() - option.map_range_.GetMinY()) /
96 (static_cast<float>(option.map_node_size_y_) *
97 option.map_resolutions_[resolution_id]));
98}

◆ GetMapNodeIndex() [1/2]

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

在文件 base_map_node_index.cc59 行定义.

62 {
63 DCHECK_LT(resolution_id, option.map_resolutions_.size());
64 MapNodeIndex index;
65 index.resolution_id_ = resolution_id;
66 index.zone_id_ = zone_id;
67 int n = static_cast<int>((coordinate[0] - option.map_range_.GetMinX()) /
68 (static_cast<float>(option.map_node_size_x_) *
69 option.map_resolutions_[resolution_id]));
70 int m = static_cast<int>((coordinate[1] - option.map_range_.GetMinY()) /
71 (static_cast<float>(option.map_node_size_y_) *
72 option.map_resolutions_[resolution_id]));
73 if (n >= 0 && m >= 0 &&
74 n < static_cast<int>(GetMapIndexRangeEast(option, resolution_id)) &&
75 m < static_cast<int>(GetMapIndexRangeNorth(option, resolution_id))) {
76 index.m_ = m;
77 index.n_ = n;
78 } else {
79 DCHECK(false); // should never reach here
80 }
81 return index;
82}
static unsigned int GetMapIndexRangeNorth(const BaseMapConfig &option, unsigned int resolution_id)
Get the index range (maximum possible index + 1) in the north direction.
static unsigned int GetMapIndexRangeEast(const BaseMapConfig &option, unsigned int resolution_id)
Get the index range (maximum possible index + 1) in the east direction.

◆ GetMapNodeIndex() [2/2]

MapNodeIndex apollo::localization::msf::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.cc51 行定义.

54 {
55 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
56 return GetMapNodeIndex(option, coord2d, resolution_id, zone_id);
57}
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::MapNodeIndex::operator!= ( const MapNodeIndex index) const

Overload the unequal operator.

在文件 base_map_node_index.cc39 行定义.

39 {
40 return !(*this == index);
41}

◆ operator<()

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

Overload the less than operator.

在文件 base_map_node_index.cc27 行定义.

27 {
28 // Compare elements by priority.
29 return std::forward_as_tuple(resolution_id_, zone_id_, m_, n_) <
30 std::forward_as_tuple(index.resolution_id_, index.zone_id_, index.m_,
31 index.n_);
32}
unsigned int m_
The map node ID at the northing direction.
unsigned int n_
The map node ID at the easting direction.
unsigned int resolution_id_
The ID of the resolution.

◆ operator==()

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

Overload the equal operator.

在文件 base_map_node_index.cc34 行定义.

34 {
35 return resolution_id_ == index.resolution_id_ && zone_id_ == index.zone_id_ &&
36 m_ == index.m_ && n_ == index.n_;
37}

◆ ToString()

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

在文件 base_map_node_index.cc43 行定义.

43 {
44 std::ostringstream ss;
45 ss << "Map node (Resolution ID: " << resolution_id_
46 << " Zone ID: " << zone_id_ << " Easting: " << n_ << " Northing: " << m_
47 << ")";
48 return ss.str();
49}

友元及相关函数文档

◆ operator<<

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

在文件 base_map_node_index.cc100 行定义.

100 {
101 cerr << index.ToString();
102 return cerr;
103}

类成员变量说明

◆ m_

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

The map node ID at the northing direction.

在文件 base_map_node_index.h84 行定义.

◆ n_

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

The map node ID at the easting direction.

在文件 base_map_node_index.h86 行定义.

◆ resolution_id_

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

The ID of the resolution.

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

在文件 base_map_node_index.h79 行定义.

◆ zone_id_

int apollo::localization::msf::MapNodeIndex::zone_id_ = 50

The zone ID.

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

在文件 base_map_node_index.h82 行定义.


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