47 DiagnosticNodelet::onInit();
54 srv_ = boost::make_shared<dynamic_reconfigure::Server<Config> >(*pnh_);
55 dynamic_reconfigure::Server<Config>::CallbackType
f =
58 pub_histogram_ = advertise<jsk_recognition_msgs::ColorHistogramArray>(*
pnh_,
"output", 1);
59 pub_indices_ = advertise<jsk_recognition_msgs::ClusterPointIndices>(*
pnh_,
"output/indices", 1);
84 sync_ = boost::make_shared<message_filters::Synchronizer<SyncPolicy> >(
queue_size_);
97 const jsk_recognition_msgs::ClusterPointIndices::ConstPtr &input_indices)
107 for (
size_t i = 0; i < input_histogram->histograms.size(); ++i) {
108 if (input_histogram->histograms[i].histogram.size() != size) {
114 jsk_recognition_msgs::ColorHistogramArray out_hist;
115 jsk_recognition_msgs::ClusterPointIndices out_indices;
117 out_hist.header = input_histogram->header;
118 out_indices.header = input_indices->header;
121 for (
size_t i = 0; i < input_histogram->histograms.size(); ++i) {
128 NODELET_DEBUG(
"#%lu: %f (%s)", i, distance, ok ?
"OK" :
"NG");
130 out_hist.histograms.push_back(input_histogram->histograms[i]);
131 out_indices.cluster_indices.push_back(input_indices->cluster_indices[i]);
message_filters::Subscriber< jsk_recognition_msgs::ClusterPointIndices > sub_indices_
void publish(const boost::shared_ptr< M > &message) const
bool compareHistogram(const std::vector< float > &input, const std::vector< float > &reference, const ComparePolicy policy, double &distance)
virtual void reference(const jsk_recognition_msgs::ColorHistogram::ConstPtr &input)
message_filters::Subscriber< jsk_recognition_msgs::ColorHistogramArray > sub_histogram_
#define NODELET_WARN_STREAM(...)
double distance_threshold_
virtual void unsubscribe()
#define NODELET_ERROR_STREAM(...)
PLUGINLIB_EXPORT_CLASS(jsk_pcl_ros::ColorHistogramFilter, nodelet::Nodelet)
#define NODELET_WARN_THROTTLE(rate,...)
ros::Publisher pub_histogram_
jsk_recognition_utils::ComparePolicy compare_policy_
boost::shared_ptr< dynamic_reconfigure::Server< Config > > srv_
ros::Subscriber sub_reference_
ColorHistogramFilterConfig Config
void subscribe(ros::NodeHandle &nh, const std::string &topic, uint32_t queue_size, const ros::TransportHints &transport_hints=ros::TransportHints(), ros::CallbackQueueInterface *callback_queue=0)
std::vector< float > reference_histogram_
ros::Publisher pub_indices_
virtual void feature(const jsk_recognition_msgs::ColorHistogramArray::ConstPtr &input_histogram, const jsk_recognition_msgs::ClusterPointIndices::ConstPtr &input_indices)
virtual void configCallback(Config &config, uint32_t level)
boost::shared_ptr< message_filters::Synchronizer< SyncPolicy > > sync_
#define NODELET_DEBUG(...)
double distance(const urdf::Pose &transform)