diff --git a/nav2_amcl/CMakeLists.txt b/nav2_amcl/CMakeLists.txt index 916e5240889..be83000bd4c 100644 --- a/nav2_amcl/CMakeLists.txt +++ b/nav2_amcl/CMakeLists.txt @@ -22,6 +22,9 @@ include_directories( include ) +include(CheckSymbolExists) +check_symbol_exists(drand48 stdlib.h HAVE_DRAND48) + add_subdirectory(src/pf) add_subdirectory(src/map) add_subdirectory(src/motion_model) @@ -39,6 +42,11 @@ add_library(${library_name} SHARED src/amcl_node.cpp ) +target_include_directories(${library_name} PRIVATE src/include) +if(HAVE_DRAND48) + target_compile_definitions(${library_name} PRIVATE "HAVE_DRAND48") +endif() + set(dependencies rclcpp rclcpp_lifecycle @@ -70,9 +78,13 @@ target_link_libraries(${library_name} map_lib motions_lib sensors_lib ) -install(TARGETS ${executable_name} ${library_name} +install(TARGETS ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS ${executable_name} RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_amcl/src/amcl_node.cpp b/nav2_amcl/src/amcl_node.cpp index cc99e323ff2..fd17347dc07 100644 --- a/nav2_amcl/src/amcl_node.cpp +++ b/nav2_amcl/src/amcl_node.cpp @@ -48,6 +48,8 @@ #include "tf2/utils.h" #pragma GCC diagnostic pop +#include "portable_utils.h" + using namespace std::placeholders; using namespace std::chrono_literals; diff --git a/nav2_amcl/src/include/portable_utils.h b/nav2_amcl/src/include/portable_utils.h new file mode 100644 index 00000000000..1577e6875b1 --- /dev/null +++ b/nav2_amcl/src/include/portable_utils.h @@ -0,0 +1,28 @@ +#ifndef PORTABLE_UTILS_H +#define PORTABLE_UTILS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef HAVE_DRAND48 +// Some system (e.g., Windows) doesn't come with drand48(), srand48(). +// Use rand, and srand for such system. +static double drand48(void) +{ + return ((double)rand()) / RAND_MAX; +} + +static void srand48(long int seedval) +{ + srand(seedval); +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/nav2_amcl/src/map/CMakeLists.txt b/nav2_amcl/src/map/CMakeLists.txt index 7017eb494ad..602629f9fd8 100644 --- a/nav2_amcl/src/map/CMakeLists.txt +++ b/nav2_amcl/src/map/CMakeLists.txt @@ -10,5 +10,5 @@ install(TARGETS map_lib ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) diff --git a/nav2_amcl/src/motion_model/CMakeLists.txt b/nav2_amcl/src/motion_model/CMakeLists.txt index 88ed7c70e5b..6322ad98702 100644 --- a/nav2_amcl/src/motion_model/CMakeLists.txt +++ b/nav2_amcl/src/motion_model/CMakeLists.txt @@ -12,5 +12,5 @@ install(TARGETS motions_lib ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) diff --git a/nav2_amcl/src/pf/CMakeLists.txt b/nav2_amcl/src/pf/CMakeLists.txt index b277cc93786..c6f16e6a7dc 100644 --- a/nav2_amcl/src/pf/CMakeLists.txt +++ b/nav2_amcl/src/pf/CMakeLists.txt @@ -11,9 +11,14 @@ add_library(pf_lib SHARED pf_draw.c ) +target_include_directories(pf_lib PRIVATE ../include) +if(HAVE_DRAND48) + target_compile_definitions(pf_lib PRIVATE "HAVE_DRAND48") +endif() + install(TARGETS pf_lib ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) diff --git a/nav2_amcl/src/pf/eig3.c b/nav2_amcl/src/pf/eig3.c index 8b290c8abc0..a87354dbc8b 100644 --- a/nav2_amcl/src/pf/eig3.c +++ b/nav2_amcl/src/pf/eig3.c @@ -7,8 +7,11 @@ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif -// #define n 3 -static const int n = 3; +#ifdef _MSC_VER +#define n 3 +#else +static int n = 3; +#endif static double hypot2(double x, double y) { diff --git a/nav2_amcl/src/pf/pf.c b/nav2_amcl/src/pf/pf.c index 664fd44a135..851e63b64e2 100644 --- a/nav2_amcl/src/pf/pf.c +++ b/nav2_amcl/src/pf/pf.c @@ -35,6 +35,8 @@ #include "nav2_amcl/pf/pf_pdf.hpp" #include "nav2_amcl/pf/pf_kdtree.hpp" +#include "portable_utils.h" + // Compute the required number of samples, given that there are k bins // with samples in them. diff --git a/nav2_amcl/src/pf/pf_pdf.c b/nav2_amcl/src/pf/pf_pdf.c index b6a1d13cdab..858bea7df88 100644 --- a/nav2_amcl/src/pf/pf_pdf.c +++ b/nav2_amcl/src/pf/pf_pdf.c @@ -34,6 +34,8 @@ #include "nav2_amcl/pf/pf_pdf.hpp" +#include "portable_utils.h" + // Random number generator seed value static unsigned int pf_pdf_seed; diff --git a/nav2_amcl/src/pf/pf_vector.c b/nav2_amcl/src/pf/pf_vector.c index a38c4e9994f..29e183749e8 100644 --- a/nav2_amcl/src/pf/pf_vector.c +++ b/nav2_amcl/src/pf/pf_vector.c @@ -53,7 +53,7 @@ int pf_vector_finite(pf_vector_t a) int i; for (i = 0; i < 3; i++) { - if (!finite(a.v[i])) { + if (!isfinite(a.v[i])) { return 0; } } @@ -152,7 +152,7 @@ int pf_matrix_finite(pf_matrix_t a) for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { - if (!finite(a.m[i][j])) { + if (!isfinite(a.m[i][j])) { return 0; } } diff --git a/nav2_amcl/src/sensors/CMakeLists.txt b/nav2_amcl/src/sensors/CMakeLists.txt index 56c3a382bf7..e105675cbf4 100644 --- a/nav2_amcl/src/sensors/CMakeLists.txt +++ b/nav2_amcl/src/sensors/CMakeLists.txt @@ -4,11 +4,12 @@ add_library(sensors_lib SHARED laser/likelihood_field_model.cpp laser/likelihood_field_model_prob.cpp ) -target_link_libraries(sensors_lib pf_lib) +# map_update_cspace +target_link_libraries(sensors_lib pf_lib map_lib) install(TARGETS sensors_lib ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) diff --git a/nav2_amcl/src/sensors/laser/laser.cpp b/nav2_amcl/src/sensors/laser/laser.cpp index b19e83607d3..9059179874d 100644 --- a/nav2_amcl/src/sensors/laser/laser.cpp +++ b/nav2_amcl/src/sensors/laser/laser.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include "nav2_amcl/sensors/laser/laser.hpp" diff --git a/nav2_behavior_tree/CMakeLists.txt b/nav2_behavior_tree/CMakeLists.txt index 117c2629d5e..a2d70feb289 100644 --- a/nav2_behavior_tree/CMakeLists.txt +++ b/nav2_behavior_tree/CMakeLists.txt @@ -110,7 +110,7 @@ install(TARGETS ${library_name} ${plugin_libs} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ diff --git a/nav2_bt_navigator/CMakeLists.txt b/nav2_bt_navigator/CMakeLists.txt index 3f56c116a1e..da362c91068 100644 --- a/nav2_bt_navigator/CMakeLists.txt +++ b/nav2_bt_navigator/CMakeLists.txt @@ -60,9 +60,13 @@ ament_target_dependencies(${library_name} ${dependencies} ) -install(TARGETS ${executable_name} ${library_name} +install(TARGETS ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS ${executable_name} RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_bt_navigator/src/ros_topic_logger.cpp b/nav2_bt_navigator/src/ros_topic_logger.cpp index 192318d2f76..472b30d323b 100644 --- a/nav2_bt_navigator/src/ros_topic_logger.cpp +++ b/nav2_bt_navigator/src/ros_topic_logger.cpp @@ -39,8 +39,12 @@ void RosTopicLogger::callback( // BT timestamps are a duration since the epoch. Need to convert to a time_point // before converting to a msg. +#ifndef _WIN32 event.timestamp = tf2_ros::toMsg(std::chrono::time_point(timestamp)); +#else + event.timestamp = tf2_ros::toMsg(timestamp); +#endif event.node_name = node.name(); event.previous_status = toStr(prev_status, false); event.current_status = toStr(status, false); diff --git a/nav2_common/cmake/nav2_package.cmake b/nav2_common/cmake/nav2_package.cmake index 61dd187cfeb..ee8555f799f 100644 --- a/nav2_common/cmake/nav2_package.cmake +++ b/nav2_common/cmake/nav2_package.cmake @@ -42,4 +42,16 @@ macro(nav2_package) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") endif() + + # Defaults for Microsoft C++ compiler + if(MSVC) + # https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/ + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # Enable Math Constants + # https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=vs-2019 + add_compile_definitions( + _USE_MATH_DEFINES + ) + endif() endmacro() diff --git a/nav2_controller/CMakeLists.txt b/nav2_controller/CMakeLists.txt index 90dc9fd172d..b4cb1b50d03 100644 --- a/nav2_controller/CMakeLists.txt +++ b/nav2_controller/CMakeLists.txt @@ -59,9 +59,13 @@ ament_target_dependencies(${executable_name} target_link_libraries(${executable_name} ${library_name}) -install(TARGETS ${executable_name} ${library_name} +install(TARGETS ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS ${executable_name} RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_controller/src/nav2_controller.cpp b/nav2_controller/src/nav2_controller.cpp index ef7798137e2..11dc15e670b 100644 --- a/nav2_controller/src/nav2_controller.cpp +++ b/nav2_controller/src/nav2_controller.cpp @@ -88,7 +88,7 @@ ControllerServer::on_configure(const rclcpp_lifecycle::State & state) exit(-1); } - for (uint i = 0; i != controller_types_.size(); i++) { + for (size_t i = 0; i != controller_types_.size(); i++) { try { nav2_core::Controller::Ptr controller = lp_loader_.createUniqueInstance(controller_types_[i]); @@ -105,7 +105,7 @@ ControllerServer::on_configure(const rclcpp_lifecycle::State & state) } } - for (uint i = 0; i != controller_ids_.size(); i++) { + for (size_t i = 0; i != controller_ids_.size(); i++) { controller_ids_concat_ += controller_ids_[i] + std::string(" "); } diff --git a/nav2_costmap_2d/CMakeLists.txt b/nav2_costmap_2d/CMakeLists.txt index abd70ac4619..8f3262b8a69 100644 --- a/nav2_costmap_2d/CMakeLists.txt +++ b/nav2_costmap_2d/CMakeLists.txt @@ -131,13 +131,17 @@ target_link_libraries(nav2_costmap_2d install(TARGETS nav2_costmap_2d_core - nav2_costmap_2d layers nav2_costmap_2d_client - nav2_costmap_2d_markers - nav2_costmap_2d_cloud ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS + nav2_costmap_2d + nav2_costmap_2d_markers + nav2_costmap_2d_cloud RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_dwb_controller/costmap_queue/CMakeLists.txt b/nav2_dwb_controller/costmap_queue/CMakeLists.txt index 489e73fa7b1..4641d0b5471 100644 --- a/nav2_dwb_controller/costmap_queue/CMakeLists.txt +++ b/nav2_dwb_controller/costmap_queue/CMakeLists.txt @@ -45,7 +45,7 @@ endif() install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ DESTINATION include/ diff --git a/nav2_dwb_controller/dwb_core/CMakeLists.txt b/nav2_dwb_controller/dwb_core/CMakeLists.txt index cec51d5f9b2..3b58ccfeb32 100644 --- a/nav2_dwb_controller/dwb_core/CMakeLists.txt +++ b/nav2_dwb_controller/dwb_core/CMakeLists.txt @@ -58,7 +58,7 @@ ament_target_dependencies(dwb_core install(TARGETS dwb_core ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ diff --git a/nav2_dwb_controller/dwb_critics/CMakeLists.txt b/nav2_dwb_controller/dwb_critics/CMakeLists.txt index b892eb7d289..7b7cb8c70d3 100644 --- a/nav2_dwb_controller/dwb_critics/CMakeLists.txt +++ b/nav2_dwb_controller/dwb_critics/CMakeLists.txt @@ -60,7 +60,7 @@ ament_target_dependencies(${PROJECT_NAME} install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ DESTINATION include/ diff --git a/nav2_dwb_controller/dwb_plugins/CMakeLists.txt b/nav2_dwb_controller/dwb_plugins/CMakeLists.txt index 64348944b5f..ea4d7868eaa 100644 --- a/nav2_dwb_controller/dwb_plugins/CMakeLists.txt +++ b/nav2_dwb_controller/dwb_plugins/CMakeLists.txt @@ -63,7 +63,7 @@ endif() install(TARGETS simple_goal_checker stopped_goal_checker standard_traj_generator ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ DESTINATION include/ diff --git a/nav2_dwb_controller/nav_2d_utils/CMakeLists.txt b/nav2_dwb_controller/nav_2d_utils/CMakeLists.txt index 6dbe3d3019e..06bb2a5a193 100644 --- a/nav2_dwb_controller/nav_2d_utils/CMakeLists.txt +++ b/nav2_dwb_controller/nav_2d_utils/CMakeLists.txt @@ -46,7 +46,7 @@ ament_target_dependencies(path_ops install(TARGETS conversions path_ops ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ DESTINATION include/ diff --git a/nav2_lifecycle_manager/CMakeLists.txt b/nav2_lifecycle_manager/CMakeLists.txt index c68e636f29a..b349a921b9f 100644 --- a/nav2_lifecycle_manager/CMakeLists.txt +++ b/nav2_lifecycle_manager/CMakeLists.txt @@ -57,10 +57,14 @@ ament_target_dependencies(lifecycle_manager ) install(TARGETS - lifecycle_manager ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS + lifecycle_manager RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_map_server/CMakeLists.txt b/nav2_map_server/CMakeLists.txt index a8ba50e6c05..92437424863 100644 --- a/nav2_map_server/CMakeLists.txt +++ b/nav2_map_server/CMakeLists.txt @@ -88,6 +88,11 @@ target_link_libraries(${library_name} target_link_libraries(${map_server_executable} ${library_name}) +if(WIN32) + target_compile_definitions(${map_server_executable} PRIVATE + YAML_CPP_DLL) +endif() + target_link_libraries(${map_saver_cli_executable} ${library_name}) @@ -100,10 +105,19 @@ target_include_directories(${map_io_library_name} SYSTEM PRIVATE target_link_libraries(${map_io_library_name} ${GRAPHICSMAGICKCPP_LIBRARIES}) -install(TARGETS ${map_server_executable} ${library_name} ${map_io_library_name} - ${map_saver_cli_executable} ${map_saver_server_executable} +if(WIN32) + target_compile_definitions(${map_io_library_name} PRIVATE + YAML_CPP_DLL) +endif() + +install(TARGETS + ${library_name} ${map_io_library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) + +install(TARGETS + ${map_server_executable} ${map_saver_cli_executable} ${map_saver_server_executable} RUNTIME DESTINATION lib/${PROJECT_NAME}) install(DIRECTORY include/ diff --git a/nav2_map_server/cmake_modules/FindGRAPHICSMAGICKCPP.cmake b/nav2_map_server/cmake_modules/FindGRAPHICSMAGICKCPP.cmake index 37a2fbfb74d..c04356b4aa8 100644 --- a/nav2_map_server/cmake_modules/FindGRAPHICSMAGICKCPP.cmake +++ b/nav2_map_server/cmake_modules/FindGRAPHICSMAGICKCPP.cmake @@ -26,9 +26,9 @@ find_path(GRAPHICSMAGICKCPP_INCLUDE_DIRS PATH_SUFFIXES GraphicsMagick) find_library(GRAPHICSMAGICKCPP_LIBRARIES - NAMES "GraphicsMagick++") + NAMES "GraphicsMagick++" "graphicsmagick") find_package_handle_standard_args( GRAPHICSMAGICKCPP - GRAPHICSMAGICKCPP__LIBRARIES + GRAPHICSMAGICKCPP_LIBRARIES GRAPHICSMAGICKCPP_INCLUDE_DIRS) \ No newline at end of file diff --git a/nav2_map_server/src/map_io.cpp b/nav2_map_server/src/map_io.cpp index 3179a46df67..6941b354fe7 100644 --- a/nav2_map_server/src/map_io.cpp +++ b/nav2_map_server/src/map_io.cpp @@ -31,7 +31,9 @@ #include "nav2_map_server/map_io.hpp" +#ifndef _WIN32 #include +#endif #include #include #include @@ -45,6 +47,44 @@ #include "tf2/LinearMath/Matrix3x3.h" #include "tf2/LinearMath/Quaternion.h" +#ifdef _WIN32 +// https://github.com/rtv/Stage/blob/master/replace/dirname.c +static +char * dirname(char * path) +{ + static const char dot[] = "."; + char * last_slash; + + if (path == NULL) { + return path; + } + + /* Find last '/'. */ + last_slash = path != NULL ? strrchr(path, '/') : NULL; + + if (last_slash != NULL && last_slash == path) { + /* The last slash is the first character in the string. We have to + return "/". */ + ++last_slash; + } else if (last_slash != NULL && last_slash[1] == '\0') { + /* The '/' is the last character, we have to look further. */ + last_slash = reinterpret_cast(memchr(path, last_slash - path, '/')); + } + + if (last_slash != NULL) { + /* Terminate the path. */ + last_slash[0] = '\0'; + } else { + /* This assignment is ill-designed but the XPG specs require to + return a string containing "." in any case no directory part is + found and so a static and constant string is required. */ + path = reinterpret_cast(dot); + } + + return path; +} +#endif + namespace nav2_map_server { using nav2_util::geometry_utils::orientationAroundZAxis; diff --git a/nav2_navfn_planner/CMakeLists.txt b/nav2_navfn_planner/CMakeLists.txt index 1315b65ed5a..ab4815b016d 100644 --- a/nav2_navfn_planner/CMakeLists.txt +++ b/nav2_navfn_planner/CMakeLists.txt @@ -60,7 +60,7 @@ pluginlib_export_plugin_description_file(nav2_core global_planner_plugin.xml) install(TARGETS ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ diff --git a/nav2_planner/CMakeLists.txt b/nav2_planner/CMakeLists.txt index 4012f40b9dd..69f4d571567 100644 --- a/nav2_planner/CMakeLists.txt +++ b/nav2_planner/CMakeLists.txt @@ -67,9 +67,13 @@ ament_target_dependencies(${executable_name} # prevent pluginlib from using boost target_compile_definitions(${library_name} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") -install(TARGETS ${executable_name} ${library_name} +install(TARGETS ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS ${executable_name} RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_planner/src/planner_server.cpp b/nav2_planner/src/planner_server.cpp index 97d33b33fe2..dbb159d730f 100644 --- a/nav2_planner/src/planner_server.cpp +++ b/nav2_planner/src/planner_server.cpp @@ -90,7 +90,7 @@ PlannerServer::on_configure(const rclcpp_lifecycle::State & state) exit(-1); } - for (uint i = 0; i != plugin_types_.size(); i++) { + for (size_t i = 0; i != plugin_types_.size(); i++) { try { nav2_core::GlobalPlanner::Ptr planner = gp_loader_.createUniqueInstance(plugin_types_[i]); @@ -107,7 +107,7 @@ PlannerServer::on_configure(const rclcpp_lifecycle::State & state) } } - for (uint i = 0; i != plugin_types_.size(); i++) { + for (size_t i = 0; i != plugin_types_.size(); i++) { planner_ids_concat_ += plugin_ids_[i] + std::string(" "); } diff --git a/nav2_recoveries/CMakeLists.txt b/nav2_recoveries/CMakeLists.txt index 6b0def011ed..01849b8c119 100644 --- a/nav2_recoveries/CMakeLists.txt +++ b/nav2_recoveries/CMakeLists.txt @@ -103,13 +103,17 @@ ament_target_dependencies(${executable_name} ${dependencies} ) -install(TARGETS ${executable_name} - ${library_name} + +install(TARGETS ${library_name} nav2_backup_recovery nav2_spin_recovery nav2_wait_recovery ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS ${executable_name} RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_recoveries/src/recovery_server.cpp b/nav2_recoveries/src/recovery_server.cpp index a4caa363d88..ecd23d4481f 100644 --- a/nav2_recoveries/src/recovery_server.cpp +++ b/nav2_recoveries/src/recovery_server.cpp @@ -88,7 +88,7 @@ RecoveryServer::loadRecoveryPlugins() { auto node = shared_from_this(); - for (uint i = 0; i != plugin_names_.size(); i++) { + for (size_t i = 0; i != plugin_names_.size(); i++) { try { RCLCPP_INFO( get_logger(), "Creating recovery plugin %s of type %s", diff --git a/nav2_system_tests/src/planning/planner_tester.hpp b/nav2_system_tests/src/planning/planner_tester.hpp index 6a411050e7f..2e47a84be5c 100644 --- a/nav2_system_tests/src/planning/planner_tester.hpp +++ b/nav2_system_tests/src/planning/planner_tester.hpp @@ -50,7 +50,7 @@ class NavFnPlannerTester : public nav2_planner::PlannerServer void printCostmap() { // print costmap for debug - for (uint i = 0; i != costmap_->getSizeInCellsX() * costmap_->getSizeInCellsY(); i++) { + for (size_t i = 0; i != costmap_->getSizeInCellsX() * costmap_->getSizeInCellsY(); i++) { if (i % costmap_->getSizeInCellsX() == 0) { std::cout << "" << std::endl; } diff --git a/nav2_util/src/CMakeLists.txt b/nav2_util/src/CMakeLists.txt index ec62f855677..bd903ef6d19 100644 --- a/nav2_util/src/CMakeLists.txt +++ b/nav2_util/src/CMakeLists.txt @@ -37,9 +37,13 @@ target_link_libraries(dump_params ${Boost_PROGRAM_OPTIONS_LIBRARY}) install(TARGETS ${library_name} - lifecycle_bringup - dump_params ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS + lifecycle_bringup + dump_params RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_util/src/dump_params.cpp b/nav2_util/src/dump_params.cpp index b47c6815b75..34672f2b210 100644 --- a/nav2_util/src/dump_params.cpp +++ b/nav2_util/src/dump_params.cpp @@ -388,6 +388,14 @@ validate( boost::any_cast &>(v).values.swap(result); } +#ifdef _WIN32 +static const char * basename(const char * filepath) +{ + const char * base = std::strrchr(filepath, '/'); + return base ? (base + 1) : filepath; +} +#endif + int main(int argc, char * argv[]) { rclcpp::init(argc, argv); diff --git a/nav2_voxel_grid/CMakeLists.txt b/nav2_voxel_grid/CMakeLists.txt index fe5d7fe753a..4b88a87d86a 100644 --- a/nav2_voxel_grid/CMakeLists.txt +++ b/nav2_voxel_grid/CMakeLists.txt @@ -25,7 +25,7 @@ ament_target_dependencies(voxel_grid install(TARGETS voxel_grid ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} + RUNTIME DESTINATION bin ) install(DIRECTORY include/ diff --git a/nav2_voxel_grid/src/voxel_grid.cpp b/nav2_voxel_grid/src/voxel_grid.cpp index 4eca35f317d..c41bc40533c 100644 --- a/nav2_voxel_grid/src/voxel_grid.cpp +++ b/nav2_voxel_grid/src/voxel_grid.cpp @@ -35,7 +35,6 @@ * Author: Eitan Marder-Eppstein *********************************************************************/ #include -#include namespace nav2_voxel_grid { diff --git a/nav2_waypoint_follower/CMakeLists.txt b/nav2_waypoint_follower/CMakeLists.txt index d7b54602619..71925e74b50 100644 --- a/nav2_waypoint_follower/CMakeLists.txt +++ b/nav2_waypoint_follower/CMakeLists.txt @@ -49,9 +49,13 @@ ament_target_dependencies(${library_name} ${dependencies} ) -install(TARGETS ${executable_name} ${library_name} +install(TARGETS ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS ${executable_name} RUNTIME DESTINATION lib/${PROJECT_NAME} ) diff --git a/nav2_waypoint_follower/src/waypoint_follower.cpp b/nav2_waypoint_follower/src/waypoint_follower.cpp index 978ecb834c0..dd08a89d599 100644 --- a/nav2_waypoint_follower/src/waypoint_follower.cpp +++ b/nav2_waypoint_follower/src/waypoint_follower.cpp @@ -126,7 +126,7 @@ WaypointFollower::followWaypoints() static_cast(goal->poses.size())); rclcpp::Rate r(loop_rate_); - uint goal_index = 0; + uint32_t goal_index = 0; bool new_goal = true; while (rclcpp::ok()) {