Using shapeshifter MessageEvent and boost bind together to pass arguments to callback
I'm trying to add a parameter to a callback for a subscriber that I don't know the type or topic name at compile time. I've failed to get it to compile saying that there is not a matching function for the call to subscribe. I've simplified the example to below and am trying to figure out what's going on. In the end, I need to pass the topic name as a string to the callback. Anyone have any ideas?
class Class1
{
private:
ros::NodeHandle node_;
void MemberCallback(const ros::MessageEvent<topic_tools::ShapeShifter>& msg_event)
{
...
}
public:
Class1()
{
node_.subscribe("test", 10, boost::bind(&Class1::MemberCallback, this, _1));
}
};