Skip to content

Commit f968fbe

Browse files
[ros_python_interpreter] Add the possibility to get the callback_group of reentrant type.
1 parent baa5b68 commit f968fbe

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

include/dynamic_graph_bridge/ros_python_interpreter_server.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ class RosPythonInterpreterServer {
8585
/**
8686
* @brief start_ros_service advertize the "run_python_command" and
8787
* "run_python_scripts" ros services
88+
* @param qos: Quality of Service
89+
* @param callback_group: Callback group
8890
*/
89-
void start_ros_service();
91+
void start_ros_service(const rclcpp::QoS& qos = rclcpp::ServicesQoS(),
92+
rclcpp::CallbackGroup::SharedPtr group = nullptr);
9093

9194
protected:
9295
/**

src/ros_python_interpreter_server.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ RosPythonInterpreterServer::RosPythonInterpreterServer()
2525

2626
RosPythonInterpreterServer::~RosPythonInterpreterServer() {}
2727

28-
void RosPythonInterpreterServer::start_ros_service() {
28+
void RosPythonInterpreterServer::start_ros_service(
29+
const rclcpp::QoS& qos, rclcpp::CallbackGroup::SharedPtr group) {
2930
run_python_command_callback_t runCommandCb =
3031
std::bind(&RosPythonInterpreterServer::runCommandCallback, this,
3132
std::placeholders::_1, std::placeholders::_2);
3233
run_python_command_srv_ = ros_node_->create_service<RunPythonCommandSrvType>(
33-
"/dynamic_graph_bridge/run_python_command", runCommandCb);
34+
"/dynamic_graph_bridge/run_python_command", runCommandCb, qos, group);
3435
RCLCPP_INFO(
3536
rclcpp::get_logger("dynamic_graph_bridge"),
3637
"RosPythonInterpreterServer::start_ros_service - run_python_command...");
@@ -39,7 +40,7 @@ void RosPythonInterpreterServer::start_ros_service() {
3940
std::bind(&RosPythonInterpreterServer::runPythonFileCallback, this,
4041
std::placeholders::_1, std::placeholders::_2);
4142
run_python_file_srv_ = ros_node_->create_service<RunPythonFileSrvType>(
42-
"/dynamic_graph_bridge/run_python_file", runPythonFileCb);
43+
"/dynamic_graph_bridge/run_python_file", runPythonFileCb, qos, group);
4344

4445
RCLCPP_INFO(
4546
rclcpp::get_logger("dynamic_graph_bridge"),

0 commit comments

Comments
 (0)