Apollo  6.0
Open source self driving car software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
apollo::localization::msf::pyramid_map::BaseMap Class Reference

The data structure of the base map. More...

#include <base_map.h>

Inheritance diagram for apollo::localization::msf::pyramid_map::BaseMap:
Inheritance graph
Collaboration diagram for apollo::localization::msf::pyramid_map::BaseMap:
Collaboration graph

Public Member Functions

 BaseMap (BaseMapConfig *config)
 The constructor. More...
 
virtual ~BaseMap ()
 The destructor. More...
 
virtual void InitMapNodeCaches (int cacheL1_size, int cahceL2_size)
 
void AttachMapNodePool (BaseMapNodePool *p_map_node_pool)
 Attach map node pointer. More...
 
BaseMapNodeGetMapNode (const MapNodeIndex &index)
 Return the map node, if it's not in the cache, return false. More...
 
BaseMapNodeGetMapNodeSafe (const MapNodeIndex &index)
 Return the map node, if it's not in the cache, safely load it. More...
 
bool IsMapNodeExist (const MapNodeIndex &index)
 Check if the map node in the cache. More...
 
bool SetMapFolderPath (const std::string folder_path)
 Set the directory of the map. More...
 
void AddDataset (const std::string dataset_path)
 Add a dataset path to the map config. More...
 
void Release ()
 Release resources. More...
 
virtual void PreloadMapArea (const Eigen::Vector3d &location, const Eigen::Vector3d &trans_diff, unsigned int resolution_id, unsigned int zone_id)
 Preload map nodes for the next frame location calculation. It will forecasts the nodes by the direction of the car moving. Because the progress of loading will cost a long time (over 100ms), it must do this for a period of time in advance. After the index of nodes calculate finished, it will create loading tasks, but will not wait for the loading finished, eigen version. More...
 
virtual bool LoadMapArea (const Eigen::Vector3d &seed_pt3d, unsigned int resolution_id, unsigned int zone_id, int filter_size_x, int filter_size_y)
 Load map nodes for the location calculate of this frame. If the forecasts are correct in last frame, these nodes will be all in cache, if not, then need to create loading tasks, and wait for the loading finish, in order to the nodes which the following calculate needed are all in the memory, eigen version. More...
 
void ComputeMd5ForAllMapNodes ()
 Compute md5 for all map node file in map. More...
 
bool CheckMap ()
 Check if map is normal. More...
 
bool CheckMapStrictly ()
 Check if map is normal(with map node checking). More...
 
const BaseMapConfigGetMapConfig () const
 Get the map config. More...
 
BaseMapConfigGetMapConfig ()
 Get the map config. More...
 
const std::vector< std::string > & GetAllMapNodePaths () const
 Get all map node paths. More...
 
const std::vector< std::string > & GetAllMapNodeMd5s () const
 Get all map node md5s. More...
 

Protected Member Functions

void GetAllMapIndexAndPath ()
 
MapNodeIndex GetMapIndexFromMapPath (const std::string &map_path)
 
void LoadMapNodes (std::set< MapNodeIndex > *map_ids)
 Load map node by index. More...
 
void PreloadMapNodes (std::set< MapNodeIndex > *map_ids)
 Load map node by index. More...
 
void LoadMapNodeThreadSafety (const MapNodeIndex &index, bool is_reserved=false)
 Load map node by index, thread_safety. More...
 
void CheckAndUpdateCache (std::set< MapNodeIndex > *map_ids)
 Check map node in L2 Cache. More...
 

Protected Attributes

BaseMapConfigmap_config_ = nullptr
 The map settings. More...
 
MapNodeCache< MapNodeIndex, BaseMapNode >::DestroyFunc destroy_func_lvl1_
 
MapNodeCache< MapNodeIndex, BaseMapNode >::DestroyFunc destroy_func_lvl2_
 
std::unique_ptr< MapNodeCache< MapNodeIndex, BaseMapNode > > map_node_cache_lvl1_ = nullptr
 The cache for map node preload. More...
 
std::unique_ptr< MapNodeCache< MapNodeIndex, BaseMapNode > > map_node_cache_lvl2_ = nullptr
 
BaseMapNodePoolmap_node_pool_ = nullptr
 The map node memory pool pointer. More...
 
std::set< MapNodeIndexmap_preloading_task_index_
 
boost::recursive_mutex map_load_mutex_
 The mutex for preload map node. More...
 
std::vector< MapNodeIndexall_map_node_indices_
 All the map nodes in the Map (in the disk). More...
 
std::vector< std::string > all_map_node_paths_
 
std::vector< std::string > all_map_node_md5s_
 All the map nodes' md5 in the Map (in the disk). More...
 

Detailed Description

The data structure of the base map.

Constructor & Destructor Documentation

◆ BaseMap()

apollo::localization::msf::pyramid_map::BaseMap::BaseMap ( BaseMapConfig config)
explicit

The constructor.

◆ ~BaseMap()

virtual apollo::localization::msf::pyramid_map::BaseMap::~BaseMap ( )
virtual

The destructor.

Member Function Documentation

◆ AddDataset()

void apollo::localization::msf::pyramid_map::BaseMap::AddDataset ( const std::string  dataset_path)

Add a dataset path to the map config.

◆ AttachMapNodePool()

void apollo::localization::msf::pyramid_map::BaseMap::AttachMapNodePool ( BaseMapNodePool p_map_node_pool)

Attach map node pointer.

◆ CheckAndUpdateCache()

void apollo::localization::msf::pyramid_map::BaseMap::CheckAndUpdateCache ( std::set< MapNodeIndex > *  map_ids)
protected

Check map node in L2 Cache.

◆ CheckMap()

bool apollo::localization::msf::pyramid_map::BaseMap::CheckMap ( )

Check if map is normal.

◆ CheckMapStrictly()

bool apollo::localization::msf::pyramid_map::BaseMap::CheckMapStrictly ( )

Check if map is normal(with map node checking).

◆ ComputeMd5ForAllMapNodes()

void apollo::localization::msf::pyramid_map::BaseMap::ComputeMd5ForAllMapNodes ( )

Compute md5 for all map node file in map.

◆ GetAllMapIndexAndPath()

void apollo::localization::msf::pyramid_map::BaseMap::GetAllMapIndexAndPath ( )
protected

◆ GetAllMapNodeMd5s()

const std::vector<std::string>& apollo::localization::msf::pyramid_map::BaseMap::GetAllMapNodeMd5s ( ) const
inline

Get all map node md5s.

◆ GetAllMapNodePaths()

const std::vector<std::string>& apollo::localization::msf::pyramid_map::BaseMap::GetAllMapNodePaths ( ) const
inline

Get all map node paths.

◆ GetMapConfig() [1/2]

const BaseMapConfig& apollo::localization::msf::pyramid_map::BaseMap::GetMapConfig ( ) const
inline

Get the map config.

◆ GetMapConfig() [2/2]

BaseMapConfig& apollo::localization::msf::pyramid_map::BaseMap::GetMapConfig ( )
inline

Get the map config.

◆ GetMapIndexFromMapPath()

MapNodeIndex apollo::localization::msf::pyramid_map::BaseMap::GetMapIndexFromMapPath ( const std::string &  map_path)
protected

◆ GetMapNode()

BaseMapNode* apollo::localization::msf::pyramid_map::BaseMap::GetMapNode ( const MapNodeIndex index)

Return the map node, if it's not in the cache, return false.

◆ GetMapNodeSafe()

BaseMapNode* apollo::localization::msf::pyramid_map::BaseMap::GetMapNodeSafe ( const MapNodeIndex index)

Return the map node, if it's not in the cache, safely load it.

◆ InitMapNodeCaches()

virtual void apollo::localization::msf::pyramid_map::BaseMap::InitMapNodeCaches ( int  cacheL1_size,
int  cahceL2_size 
)
virtual

◆ IsMapNodeExist()

bool apollo::localization::msf::pyramid_map::BaseMap::IsMapNodeExist ( const MapNodeIndex index)

Check if the map node in the cache.

◆ LoadMapArea()

virtual bool apollo::localization::msf::pyramid_map::BaseMap::LoadMapArea ( const Eigen::Vector3d &  seed_pt3d,
unsigned int  resolution_id,
unsigned int  zone_id,
int  filter_size_x,
int  filter_size_y 
)
virtual

Load map nodes for the location calculate of this frame. If the forecasts are correct in last frame, these nodes will be all in cache, if not, then need to create loading tasks, and wait for the loading finish, in order to the nodes which the following calculate needed are all in the memory, eigen version.

◆ LoadMapNodes()

void apollo::localization::msf::pyramid_map::BaseMap::LoadMapNodes ( std::set< MapNodeIndex > *  map_ids)
protected

Load map node by index.

◆ LoadMapNodeThreadSafety()

void apollo::localization::msf::pyramid_map::BaseMap::LoadMapNodeThreadSafety ( const MapNodeIndex index,
bool  is_reserved = false 
)
protected

Load map node by index, thread_safety.

◆ PreloadMapArea()

virtual void apollo::localization::msf::pyramid_map::BaseMap::PreloadMapArea ( const Eigen::Vector3d &  location,
const Eigen::Vector3d &  trans_diff,
unsigned int  resolution_id,
unsigned int  zone_id 
)
virtual

Preload map nodes for the next frame location calculation. It will forecasts the nodes by the direction of the car moving. Because the progress of loading will cost a long time (over 100ms), it must do this for a period of time in advance. After the index of nodes calculate finished, it will create loading tasks, but will not wait for the loading finished, eigen version.

◆ PreloadMapNodes()

void apollo::localization::msf::pyramid_map::BaseMap::PreloadMapNodes ( std::set< MapNodeIndex > *  map_ids)
protected

Load map node by index.

◆ Release()

void apollo::localization::msf::pyramid_map::BaseMap::Release ( )

Release resources.

◆ SetMapFolderPath()

bool apollo::localization::msf::pyramid_map::BaseMap::SetMapFolderPath ( const std::string  folder_path)

Set the directory of the map.

Member Data Documentation

◆ all_map_node_indices_

std::vector<MapNodeIndex> apollo::localization::msf::pyramid_map::BaseMap::all_map_node_indices_
protected

All the map nodes in the Map (in the disk).

◆ all_map_node_md5s_

std::vector<std::string> apollo::localization::msf::pyramid_map::BaseMap::all_map_node_md5s_
protected

All the map nodes' md5 in the Map (in the disk).

◆ all_map_node_paths_

std::vector<std::string> apollo::localization::msf::pyramid_map::BaseMap::all_map_node_paths_
protected

◆ destroy_func_lvl1_

MapNodeCache<MapNodeIndex, BaseMapNode>::DestroyFunc apollo::localization::msf::pyramid_map::BaseMap::destroy_func_lvl1_
protected

◆ destroy_func_lvl2_

MapNodeCache<MapNodeIndex, BaseMapNode>::DestroyFunc apollo::localization::msf::pyramid_map::BaseMap::destroy_func_lvl2_
protected

◆ map_config_

BaseMapConfig* apollo::localization::msf::pyramid_map::BaseMap::map_config_ = nullptr
protected

The map settings.

◆ map_load_mutex_

boost::recursive_mutex apollo::localization::msf::pyramid_map::BaseMap::map_load_mutex_
protected

The mutex for preload map node.

◆ map_node_cache_lvl1_

std::unique_ptr<MapNodeCache<MapNodeIndex, BaseMapNode> > apollo::localization::msf::pyramid_map::BaseMap::map_node_cache_lvl1_ = nullptr
protected

The cache for map node preload.

◆ map_node_cache_lvl2_

std::unique_ptr<MapNodeCache<MapNodeIndex, BaseMapNode> > apollo::localization::msf::pyramid_map::BaseMap::map_node_cache_lvl2_ = nullptr
protected

brief The dynamic map node preloading thread pool pointer.

◆ map_node_pool_

BaseMapNodePool* apollo::localization::msf::pyramid_map::BaseMap::map_node_pool_ = nullptr
protected

The map node memory pool pointer.

◆ map_preloading_task_index_

std::set<MapNodeIndex> apollo::localization::msf::pyramid_map::BaseMap::map_preloading_task_index_
protected

Keep the index of preloading nodes.


The documentation for this class was generated from the following file: