update 6/1

This commit is contained in:
2026-01-06 08:53:27 +07:00
parent b2b48d1fce
commit 7cea6bb120
4 changed files with 25 additions and 23 deletions

View File

@@ -1,5 +1,8 @@
#include "amr_control/amr_control.h"
#include <geometry_msgs/Vector3.h>
#include <robot/plugin_loader_helper.h>
#include <robot/console.h>
#include <robot/node_handle.h>
namespace amr_control
{
@@ -219,15 +222,15 @@ namespace amr_control
throw std::runtime_error("tf2_ros::Buffer object is null");
try
{
// robot::log_info("[%s:%d]\n Loading MoveBase library...", __FILE__, __LINE__);
// robot::PluginLoaderHelper loader;
// std::string path_file_so = loader.findLibraryPath("MoveBase");
// move_base_loader_ = boost::dll::import_alias<robot::move_base_core::BaseNavigation::Ptr()>(
// path_file_so,
// "MoveBase", boost::dll::load_mode::append_decorations);
robot::log_info("[%s:%d]\n Loading MoveBase library...", __FILE__, __LINE__);
robot::PluginLoaderHelper loader;
std::string path_file_so = loader.findLibraryPath("MoveBase");
move_base_loader_ = boost::dll::import_alias<robot::move_base_core::BaseNavigation::Ptr()>(
path_file_so,
"MoveBase", boost::dll::load_mode::append_decorations);
// robot::log_info("[%s:%d]\n Creating MoveBase instance...", __FILE__, __LINE__);
// move_base_ptr_ = create_plugin();
robot::log_info("[%s:%d]\n Creating MoveBase instance...", __FILE__, __LINE__);
move_base_ptr_ = move_base_loader_();
// move_base_ptr_->initialize(tf_core_ptr_);
// ros::Rate r(3);
@@ -250,12 +253,12 @@ namespace amr_control
}
catch (const std::exception &e)
{
// robot::log_error("[%s:%d]\n Exception: %s", __FILE__, __LINE__, e.what());
robot::log_error("[%s:%d]\n Exception: %s", __FILE__, __LINE__, e.what());
exit(1);
}
catch (...)
{
// robot::log_error("[%s:%d]\n Unknown exception occurred", __FILE__, __LINE__);
robot::log_error("[%s:%d]\n Unknown exception occurred", __FILE__, __LINE__);
exit(1);
}
}