Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Create service get_current_navigator" #19

Open
wants to merge 1 commit into
base: humble
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions nav2_bt_navigator/include/nav2_bt_navigator/bt_navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "tf2_ros/transform_listener.h"
#include "tf2_ros/create_timer_ros.h"
#include "nav2_core/behavior_tree_navigator.hpp"
#include "nav2_msgs/srv/get_string.hpp"
#include "pluginlib/class_loader.hpp"

namespace nav2_bt_navigator
Expand Down Expand Up @@ -86,9 +85,6 @@ class BtNavigator : public nav2_util::LifecycleNode
*/
nav2_util::CallbackReturn on_shutdown(const rclcpp_lifecycle::State & state) override;

void get_navigator_callback(const nav2_msgs::srv::GetString::Request::SharedPtr req,
const nav2_msgs::srv::GetString::Response::SharedPtr res);

// To handle all the BT related execution
pluginlib::ClassLoader<nav2_core::NavigatorBase> class_loader_;
std::vector<pluginlib::UniquePtr<nav2_core::NavigatorBase>> navigators_;
Expand All @@ -106,9 +102,6 @@ class BtNavigator : public nav2_util::LifecycleNode
// Spinning transform that can be used by the node
std::shared_ptr<tf2_ros::Buffer> tf_;
std::shared_ptr<tf2_ros::TransformListener> tf_listener_;

// Service to query current navigator
rclcpp::Service<nav2_msgs::srv::GetString>::SharedPtr get_navigator_srv_;
};

} // namespace nav2_bt_navigator
Expand Down
13 changes: 0 additions & 13 deletions nav2_bt_navigator/src/bt_navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ BtNavigator::on_configure(const rclcpp_lifecycle::State & /*state*/)
}
}

get_navigator_srv_ = create_service<nav2_msgs::srv::GetString>(
std::string(get_name()) + "/get_current_navigator",
std::bind(&BtNavigator::get_navigator_callback, this,
std::placeholders::_1, std::placeholders::_2));

return nav2_util::CallbackReturn::SUCCESS;
}

Expand Down Expand Up @@ -241,14 +236,6 @@ BtNavigator::on_shutdown(const rclcpp_lifecycle::State & /*state*/)
return nav2_util::CallbackReturn::SUCCESS;
}

void
BtNavigator::get_navigator_callback(const nav2_msgs::srv::GetString::Request::SharedPtr,
const nav2_msgs::srv::GetString::Response::SharedPtr res)
{
res->data = plugin_muxer_.getCurrentNavigator();
res->success = true;
}

} // namespace nav2_bt_navigator

#include "rclcpp_components/register_node_macro.hpp"
Expand Down
10 changes: 0 additions & 10 deletions nav2_core/include/nav2_core/behavior_tree_navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ class NavigatorMuxer
NavigatorMuxer()
: current_navigator_(std::string("")) {}

/**
* @brief Get the name of the navigator currently in use
* @return string Name of the navigator, empty if not navigating
*/
std::string getCurrentNavigator()
{
std::scoped_lock l(mutex_);
return current_navigator_;
}

/**
* @brief Get the navigator muxer state
* @return bool If a navigator is in progress
Expand Down
1 change: 0 additions & 1 deletion nav2_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ rosidl_generate_interfaces(${PROJECT_NAME}
"srv/ClearCostmapAroundRobot.srv"
"srv/ClearEntireCostmap.srv"
"srv/ManageLifecycleNodes.srv"
"srv/GetString.srv"
"srv/LoadMap.srv"
"srv/SaveMap.srv"
"srv/SetInitialPose.srv"
Expand Down
3 changes: 0 additions & 3 deletions nav2_msgs/srv/GetString.srv

This file was deleted.