How to create a mock publisher in ROS2 using gmock?

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

ali ekber celik gravatar image

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

Hello

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: https://docs.ros2.org/foxy/api/rclcpp...

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

Comments

Hey, I am trying to use gmock to mock some calls to rclcpp, something very similar to what you were doing. Did you solve this isue?

Bernat Gaston gravatar image Bernat Gaston  ( 2022-06-07 06:09:13 -0600 )edit