0

Rosanswers logo

Error

/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);

}


Originally posted by sharan100 on ROS Answers with karma: 83 on 2017-02-22

Post score: 0

1 Answers1

0

Rosanswers logo

What's the message type that you are publishing on topic /circles?

ros::Publisher pub = handle.advertise<std_msgs::Empty>("my_topic", 1);
                                      ~~~~~~~~~~~~~~~   You are missing this part

Originally posted by huanxiner with karma: 271 on 2017-02-22

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by sharan100 on 2017-02-23:
Yes, this works!