Attention: Answers.ros.org is deprecated as of August the 11th, 2023. Please visit robotics.stackexchange.com to ask a new question. This site will remain online in read-only mode during the transition and into the foreseeable future. Selected questions and answers have been migrated, and redirects have been put in place to direct users to the corresponding questions on Robotics Stack Exchange. Additional details are available here.
/home/sharan/catkin_ws/src/zlab_drone/src/videoFeedListener.cpp: In constructor ‘ImageConverter::ImageConverter()’:
/home/sharan/catkin_ws/src/zlab_drone/src/videoFeedListener.cpp:67:46: error: no matching function for call to ‘ros::NodeHandle::advertise(const char [9], int)’
circle_pub_ = nh_.advertise("/circles", 1);
Code
class ImageConverter {
ros::NodeHandle nh_;
image_transport::ImageTransport it_;
image_transport::Subscriber image_sub_;
image_transport::Publisher image_pub_;
ros::Publisher circle_pub_;
public:
ImageConverter()
: it_(nh_)
{
// Subscribe to the Bottom Raw Image
image_sub_ = it_.subscribe("/ardrone/bottom/image_raw", 1,
&ImageConverter::imageCb, this);
// Advertisng the Circles being detected from this
circle_pub_ = nh_.advertise("/circles", 1);
cv::namedWindow(OPENCV_WINDOW1);
}