How to create a mock publisher in ROS2 using gmock?

asked 2021-08-26 16:21:09 -0500

ali ekber celik gravatar image

updated 2021-08-27 00:06:59 -0500


I would like to create a mock publisher for my ROS2 publisher unit tests. But apparently, there is no pure virtual Publisher interface class in rclcpp that I can implement in order to create a mock publisher:

Whereas I am able to create a mock node by implementing rclcpp::node_interfaces::NodeBaseInterface class.

Is there a way to create a mock publisher in ROS2?

Thanks in advance.

edit retag flag offensive close merge delete