File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
ros_babel_fish/src/detail Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 3
3
//
4
4
5
5
#include " ros_babel_fish/detail/topic.hpp"
6
+ #include " ../logging.hpp"
6
7
7
8
#include < rclcpp/graph_listener.hpp>
8
9
#include < rclcpp/node.hpp>
9
10
#include < rclcpp/wait_set.hpp>
10
11
12
+ using namespace std ::chrono_literals;
13
+
11
14
namespace ros_babel_fish
12
15
{
13
16
namespace impl
@@ -68,6 +71,12 @@ bool wait_for_topic_and_type_nanoseconds( rclcpp::Node &node, const std::string
68
71
if ( timeout > std::chrono::nanoseconds ( 0 ) ) {
69
72
time_to_wait = timeout - ( std::chrono::steady_clock::now () - start );
70
73
}
74
+ if ( std::chrono::steady_clock::now () - start > 3s ) {
75
+ RBF2_WARN_THROTTLE (
76
+ *node.get_clock (), 3000 ,
77
+ " Still waiting for topic '%s' to appear (timeout=%ld). Are you spinning the node?" ,
78
+ topic.c_str (), timeout.count () );
79
+ }
71
80
} while ( time_to_wait > std::chrono::nanoseconds ( 0 ) );
72
81
return false ; // timeout exceeded while waiting for the topic
73
82
}
You can’t perform that action at this time.
0 commit comments