Commit e0d3baa3 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Replaced image_transport subscribers with normal image subscriber, as camera_info is not used

parent cc7f29a2
......@@ -69,16 +69,20 @@ class ColorCalibrationAlgNode : public algorithm_base::IriBaseAlgorithm<ColorCal
void blobs_mutex_exit(void);
std::vector<TBlob> blobs;
image_transport::CameraSubscriber segmented_image_subscriber_;
void segmented_image_callback(const sensor_msgs::Image::ConstPtr& msg,const sensor_msgs::CameraInfoConstPtr& info);
//image_transport::CameraSubscriber segmented_image_subscriber_;
ros::Subscriber segmented_img_subscriber_;
//void segmented_image_callback(const sensor_msgs::Image::ConstPtr& msg,const sensor_msgs::CameraInfoConstPtr& info);
void segmented_image_callback(const sensor_msgs::Image::ConstPtr& msg);
pthread_mutex_t segmented_image_mutex_;
void segmented_image_mutex_enter(void);
void segmented_image_mutex_exit(void);
sensor_msgs::Image segmented_image;
bool segmented_image_received;
image_transport::CameraSubscriber original_image_subscriber_;
void original_image_callback(const sensor_msgs::Image::ConstPtr& msg,const sensor_msgs::CameraInfoConstPtr& info);
//image_transport::CameraSubscriber original_image_subscriber_;
ros::Subscriber original_img_subscriber_;
//void original_image_callback(const sensor_msgs::Image::ConstPtr& msg,const sensor_msgs::CameraInfoConstPtr& info);
void original_image_callback(const sensor_msgs::Image::ConstPtr& msg);
pthread_mutex_t original_image_mutex_;
void original_image_mutex_enter(void);
void original_image_mutex_exit(void);
......
......@@ -17,10 +17,12 @@ ColorCalibrationAlgNode::ColorCalibrationAlgNode(MainGui *gui) :
this->blobs_subscriber_ = this->public_node_handle_.subscribe("blobs", 1, &ColorCalibrationAlgNode::blobs_callback, this);
pthread_mutex_init(&this->blobs_mutex_,NULL);
this->segmented_image_subscriber_ = this->it.subscribeCamera("segmented_image/image_raw", 1, &ColorCalibrationAlgNode::segmented_image_callback, this);
//this->segmented_image_subscriber_ = this->it.subscribeCamera("segmented_image/image_raw", 1, &ColorCalibrationAlgNode::segmented_image_callback, this);
this->segmented_img_subscriber_ = this->public_node_handle_.subscribe("segmented_image/image_raw", 1, &ColorCalibrationAlgNode::segmented_image_callback, this);
pthread_mutex_init(&this->segmented_image_mutex_,NULL);
this->original_image_subscriber_ = this->it.subscribeCamera("original_image/image_raw", 1, &ColorCalibrationAlgNode::original_image_callback, this);
//this->original_image_subscriber_ = this->it.subscribeCamera("original_image/image_raw", 1, &ColorCalibrationAlgNode::original_image_callback, this);
this->original_img_subscriber_ = this->public_node_handle_.subscribe("original_image/image_raw", 1, &ColorCalibrationAlgNode::original_image_callback, this);
pthread_mutex_init(&this->original_image_mutex_,NULL);
this->original_image_received=false;
this->segmented_image_received=false;
......@@ -92,7 +94,8 @@ void ColorCalibrationAlgNode::blobs_mutex_exit(void)
pthread_mutex_unlock(&this->blobs_mutex_);
}
void ColorCalibrationAlgNode::segmented_image_callback(const sensor_msgs::Image::ConstPtr& msg, const sensor_msgs::CameraInfoConstPtr& info)
//void ColorCalibrationAlgNode::segmented_image_callback(const sensor_msgs::Image::ConstPtr& msg, const sensor_msgs::CameraInfoConstPtr& info)
void ColorCalibrationAlgNode::segmented_image_callback(const sensor_msgs::Image::ConstPtr& msg)
{
//use appropiate mutex to shared variables if necessary
//this->alg_.lock();
......@@ -119,7 +122,8 @@ void ColorCalibrationAlgNode::segmented_image_mutex_exit(void)
pthread_mutex_unlock(&this->segmented_image_mutex_);
}
void ColorCalibrationAlgNode::original_image_callback(const sensor_msgs::Image::ConstPtr& msg, const sensor_msgs::CameraInfoConstPtr& info)
//void ColorCalibrationAlgNode::original_image_callback(const sensor_msgs::Image::ConstPtr& msg, const sensor_msgs::CameraInfoConstPtr& info)
void ColorCalibrationAlgNode::original_image_callback(const sensor_msgs::Image::ConstPtr& msg)
{
//use appropiate mutex to shared variables if necessary
//this->alg_.lock();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment