ERROR: Advertise a service already advertised in this node
Folks,
I am subscribing to a compressed image published (or republished) by image_proc (it takes my rgb_raw, and publishes rectified rgb and mono images, including compressed versions). But when I subscribe to the compressed images (rgb or mono), I get these messages:
[ERROR] [1479358743.735774954]: Tried to advertise a service that is already advertised in this node [/v_control_node/compressed/set_parameters]
This is my subscriber:
camera_track_sub_ = it_.subscribeCamera("/camera/rgb/image_rect", 2,
&MyNodeClass::ImageCb, this,
image_transport::TransportHints("compressed"));
// I assume TransportHints converts "/camera/rgb/image_rect" to "/camera/rgb/image_rect/compressed"
I have ROS indigo, and Ubuntu 14.04.
How do you subscribe?
#include <sensor_msgs compressedimage.h="">
// inside my class
ros::NodeHandle nh_;
image_transport::ImageTransport it_;
image_transport::CameraSubscriber camera_track_sub_; /**< subscriber for the camera info and the image info. */
// Then, on my class as well
public:
MyNodeClass(int32_t id)
: it_(nh_), id_(id)
Please edit your question. And you only show the declaration for the subscriber, but no use of it.
camera_track_sub_ = it_.subscribeCamera("/camera/rgb/image_rect", 2,
&MyNodeClass::ImageCb, this,
image_transport::TransportHints("compressed"));
// I assume TransportHints converts "/camera/rgb/image_rect" to "/camera/rgb/image_rect/compressed"
After the subscriber is enabled, the callback grabs that rectified mono image message, cv_bridge converts it into sensor_msgs::image_encodings::MONO8, then I to my analysis. I don't re-publish the image at all.
Can you please add the code to the question? It's hard to read it in several parts in the comments.
I found the error problem. See answer below. Print Statements helped me see it