update for ROS

This commit is contained in:
HiepLM 2026-01-07 17:03:07 +07:00
parent ec6d5746e3
commit 76b563ad4d
5 changed files with 14 additions and 8 deletions

View File

@ -44,6 +44,7 @@ catkin_package(
geometry_msgs
loc_core
nav_2d_utils
robot_nav_2d_utils
move_base_core
robot_cpp
roscpp
@ -106,12 +107,12 @@ add_dependencies(${PROJECT_NAME}_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
# Fix circular RPATH dependency: disable automatic RPATH detection to avoid cycle warnings
# Libraries will be found via LD_LIBRARY_PATH or system paths
# Configure RPATH to find libraries in devel space
# Use ORIGIN to find libraries relative to executable location
set_target_properties(${PROJECT_NAME}_node PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH FALSE
INSTALL_RPATH_USE_LINK_PATH TRUE
BUILD_RPATH "${CATKIN_DEVEL_PREFIX}/lib"
)
# add_dependencies(vda_5050_api_test

View File

@ -74,7 +74,7 @@ namespace amr_control
bool initalized_;
ros::NodeHandle nh_;
std::shared_ptr<tf2_ros::Buffer> tf_;
// robot::TFListenerPtr tf_core_ptr_;
robot::TFListenerPtr tf_core_ptr_;
ros::Subscriber is_detected_maker_sub_;

View File

@ -3,6 +3,7 @@
#include <robot/plugin_loader_helper.h>
#include <robot/console.h>
#include <robot/node_handle.h>
#include <tf3/buffer_core.h>
namespace amr_control
{
@ -16,6 +17,7 @@ namespace amr_control
loc_base_ptr_(nullptr),
move_base_ptr_(nullptr),
amr_safety_ptr_(nullptr),
tf_core_ptr_(nullptr),
loc_base_loader_("loc_core", "loc_core::BaseLocalization")
{
this->init(nh, buffer);
@ -31,6 +33,7 @@ namespace amr_control
loc_base_ptr_(nullptr),
move_base_ptr_(nullptr),
amr_safety_ptr_(nullptr),
tf_core_ptr_(nullptr),
loc_base_loader_("loc_core", "loc_core::BaseLocalization")
{
}
@ -79,6 +82,8 @@ namespace amr_control
{
nh_ = nh;
tf_ = buffer;
// Create tf3::BufferCore instance for move_base
tf_core_ptr_ = std::make_shared<tf3::BufferCore>();
monitor_thr_ = std::make_shared<std::thread>(
[this]()
@ -231,7 +236,7 @@ namespace amr_control
robot::log_info("[%s:%d]\n Creating MoveBase instance...", __FILE__, __LINE__);
move_base_ptr_ = move_base_loader_();
// move_base_ptr_->initialize(tf_core_ptr_);
move_base_ptr_->initialize(tf_core_ptr_);
ros::Rate r(3);
do

View File

@ -21,7 +21,7 @@ int main(int argc, char** argv)
}
catch (const std::exception& exc)
{
std::cout << exc.what() << std::endl;
ROS_ERROR("Exception: %s", exc.what());
}
return 0;
}

@ -1 +1 @@
Subproject commit ca9e100bd91c94975480244be32e6ee0a3fd0f92
Subproject commit 6054f72ba85e8897b02e136c682a09ad3a79f5f9