add new file nav_c_api2 and function

This commit is contained in:
2026-08-06 19:50:46 +07:00
parent 565e18bfb8
commit ad28a413cc
34 changed files with 2439 additions and 216 deletions

View File

@@ -150,6 +150,83 @@ if (NOT TARGET robot_clear_costmap_recovery)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/Navigations/Libraries/robot_clear_costmap_recovery)
endif()
# 3. Packages being migrated from AMR_T800/Test
#
# Prefer the future in-tree location. Until the migration is physically done,
# keep the current sibling Test directory buildable from this root CMake file.
option(PNKX_NAV_CORE_BUILD_TEST_PACKAGES
"Build navigation packages currently kept in AMR_T800/Test"
ON)
option(PNKX_NAV_CORE_BUILD_CATKIN_TEST_PACKAGES
"Build Test packages that require a catkin workspace instead of standalone CMake"
OFF)
set(PNKX_NAV_CORE_TEST_PACKAGES_DIR ""
CACHE PATH "Directory containing the migrated navigation Test packages")
if(NOT PNKX_NAV_CORE_TEST_PACKAGES_DIR)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Test")
set(PNKX_NAV_CORE_TEST_PACKAGES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Test")
elseif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test")
set(PNKX_NAV_CORE_TEST_PACKAGES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../Test")
endif()
endif()
function(pnkx_add_test_package package_name)
set(package_dir "${PNKX_NAV_CORE_TEST_PACKAGES_DIR}/${package_name}")
if(EXISTS "${package_dir}/CMakeLists.txt")
message(STATUS "[pnkx_nav_core] Adding migrated Test package: ${package_name}")
add_subdirectory("${package_dir}" "${CMAKE_BINARY_DIR}/Test/${package_name}")
else()
message(WARNING
"[pnkx_nav_core] Test package '${package_name}' was not found in "
"'${PNKX_NAV_CORE_TEST_PACKAGES_DIR}'.")
endif()
endfunction()
if(PNKX_NAV_CORE_BUILD_TEST_PACKAGES)
if(NOT PNKX_NAV_CORE_TEST_PACKAGES_DIR)
message(FATAL_ERROR
"PNKX_NAV_CORE_BUILD_TEST_PACKAGES is ON, but no Test package directory was found. "
"Set PNKX_NAV_CORE_TEST_PACKAGES_DIR explicitly.")
endif()
# Foundation and message packages.
pnkx_add_test_package(angles)
pnkx_add_test_package(image_geometry)
pnkx_add_test_package(grid_map_core)
pnkx_add_test_package(vda5050_msgs)
# Planner libraries and plugins. SBPL must precede its lattice plugin.
pnkx_add_test_package(sbpl)
pnkx_add_test_package(sbpl_lattice_planner)
pnkx_add_test_package(base_local_planner)
pnkx_add_test_package(hybrid_local_planner)
pnkx_add_test_package(mppi_local_planner)
pnkx_add_test_package(priest_local_planner)
pnkx_add_test_package(stanley_local_planner)
# Supporting runtime packages and test utilities.
pnkx_add_test_package(depth_image_proc)
pnkx_add_test_package(action_core)
pnkx_add_test_package(recovery_core)
pnkx_add_test_package(mission_adapters)
pnkx_add_test_package(nav_test_harness)
# Must be last: it consumes planners, actions, recovery and mission APIs.
pnkx_add_test_package(move_base2)
endif()
# These packages call find_package(catkin REQUIRED ...) for T800 packages.
# Keep them outside the standalone graph until their dependencies export
# *Config.cmake files, or build them through a catkin workspace.
if(PNKX_NAV_CORE_BUILD_CATKIN_TEST_PACKAGES)
pnkx_add_test_package(deep_mpc_local_planner)
pnkx_add_test_package(nav_ros_bridge)
pnkx_add_test_package(depth_local_costmap_noetic_test)
endif()
# 2. Main packages (phụ thuộc vào cores)
# message(STATUS "[move_base] Shared library configured")
if (NOT TARGET move_base)
@@ -164,5 +241,3 @@ endif()
message(STATUS "========================================")
message(STATUS "All packages configured successfully")
message(STATUS "========================================")