# hdmap **Repository Path**: zgggy/hdmap ## Basic Information - **Project Name**: hdmap - **Description**: 高精地图库,创建以区域-道路-段-组-车道-单元为结构的参数化路网,搜索最优路径和获取换道建议。 - **Primary Language**: Unknown - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-11-08 - **Last Updated**: 2024-03-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: dijkstra, auto-drive, g2-curv, Map ## README # HDMAP ![hdmap](doc/img/hdmap_128.png) ## CMakeLists to use this lib, write at least these 3 statements: ```CMake add_compile_options( -std=c++17 # for new future of c++ -fconcepts # for auto paremeters in lambda ) include(hdmap/CMakeLists.include) target_link_libraries(${PROJECT_NAME} # other libs hdmap_lib # required!!! ) ``` a sample: ```CMake cmake_minimum_required(VERSION 3.0.2) project(node) add_compile_options( -std=c++17 # for new future of c++ -fconcepts # for auto paremeters in lambda ) find_package(catkin REQUIRED COMPONENTS) include(hdmap/CMakeLists.include) add_executable(node main.cc ) target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} hdmap_lib ) ``` ## C++ just `#include ` and instantiate them by `shared_ptr`(suggested), a sample: ```cpp #include #include using hdmap::Map, hdmap::Segment, hdmap::BaseLane, hdmap::Lane; int main() { auto map = std::make_shared(); map->AddRoad(0); map->roads_[0]->Reference( Segment(Segment::SEGMENT_TYPE::CLOTHOID, planner::Point{0, 0, 0, 0}, planner::Point{2000, 0, 0, 0})); map->AddLane(0, 0, 0, {0}, BaseLane::PARAMETER_TYPE::F); auto topo = std::make_shared(map); topo->SetStartAndEndNode(Lane::LaneID{0, 1, 1, 0}, 9, Lane::LaneID{0, 2, 0, 2}, 19); topo->UpdateTopoGraph(); topo->Print(); auto navi = std::make_shared(hdmap::Routing::METHOD::DIJKSTRA, topo); auto traj = navi->GlobalRefTraj(); auto sample_traj = traj.SampleTraj(0.1); for (auto sample : sample_traj) std::cout << sample.x << " " << sample.y << std::endl; } ```