Template Function husarion_ugv_utils::test_utils::PublishAndSpin

Function Documentation

template<typename MsgT>
void husarion_ugv_utils::test_utils::PublishAndSpin(const rclcpp::Node::SharedPtr &node, const std::string &topic_name, MsgT &msg, const rclcpp::QoS qos_profile = rclcpp::SystemDefaultsQoS())

Creates publisher for given message type, publishes the message, and spins the ROS node.

Parameters:
  • node – ROS node that will be spun

  • topic_name – The name of the topic for which publisher will be created

  • msg – ROS message that will be published

  • qos_profile – The QoS profile of the publisher

Returns:

True if message was received, false if timeout was reached