From 1ae1dd2f2f5417c9346406715d8a4367ec83fc4f Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Wed, 13 Aug 2014 10:57:23 -0700 Subject: [PATCH] add message when actually received data --- rclcpp/include/rclcpp/executor/SingleThreadExecutor.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rclcpp/include/rclcpp/executor/SingleThreadExecutor.h b/rclcpp/include/rclcpp/executor/SingleThreadExecutor.h index f4accc1..a2f25fb 100644 --- a/rclcpp/include/rclcpp/executor/SingleThreadExecutor.h +++ b/rclcpp/include/rclcpp/executor/SingleThreadExecutor.h @@ -81,7 +81,11 @@ public: // Do callback std::cout << "Callback for subscriber of topic: " << subscriber->topic_name_ << std::endl; const void *ros_msg = 0; - ros_middleware_interface::take(subscriber->subscriber_handle_, ros_msg); + bool taken = ros_middleware_interface::take(subscriber->subscriber_handle_, ros_msg); + if (taken) + { + std::cout << "- received message on topic: " << subscriber->topic_name_ << std::endl; + } } } }