Template Function husarion_ugv_utils::test_utils::WaitForMsg

Function Documentation

template<typename NodeT, typename MsgT>
bool husarion_ugv_utils::test_utils::WaitForMsg(const std::shared_ptr<NodeT> &node, std::shared_ptr<MsgT> &msg, const std::chrono::milliseconds &timeout)

Wait for ROS message to arrive.

Parameters:
  • node – ROS node that will be spun

  • msg – Reference to the message, it should point to a variable, that will be overwritten by subscriber callback

  • timeout – timeout to wait for message to arrive

Returns:

True if message was received, false if timeout was reached