ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

pay attention to

/home/feixiao/catkin_ws/src/ratslam-ratslam_ros/src/main_lv.cpp:142:119:   required from here
    /usr/include/boost/bind/bind.hpp:313:34: error: could not convert ‘(& a)->boost::_bi::list1<A1>::operator[]<const boost::shared_ptr<const uhf_rfid_api::UhfRfid_<std::allocator<void> > >&>(boost::_bi::storage1<boost::arg<I> >::a1_<1>)’ from ‘const boost::shared_ptr<const uhf_rfid_api::UhfRfid_<std::allocator<void> > >’ to ‘uhf_rfid_api::UhfRfid_<std::allocator<void> >’

change your callback function to

void rfid_callback( const uhf_rfid_api::UhfRfid::ConstPtr& rfid, ros::Publisher *pub_vt)
{
   do something;
}

when you declare your subscriber and publisher

ros::NodeHandle node;
ros::Publisher pub_vt = node.advertise<ratslam_ros::ViewTemplate>(topic_root + "/LocalView/Template", 0);
ros::Subscriber sub = node.subscribe<uhf_rfid_api::UhfRfid>("messageepc", 0, boost::bind(&rfid_callback, _1, &pub_vt));