Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Sending multiple topics to a function

I'm trying to send multiple topics to a function:

 void CostMapCallBack(const nav_msgs::OccupancyGrid &msg, const geometry_msgs::Twist &msg_speed)

To send the values of the topics, I created 2 subscribers:

 Sub_CostMap = n.subscribe("move_base/local_costmap/costmap", 2, &CostMapCallBack);
 Sub_vel = n.subscribe("cmd_vel", 2, &CostMapCallBack);

However, when I compile, I get this error:

 no matching function for call to ‘ros::NodeHandle::subscribe(const char [8], int, void (*)(const OccupancyGrid&, const Twist&))’

Is there a way to send multiple topics to a function?