Compare commits
2 Commits
6ff54e4154
...
3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5583b3e0f2 | |||
| 7baa7000b8 |
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ extern "C" NavigationHandle navigation_create(void)
|
|||||||
// Using default constructor - initialization will be done via navigation_initialize()
|
// Using default constructor - initialization will be done via navigation_initialize()
|
||||||
robot::PluginLoaderHelper loader;
|
robot::PluginLoaderHelper loader;
|
||||||
std::string path_file_so = loader.findLibraryPath("MoveBase");
|
std::string path_file_so = loader.findLibraryPath("MoveBase");
|
||||||
|
robot::log_warning("%s", path_file_so.c_str());
|
||||||
auto move_base_loader = boost::dll::import_alias<robot::move_base_core::BaseNavigation::Ptr()>(
|
auto move_base_loader = boost::dll::import_alias<robot::move_base_core::BaseNavigation::Ptr()>(
|
||||||
path_file_so, "MoveBase", boost::dll::load_mode::append_decorations);
|
path_file_so, "MoveBase", boost::dll::load_mode::append_decorations);
|
||||||
auto move_base_ptr = move_base_loader();
|
auto move_base_ptr = move_base_loader();
|
||||||
|
|||||||
@@ -398,7 +398,6 @@ robot_nav_2d_msgs::Twist2DStamped pnkx_local_planner::PNKXDockingLocalPlanner::S
|
|||||||
else if (!ret_nav_)
|
else if (!ret_nav_)
|
||||||
{
|
{
|
||||||
traj = nav_algorithm_->calculator(pose, velocity);
|
traj = nav_algorithm_->calculator(pose, velocity);
|
||||||
|
|
||||||
if (!dkpl_.empty() && dkpl_.front()->initialized_ && dkpl_.front()->is_detected_ && !dkpl_.front()->is_goal_reached_)
|
if (!dkpl_.empty() && dkpl_.front()->initialized_ && dkpl_.front()->is_detected_ && !dkpl_.front()->is_goal_reached_)
|
||||||
{
|
{
|
||||||
if (dkpl_.front()->docking_nav_ && !dkpl_.front()->docking_planner_)
|
if (dkpl_.front()->docking_nav_ && !dkpl_.front()->docking_planner_)
|
||||||
@@ -406,9 +405,17 @@ robot_nav_2d_msgs::Twist2DStamped pnkx_local_planner::PNKXDockingLocalPlanner::S
|
|||||||
traj = dkpl_.front()->docking_nav_->calculator(pose, velocity);
|
traj = dkpl_.front()->docking_nav_->calculator(pose, velocity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
local_plan_.header.stamp = robot::Time::now();
|
||||||
|
robot_nav_msgs::Path path = robot_nav_2d_utils::poses2DToPath(traj.poses, costmap_robot_->getBaseFrameID(), robot::Time::now());
|
||||||
|
local_plan_ = robot_nav_2d_utils::pathToPath(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
traj = rotate_algorithm_->calculator(pose, velocity);
|
traj = rotate_algorithm_->calculator(pose, velocity);
|
||||||
|
local_plan_.header.stamp = robot::Time::now();
|
||||||
|
robot_nav_msgs::Path path = robot_nav_2d_utils::poses2DToPath(traj.poses, costmap_robot_->getBaseFrameID(), robot::Time::now());
|
||||||
|
local_plan_ = robot_nav_2d_utils::pathToPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
cmd_vel.velocity = traj.velocity;
|
cmd_vel.velocity = traj.velocity;
|
||||||
return cmd_vel;
|
return cmd_vel;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* @brief Resolve library path (handle relative paths, search in search_paths)
|
* @brief Resolve library path (absolute, then PNKX_NAV_CORE_LIBRARY_PATH, search_paths_, cwd)
|
||||||
* @param library_path Path from config (may be relative or absolute)
|
* @param library_path Path from config (may be relative or absolute)
|
||||||
* @return Resolved absolute path, or empty if not found
|
* @return Resolved absolute path, or empty if not found
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ std::string PluginLoaderHelper::findLibraryPath(const std::string& symbol_name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try LD_LIBRARY_PATH as fallback
|
// Try LD_LIBRARY_PATH as fallback
|
||||||
const char* ld_path = std::getenv("LD_LIBRARY_PATH");
|
const char* ld_path = std::getenv("LD_LIBRARY_PATH");
|
||||||
if (ld_path) {
|
if (ld_path) {
|
||||||
@@ -199,16 +198,21 @@ std::string PluginLoaderHelper::resolveLibraryPath(const std::string& library_pa
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If relative path, search in search_paths (build directory is already added)
|
// If relative path, search under PNKX_NAV_CORE_LIBRARY_PATH (':'-separated, like LD_LIBRARY_PATH)
|
||||||
std::string build_dir = getBuildDirectory();
|
const char* nav_lib_path_env = std::getenv("PNKX_NAV_CORE_LIBRARY_PATH");
|
||||||
if (!build_dir.empty()) {
|
if (nav_lib_path_env) {
|
||||||
// First try in build directory
|
|
||||||
// Add .so extension if not present
|
|
||||||
std::string lib_path_with_ext = library_path;
|
std::string lib_path_with_ext = library_path;
|
||||||
if (lib_path_with_ext.find(".so") == std::string::npos) {
|
if (lib_path_with_ext.find(".so") == std::string::npos) {
|
||||||
lib_path_with_ext += ".so";
|
lib_path_with_ext += ".so";
|
||||||
}
|
}
|
||||||
std::filesystem::path full_path = std::filesystem::path(build_dir) / lib_path_with_ext;
|
std::string nav_lib_paths(nav_lib_path_env);
|
||||||
|
std::stringstream ss(nav_lib_paths);
|
||||||
|
std::string base_dir;
|
||||||
|
while (std::getline(ss, base_dir, ':')) {
|
||||||
|
if (base_dir.empty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
std::filesystem::path full_path = std::filesystem::path(base_dir) / lib_path_with_ext;
|
||||||
if (std::filesystem::exists(full_path)) {
|
if (std::filesystem::exists(full_path)) {
|
||||||
try {
|
try {
|
||||||
return std::filesystem::canonical(full_path).string();
|
return std::filesystem::canonical(full_path).string();
|
||||||
@@ -217,6 +221,7 @@ std::string PluginLoaderHelper::resolveLibraryPath(const std::string& library_pa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Try in search_paths
|
// Try in search_paths
|
||||||
for (const auto& base_path : search_paths_) {
|
for (const auto& base_path : search_paths_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user