Skip to content
Snippets Groups Projects
Commit f968fbed authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[ros_python_interpreter] Add the possibility to get the callback_group of reentrant type.

parent baa5b68a
No related branches found
No related tags found
No related merge requests found
......@@ -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:
/**
......
......@@ -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"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment