File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
include/dynamic_graph_bridge Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,11 @@ typedef std_srvs::srv::Empty EmptyServiceType;
67
67
*/
68
68
RosNodePtr get_ros_node (std::string node_name);
69
69
70
+
71
+ size_t ros_executor_get_nb_threads ();
72
+
73
+ void ros_display_list_of_nodes ();
74
+
70
75
/* *
71
76
* @brief Add a ros node to the global executor.
72
77
*
Original file line number Diff line number Diff line change @@ -131,6 +131,13 @@ class Executor {
131
131
}
132
132
}
133
133
134
+ /* *
135
+ * @brief Return the number of threads
136
+ */
137
+ size_t get_number_of_threads () {
138
+ return ros_executor_.get_number_of_threads ();
139
+ }
140
+
134
141
private:
135
142
/* *
136
143
* @brief Thread callback function
@@ -204,6 +211,7 @@ std::string executable_name() {
204
211
#endif
205
212
}
206
213
214
+
207
215
/* *
208
216
* @brief Private function that allow us to initialize ROS only once.
209
217
*/
@@ -273,6 +281,23 @@ void ros_shutdown() {
273
281
// rclcpp::shutdown();
274
282
}
275
283
284
+ size_t ros_executor_get_nb_threads () {
285
+ return get_ros_executor ()->get_number_of_threads ();
286
+ }
287
+
288
+ void ros_display_list_of_nodes () {
289
+ GlobalListOfRosNodeType::iterator ros_node_it =
290
+ GLOBAL_LIST_OF_ROS_NODE.begin ();
291
+ while (ros_node_it!=GLOBAL_LIST_OF_ROS_NODE.end ()) {
292
+ RCLCPP_INFO (rclcpp::get_logger (" dynamic_graph_bridge" ),
293
+ " ros_display_list_of_nodes: %s/%s" ,
294
+ ros_node_it->second ->get_namespace (),
295
+ ros_node_it->second ->get_name ());
296
+ ros_node_it++;
297
+ }
298
+
299
+ }
300
+
276
301
void ros_clean () {
277
302
ros_stop_spinning ();
278
303
GlobalListOfRosNodeType::iterator ros_node_it =
You can’t perform that action at this time.
0 commit comments