can we pass publisher as an argument in a function (ros2)?
I am using 3-5 publisher in my code implementation and I want to pass it as a argument but it is giving error related to type.
ERROR:-
‘rclcpp::Publisher’ is not a type
static inline void handlePacket(const Packet *packet , rclcpp::Publisher &pub_fix)
^
I would quite like to know this too! I have ros code that was passing "ros::Publisher & markerPublisher" as an argument and I'm trying to migrate it to ros2
i have the same problem, did you fix this ?