Template Function rtest::findPublisher(const std::shared_ptr<NodeT>, const std::string&)

Function Documentation

template<typename MessageT, typename NodeT>
std::shared_ptr<PublisherMock<MessageT>> rtest::findPublisher(const std::shared_ptr<NodeT> nodePtr, const std::string &topicName)

Convenience function for getting publisher object for given Node and Topic name.

Template Parameters:
  • MessageT – Type of the ROS 2 message for the topic

  • NodeT – Type of the ROS 2 Node

Parameters:
  • nodePtr – shared_ptr to the Node

  • topicName – Topic name

Returns:

std::shared_ptr<rclcpp::Publisher<MessageT>>