From 8be83aef62e1636f82e68c79b316608986ab3e98 Mon Sep 17 00:00:00 2001 From: Sergi Hernandez Juan <shernand@iri.upc.edu> Date: Thu, 27 Jan 2022 11:14:48 +0100 Subject: [PATCH] Change used Empty.srv package from roscpp to std_srvs --- CMakeLists.txt | 6 +++--- README.md | 4 ++-- include/looming_modbus_driver_node.h | 4 ++-- package.xml | 2 +- src/looming_modbus_driver_node.cpp | 9 +++------ 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34853ed..1d8c8eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ find_package(catkin REQUIRED) # ******************************************************************** # Add catkin additional components here # ******************************************************************** -find_package(catkin REQUIRED COMPONENTS iri_base_driver moby_msgs roscpp move_base_msgs actionlib tf2) +find_package(catkin REQUIRED COMPONENTS iri_base_driver moby_msgs std_srvs move_base_msgs actionlib tf2) ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) @@ -63,7 +63,7 @@ catkin_package( # ******************************************************************** # Add ROS and IRI ROS run time dependencies # ******************************************************************** - CATKIN_DEPENDS iri_base_driver moby_msgs roscpp move_base_msgs actionlib tf2 + CATKIN_DEPENDS iri_base_driver moby_msgs std_srvs move_base_msgs actionlib tf2 # ******************************************************************** # Add system and labrobotica run time dependencies here # ******************************************************************** @@ -102,7 +102,7 @@ target_link_libraries(${PROJECT_NAME} ${iriutils_LIBRARIES}) # ******************************************************************** # add_dependencies(${PROJECT_NAME} <msg_package_name>_generate_messages_cpp) add_dependencies(${PROJECT_NAME} moby_msgs_generate_messages_cpp) -add_dependencies(${PROJECT_NAME} roscpp_generate_messages_cpp) +add_dependencies(${PROJECT_NAME} std_srvs_generate_messages_cpp) add_dependencies(${PROJECT_NAME} mbf_msgs_generate_messages_cpp) add_dependencies(${PROJECT_NAME} iri_base_driver_generate_messages_cpp) add_dependencies(${PROJECT_NAME}_gencfg iri_base_driver_generate_messages_py) diff --git a/README.md b/README.md index f3db8f5..55d9486 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The looming_modbus project description # ROS Interface ### Service clients - ~**mode_change** (moby_msgs/ModeChange.srv) - - ~**clear_costmaps** (roscpp/Empty.srv) + - ~**clear_costmaps** (std_srvs/Empty.srv) ### Action clients - ~**move_base** (mbf_msgs/MoveBase.action) @@ -48,4 +48,4 @@ This package is distributed in the hope that it will be useful, but without any In no event unless required by applicable law the author will be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if the author has been advised of the possibility of such damages. -You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/> \ No newline at end of file +You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/> diff --git a/include/looming_modbus_driver_node.h b/include/looming_modbus_driver_node.h index 960af72..ce814d1 100644 --- a/include/looming_modbus_driver_node.h +++ b/include/looming_modbus_driver_node.h @@ -32,7 +32,7 @@ // [service client headers] #include <moby_msgs/ModeChange.h> -#include <roscpp/Empty.h> +#include <std_srvs/Empty.h> // [action server client headers] #include <actionlib/client/simple_action_client.h> @@ -70,7 +70,7 @@ class LoomingModbusDriverNode : public iri_base_driver::IriBaseNodeDriver<Loomin moby_msgs::ModeChange mode_change_srv_; ros::ServiceClient clear_costmaps_client_; - roscpp::Empty clear_costmaps_srv_; + std_srvs::Empty clear_costmaps_srv_; // [action server attributes] diff --git a/package.xml b/package.xml index 42eed8b..702e8d5 100644 --- a/package.xml +++ b/package.xml @@ -53,7 +53,7 @@ <build_export_depend>iri_base_driver</build_export_depend> <exec_depend>iri_base_driver</exec_depend> <depend>moby_msgs</depend> - <depend>roscpp</depend> + <depend>std_srvs</depend> <depend>move_base_msgs</depend> <depend>actionlib</depend> <depend>tf2</depend> diff --git a/src/looming_modbus_driver_node.cpp b/src/looming_modbus_driver_node.cpp index b4df69a..3116818 100644 --- a/src/looming_modbus_driver_node.cpp +++ b/src/looming_modbus_driver_node.cpp @@ -21,7 +21,7 @@ LoomingModbusDriverNode::LoomingModbusDriverNode(ros::NodeHandle &nh) : // [init clients] mode_change_client_ = this->private_node_handle_.serviceClient<moby_msgs::ModeChange>("mode_change"); - clear_costmaps_client_ = this->private_node_handle_.serviceClient<roscpp::Empty>("clear_costmaps"); + clear_costmaps_client_ = this->private_node_handle_.serviceClient<std_srvs::Empty>("clear_costmaps"); // [init action servers] @@ -41,10 +41,7 @@ void LoomingModbusDriverNode::mainNodeThread(void) // [fill srv structure and make request to the server] - - // [fill action structure and make request to the action server] - //// variable to hold the state of the current goal on the server actionlib::SimpleClientGoalState move_base_state(actionlib::SimpleClientGoalState::PENDING); // to get the state of the current goal this->driver_.unlock(); @@ -210,8 +207,8 @@ bool LoomingModbusDriverNode::move_baseMakeActionRequest() // ok=false; return false; } - // this->driver_.lock(); - return ok; + // this->driver_.lock(); + return ok; } -- GitLab