diff --git a/include/dynamic_graph_bridge/ros_python_interpreter_server.hpp b/include/dynamic_graph_bridge/ros_python_interpreter_server.hpp index 48f6f851ce020f7838f916e01335d0ed0a468423..a3985496521a35a6b6745597e4ce56c0ca4fb3e4 100644 --- a/include/dynamic_graph_bridge/ros_python_interpreter_server.hpp +++ b/include/dynamic_graph_bridge/ros_python_interpreter_server.hpp @@ -85,8 +85,11 @@ class RosPythonInterpreterServer { /** * @brief start_ros_service advertize the "run_python_command" and * "run_python_scripts" ros services + * @param qos: Quality of Service + * @param callback_group: Callback group */ - void start_ros_service(); + void start_ros_service(const rclcpp::QoS& qos = rclcpp::ServicesQoS(), + rclcpp::CallbackGroup::SharedPtr group = nullptr); protected: /** diff --git a/src/ros_python_interpreter_server.cpp b/src/ros_python_interpreter_server.cpp index ce92f7d2a2908bec87920cbd5f1093b6e5261d9c..272e5d46f6eea1096dbf4dd7a71c04a168f3b458 100644 --- a/src/ros_python_interpreter_server.cpp +++ b/src/ros_python_interpreter_server.cpp @@ -25,12 +25,13 @@ RosPythonInterpreterServer::RosPythonInterpreterServer() RosPythonInterpreterServer::~RosPythonInterpreterServer() {} -void RosPythonInterpreterServer::start_ros_service() { +void RosPythonInterpreterServer::start_ros_service( + const rclcpp::QoS& qos, rclcpp::CallbackGroup::SharedPtr group) { run_python_command_callback_t runCommandCb = std::bind(&RosPythonInterpreterServer::runCommandCallback, this, std::placeholders::_1, std::placeholders::_2); run_python_command_srv_ = ros_node_->create_service<RunPythonCommandSrvType>( - "/dynamic_graph_bridge/run_python_command", runCommandCb); + "/dynamic_graph_bridge/run_python_command", runCommandCb, qos, group); RCLCPP_INFO( rclcpp::get_logger("dynamic_graph_bridge"), "RosPythonInterpreterServer::start_ros_service - run_python_command..."); @@ -39,7 +40,7 @@ void RosPythonInterpreterServer::start_ros_service() { std::bind(&RosPythonInterpreterServer::runPythonFileCallback, this, std::placeholders::_1, std::placeholders::_2); run_python_file_srv_ = ros_node_->create_service<RunPythonFileSrvType>( - "/dynamic_graph_bridge/run_python_file", runPythonFileCb); + "/dynamic_graph_bridge/run_python_file", runPythonFileCb, qos, group); RCLCPP_INFO( rclcpp::get_logger("dynamic_graph_bridge"),