This commit is contained in:
2025-12-30 15:46:20 +07:00
parent 7b27905ad4
commit dc652575d1
69 changed files with 3834 additions and 22719 deletions

View File

@@ -1,42 +0,0 @@
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2017, Locus Robotics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LOC_CORE_COMMON_H_INCLUDED_
#define _LOC_CORE_COMMON_H_INCLUDED_
#include <tf2_ros/buffer.h>
#include <memory>
using TFListenerPtr = std::shared_ptr<tf2_ros::Buffer>;
#endif // _LOC_CORE_COMMON_H_INCLUDED_

View File

@@ -6,7 +6,7 @@
#include <memory>
#include <geometry_msgs/PoseStamped.h>
#include <geometry_msgs/Pose2D.h>
#include <loc_core/common.h>
// #include <loc_core/common.h>
namespace loc_core
{
@@ -39,7 +39,7 @@ namespace loc_core
* @param nh A Node handle
*
*/
virtual void initialize(ros::NodeHandle nh, TFListenerPtr tf) = 0;
virtual void initialize(ros::NodeHandle nh, std::shared_ptr<tf2_ros::Buffer> tf) = 0;
/**
* @brief Loading a Activate Map File name

View File

@@ -1,6 +1,13 @@
cmake_minimum_required(VERSION 3.0.2)
project(map_server)
# Suppress RPATH cycle warnings by disabling automatic RPATH detection
# We'll set RPATH explicitly for each target
set(CMAKE_SKIP_RPATH FALSE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
find_package(catkin REQUIRED
COMPONENTS
roscpp
@@ -56,6 +63,13 @@ target_link_libraries(map_server_image_loader
${SDL_IMAGE_LIBRARIES}
${YAMLCPP_LIBRARIES}
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(map_server_image_loader PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_library(map_server_lib src/map_server.cpp)
add_dependencies(map_server_lib map_server_image_loader ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
@@ -67,6 +81,13 @@ target_link_libraries(map_server_lib
${SDL_IMAGE_LIBRARIES}
${YAMLCPP_LIBRARIES}
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(map_server_lib PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_library (map_generator_lib src/map_generator.cpp)
add_dependencies(map_generator_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
@@ -85,6 +106,13 @@ target_link_libraries(map_server
${YAMLCPP_LIBRARIES}
${catkin_LIBRARIES}
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(map_server PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_executable(map_server-map_saver src/map_saver.cpp)
add_dependencies(map_server-map_saver map_generator_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
@@ -114,6 +142,13 @@ if(CATKIN_ENABLE_TESTING)
${SDL_LIBRARY}
${SDL_IMAGE_LIBRARIES}
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(${PROJECT_NAME}_utest PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
find_package(roslib REQUIRED)
include_directories(${roslib_INCLUDE_DIRS})

View File

@@ -154,6 +154,13 @@ target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
yaml-cpp
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(${PROJECT_NAME} PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
@@ -173,6 +180,13 @@ add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catk
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(${PROJECT_NAME}_node PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
#############
## Install ##

View File

@@ -29,7 +29,7 @@ namespace loc_base
* @param nh A Node handle
* @param tf A poiter tranform listen
*/
void initialize(ros::NodeHandle nh, TFListenerPtr tf) override;
void initialize(ros::NodeHandle nh, std::shared_ptr<tf2_ros::Buffer> tf) override;
/**
* @brief Loading a Activate Map File name
@@ -147,7 +147,7 @@ namespace loc_base
ros::NodeHandle nh_;
ros::NodeHandle private_nh_;
ros::Publisher init_pub_;
static TFListenerPtr tf_;
static std::shared_ptr<tf2_ros::Buffer> tf_;
XmlRpc::XmlRpcValue plugins_;
// std::map<std::string, std::string> map_file_vt_;

View File

@@ -8,7 +8,7 @@
std::shared_ptr<amcl::Amcl> loc_base::LocBase::localization_althm_ = nullptr;
std::shared_ptr<slam_toolbox::AsynchronousSlamToolbox> loc_base::LocBase::mapping_althm_ = nullptr;
TFListenerPtr loc_base::LocBase::tf_;
std::shared_ptr<tf2_ros::Buffer> loc_base::LocBase::tf_;
std::string loc_base::LocBase::base_frame_id_;
std::string loc_base::LocBase::global_frame_id_;
std::string* loc_base::LocBase::working_dir_ptr_ = NULL;
@@ -38,7 +38,7 @@ void loc_base::LocBase::cleanup() {
loc_base::LocBase::mapping_althm_.reset();
}
void loc_base::LocBase::initialize(ros::NodeHandle nh, TFListenerPtr tf)
void loc_base::LocBase::initialize(ros::NodeHandle nh, std::shared_ptr<tf2_ros::Buffer> tf)
{
if (!initialized_)
{

View File

@@ -98,39 +98,116 @@ target_link_libraries(ceres_solver_plugin ${catkin_LIBRARIES}
${Boost_LIBRARIES}
${TBB_LIBRARIES}
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(ceres_solver_plugin PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
#### Tool lib for mapping
add_library(toolbox_common src/slam_toolbox_common.cpp src/map_saver.cpp src/loop_closure_assistant.cpp src/laser_utils.cpp src/slam_mapper.cpp)
target_link_libraries(toolbox_common kartoSlamToolbox ${catkin_LIBRARIES} ${Boost_LIBRARIES})
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(toolbox_common PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
#### Mapping executibles
add_library(async_slam_toolbox src/slam_toolbox_async.cpp)
add_dependencies(async_slam_toolbox ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(async_slam_toolbox toolbox_common kartoSlamToolbox ${catkin_LIBRARIES} ${Boost_LIBRARIES})
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(async_slam_toolbox PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_executable(async_slam_toolbox_node src/slam_toolbox_async_node.cpp )
target_link_libraries(async_slam_toolbox_node async_slam_toolbox)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(async_slam_toolbox_node PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_library(sync_slam_toolbox src/slam_toolbox_sync.cpp)
add_dependencies(sync_slam_toolbox ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(sync_slam_toolbox toolbox_common kartoSlamToolbox ${catkin_LIBRARIES} ${Boost_LIBRARIES})
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(sync_slam_toolbox PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_executable(sync_slam_toolbox_node src/slam_toolbox_sync_node.cpp )
target_link_libraries(sync_slam_toolbox_node sync_slam_toolbox)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(sync_slam_toolbox_node PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_library(localization_slam_toolbox src/slam_toolbox_localization.cpp)
add_dependencies(localization_slam_toolbox ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(localization_slam_toolbox toolbox_common kartoSlamToolbox ${catkin_LIBRARIES} ${Boost_LIBRARIES})
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(localization_slam_toolbox PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_executable(localization_slam_toolbox_node src/slam_toolbox_localization_node.cpp )
target_link_libraries(localization_slam_toolbox_node localization_slam_toolbox)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(localization_slam_toolbox_node PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_library(lifelong_slam_toolbox src/experimental/slam_toolbox_lifelong.cpp)
add_dependencies(lifelong_slam_toolbox ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(lifelong_slam_toolbox toolbox_common kartoSlamToolbox ${catkin_LIBRARIES} ${Boost_LIBRARIES})
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(lifelong_slam_toolbox PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
add_executable(lifelong_slam_toolbox_node src/experimental/slam_toolbox_lifelong_node.cpp )
target_link_libraries(lifelong_slam_toolbox_node lifelong_slam_toolbox)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(lifelong_slam_toolbox_node PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
#### Merging maps tool
add_executable(merge_maps_kinematic src/merge_maps_kinematic.cpp)
target_link_libraries(merge_maps_kinematic toolbox_common)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
set_target_properties(merge_maps_kinematic PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
)
#### testing
#if(CATKIN_ENABLE_TESTING)