From 749cb050c4be0a6e21c797851402108f08d57484 Mon Sep 17 00:00:00 2001 From: mingxi Date: Fri, 17 May 2024 10:13:44 -0400 Subject: [PATCH] fixed small issue --- include/mvp_control/dictionary.h | 2 +- src/mvp_control/mvp_control_ros.cpp | 11 ++++++++--- src/mvp_control/mvp_control_ros.h | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/mvp_control/dictionary.h b/include/mvp_control/dictionary.h index 02ae308..4391271 100644 --- a/include/mvp_control/dictionary.h +++ b/include/mvp_control/dictionary.h @@ -85,7 +85,7 @@ namespace ctrl { static constexpr const char * SERVICE_CONTROL_ENABLE = "controller/enable"; static constexpr const char * SERVICE_CONTROL_DISABLE = "controller/disable"; - static constexpr const char * SERVICE_GET_CONTROLLER_STATE = "controller/state"; + static constexpr const char * SERVICE_GET_CONTROLLER_STATE = "controller/get_state"; static constexpr const char * SERVICE_GET_CONTROL_MODES = "controller/get_modes"; static constexpr const char * SERVICE_SET_CONTROL_POINT = "controller/set_point"; static constexpr const char * SERVICE_GET_ACTIVE_MODE = "controller/active_mode"; diff --git a/src/mvp_control/mvp_control_ros.cpp b/src/mvp_control/mvp_control_ros.cpp index 08ec104..5e65f8e 100644 --- a/src/mvp_control/mvp_control_ros.cpp +++ b/src/mvp_control/mvp_control_ros.cpp @@ -1191,9 +1191,14 @@ bool MvpControlROS::f_cb_srv_disable( bool MvpControlROS::f_cb_srv_get_controller_state( - std_srvs::Trigger::Request req, std_srvs::Trigger::Response res) { - res.success = true; - res.message = m_enabled ? "enabled" : "disabled"; + std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &resp) { + resp.success = true; + if(m_enabled){ + resp.message = "enabled"; + } + else{ + resp.message = "disabled"; + } return true; } diff --git a/src/mvp_control/mvp_control_ros.h b/src/mvp_control/mvp_control_ros.h index b250b11..d296675 100644 --- a/src/mvp_control/mvp_control_ros.h +++ b/src/mvp_control/mvp_control_ros.h @@ -353,8 +353,8 @@ namespace ctrl { * @return false */ bool f_cb_srv_get_controller_state( - std_srvs::Trigger::Request req, - std_srvs::Trigger::Response resp); + std_srvs::Trigger::Request &req, + std_srvs::Trigger::Response &resp); /** * @brief Get active control mode