implicit change of message type on callback function
Hello,
I have a custom cpp class that works well outside of ROS. Now, I would like to use one of the methods in this class as the callback function for a ros::Subscriber. However, to leave the class untouched and the method generic, I'll need some type conversion from the topic's message type to the method's argument type. Say, from std_msgs::String::ConstPtr to std::string.
Is it possible to do this implicitly during the subscriber declaration? If so, how?
Thanks in advance for any help.
robotchicken is right. The way to do this is with a wrapper function or class. This is a limitation of the C++ language itself and not ROS.