pointcloud_screenpoint_nodelet.cpp
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 /*********************************************************************
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2014, JSK Lab
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the JSK Lab nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *********************************************************************/
35 
38 
39 // F/K/A <ray converter>
40 // Haseru Chen, Kei Okada, Yohei Kakiuchi
41 
42 namespace mf = message_filters;
43 
44 namespace jsk_pcl_ros
45 {
46 
48 {
49  ConnectionBasedNodelet::onInit();
50 
51 
52  pcl::search::KdTree<pcl::PointXYZ>::Ptr normals_tree_(new pcl::search::KdTree<pcl::PointXYZ>);
53  n3d_.setSearchMethod (normals_tree_);
54 
55  dyn_srv_ = boost::make_shared< dynamic_reconfigure::Server< Config > >(*pnh_);
56  dynamic_reconfigure::Server<Config>::CallbackType f =
57  boost::bind(&PointcloudScreenpoint::configCallback, this, _1, _2);
58  dyn_srv_->setCallback(f);
59 
60  srv_ = pnh_->advertiseService(
61  "screen_to_point", &PointcloudScreenpoint::screenpoint_cb, this);
62 
63  pub_points_ = advertise< sensor_msgs::PointCloud2 >(*pnh_, "output", 1);
64  pub_point_ = advertise< geometry_msgs::PointStamped >(*pnh_, "output_point", 1);
65  pub_polygon_ = advertise< geometry_msgs::PolygonStamped >(*pnh_, "output_polygon", 1);
66 
67  onInitPostProcess();
68 }
69 
71  // message_filters::Synchronizer needs to be called reset
72  // before message_filters::Subscriber is freed.
73  // Calling reset fixes the following error on shutdown of the nodelet:
74  // terminate called after throwing an instance of
75  // 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
76  // what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument
77  // Also see https://github.com/ros/ros_comm/issues/720 .
78  sync_rect_.reset();
79  sync_point_.reset();
80  sync_point_array_.reset();
81  sync_poly_.reset();
82  async_rect_.reset();
83  async_point_.reset();
84  async_point_array_.reset();
85  async_poly_.reset();
86 }
87 
89 {
90  points_sub_.subscribe(*pnh_, "points", 1);
91  rect_sub_.subscribe(*pnh_, "rect", 1);
92  poly_sub_.subscribe(*pnh_, "poly", 1);
93  point_sub_.subscribe(*pnh_, "point", 1);
94  point_array_sub_.subscribe(*pnh_, "point_array", 1);
95 
96  if (synchronization_)
97  {
99  {
100  async_rect_ = boost::make_shared<
103  async_rect_->registerCallback(
104  boost::bind(&PointcloudScreenpoint::sync_rect_cb, this, _1, _2));
105 
106  async_poly_ = boost::make_shared<
108  async_poly_->connectInput(points_sub_, rect_sub_);
109  async_poly_->registerCallback(
110  boost::bind(&PointcloudScreenpoint::sync_poly_cb, this, _1, _2));
111 
112  async_point_ = boost::make_shared<
114  async_point_->connectInput(points_sub_, point_sub_);
115  async_point_->registerCallback(
116  boost::bind(&PointcloudScreenpoint::sync_point_cb, this, _1, _2));
117 
118  async_point_array_ = boost::make_shared<
121  async_point_array_->registerCallback(
122  boost::bind(&PointcloudScreenpoint::sync_point_array_cb, this, _1, _2));
123  }
124  else
125  {
126  sync_rect_ = boost::make_shared<
128  sync_rect_->connectInput(points_sub_, rect_sub_);
129  sync_rect_->registerCallback(
130  boost::bind(&PointcloudScreenpoint::sync_rect_cb, this, _1, _2));
131 
132  sync_poly_ = boost::make_shared<
134  sync_poly_->connectInput(points_sub_, rect_sub_);
135  sync_poly_->registerCallback(
136  boost::bind(&PointcloudScreenpoint::sync_poly_cb, this, _1, _2));
137 
138  sync_point_ = boost::make_shared<
140  sync_point_->connectInput(points_sub_, point_sub_);
141  sync_point_->registerCallback(
142  boost::bind(&PointcloudScreenpoint::sync_point_cb, this, _1, _2));
143 
144  sync_point_array_ = boost::make_shared<
147  sync_point_array_->registerCallback(
148  boost::bind(&PointcloudScreenpoint::sync_point_array_cb, this, _1, _2));
149  }
150  }
151  else
152  {
154  boost::bind(&PointcloudScreenpoint::points_cb, this, _1));
156  boost::bind(&PointcloudScreenpoint::rect_cb, this, _1));
158  boost::bind(&PointcloudScreenpoint::poly_cb, this, _1));
160  boost::bind(&PointcloudScreenpoint::point_cb, this, _1));
162  boost::bind(&PointcloudScreenpoint::point_array_cb, this, _1));
163  }
164 }
165 
167 {
173 }
174 
175 void PointcloudScreenpoint::configCallback(Config& config, uint32_t level)
176 {
177  boost::mutex::scoped_lock lock(mutex_);
178 
179  bool need_resubscribe = false;
180  if (synchronization_ != config.synchronization ||
181  approximate_sync_ != config.approximate_sync ||
182  queue_size_ != config.queue_size)
183  need_resubscribe = true;
184 
185  synchronization_ = config.synchronization;
186  approximate_sync_ = config.approximate_sync;
187  queue_size_ = config.queue_size;
188  crop_size_ = config.crop_size;
189  timeout_ = config.timeout;
190 
191  if (search_size_ != config.search_size)
192  {
193  search_size_ = config.search_size;
194  n3d_.setKSearch (search_size_);
195  }
196 
197  if (need_resubscribe && isSubscribed())
198  {
199  unsubscribe();
200  subscribe();
201  }
202 }
203 
204 // Service callback functions
206  jsk_recognition_msgs::TransformScreenpoint::Request &req,
207  jsk_recognition_msgs::TransformScreenpoint::Response &res)
208 {
209  NODELET_DEBUG("PointcloudScreenpoint::screenpoint_cb");
210  boost::mutex::scoped_lock lock(mutex_);
211 
212  if ( latest_cloud_.empty() && req.no_update ) {
213  NODELET_ERROR("no point cloud was received");
214  return false;
215  }
216 
217  bool need_unsubscribe = false;
218  if (!points_sub_.getSubscriber()) {
220  boost::bind(&PointcloudScreenpoint::points_cb, this, _1));
221  need_unsubscribe = true;
222  }
223 
224  // wait for cloud
226  ros::Rate r(10);
227  while (ros::ok())
228  {
229  if ( !latest_cloud_.empty() ) break;
230  if ((ros::Time::now() - start).toSec() > timeout_) break;
231  r.sleep();
232  ros::spinOnce();
233  NODELET_INFO_THROTTLE(1.0, "Waiting for point cloud...");
234  }
235 
236  if (need_unsubscribe)
237  {
239  }
240 
241  if (latest_cloud_.empty())
242  {
243  NODELET_ERROR("no point cloud was received");
244  return false;
245  }
246 
247  res.header = latest_cloud_header_;
248 
249  bool ret;
250  float rx, ry, rz;
251  ret = extract_point (latest_cloud_, req.x, req.y, rx, ry, rz);
252  res.point.x = rx; res.point.y = ry; res.point.z = rz;
253 
254  if (!ret) {
255  NODELET_ERROR("Failed to extract point");
256  return false;
257  }
258 
259  // search normal
260  n3d_.setSearchSurface(latest_cloud_.makeShared());
261 
262  pcl::PointCloud<pcl::PointXYZ> cloud_;
263  pcl::PointXYZ pt;
264  pt.x = res.point.x;
265  pt.y = res.point.y;
266  pt.z = res.point.z;
267  cloud_.points.resize(0);
268  cloud_.points.push_back(pt);
269 
270  n3d_.setInputCloud (cloud_.makeShared());
271  pcl::PointCloud<pcl::Normal> cloud_normals;
272  n3d_.compute (cloud_normals);
273 
274  res.vector.x = cloud_normals.points[0].normal_x;
275  res.vector.y = cloud_normals.points[0].normal_y;
276  res.vector.z = cloud_normals.points[0].normal_z;
277 
278  if((res.point.x * res.vector.x + res.point.y * res.vector.y + res.point.z * res.vector.z) < 0) {
279  res.vector.x *= -1;
280  res.vector.y *= -1;
281  res.vector.z *= -1;
282  }
283 
284  if (pub_point_.getNumSubscribers() > 0) {
285  geometry_msgs::PointStamped ps;
286  ps.header = latest_cloud_header_;
287  ps.point.x = res.point.x;
288  ps.point.y = res.point.y;
289  ps.point.z = res.point.z;
290  pub_point_.publish(ps);
291  }
292 
293  return true;
294 }
295 
296 // Message callback functions
297 void PointcloudScreenpoint::points_cb(const sensor_msgs::PointCloud2::ConstPtr &msg)
298 {
299  NODELET_DEBUG("PointcloudScreenpoint::points_cb, width=%d, height=%d, fields=%ld",
300  msg->width, msg->height, msg->fields.size());
301 
302  latest_cloud_header_ = msg->header;
304 }
305 
306 void PointcloudScreenpoint::point_cb (const geometry_msgs::PointStampedConstPtr& pt_ptr)
307 {
308  if (latest_cloud_.empty())
309  {
310  NODELET_ERROR_THROTTLE(1.0, "no point cloud was received");
311  return;
312  }
313  if (pub_point_.getNumSubscribers() > 0)
314  {
315  geometry_msgs::PointStamped ps;
316  bool ret; float rx, ry, rz;
317  ret = extract_point (latest_cloud_, pt_ptr->point.x, pt_ptr->point.y, rx, ry, rz);
318 
319  if (ret) {
320  ps.point.x = rx; ps.point.y = ry; ps.point.z = rz;
321  ps.header = latest_cloud_header_;
322  pub_point_.publish (ps);
323  }
324  }
325  if (pub_points_.getNumSubscribers() > 0)
326  {
327  int st_x = pt_ptr->point.x - crop_size_;
328  int st_y = pt_ptr->point.y - crop_size_;
329  int ed_x = pt_ptr->point.x + crop_size_;
330  int ed_y = pt_ptr->point.y + crop_size_;
331  sensor_msgs::PointCloud2 out_pts;
332  extract_rect (latest_cloud_, st_x, st_y, ed_x, ed_y, out_pts);
333  pub_points_.publish(out_pts);
334  }
335 }
336 
337 void PointcloudScreenpoint::point_array_cb (const sensor_msgs::PointCloud2ConstPtr& pt_arr_ptr)
338 {
339  if (latest_cloud_.empty())
340  {
341  NODELET_ERROR_THROTTLE(1.0, "no point cloud was received");
342  return;
343  }
344  if (pub_points_.getNumSubscribers() > 0) {
345  pcl::PointCloud<pcl::PointXY>::Ptr point_array_cloud(new pcl::PointCloud<pcl::PointXY>);
346  pcl::fromROSMsg(*pt_arr_ptr, *point_array_cloud);
347  pcl::PointCloud<pcl::PointXYZ>::Ptr result_cloud(new pcl::PointCloud<pcl::PointXYZ>);
348  result_cloud->header = pcl_conversions::toPCL(latest_cloud_header_); // FIXME: if hydro
349  for (size_t i = 0; i < point_array_cloud->points.size(); i++) {
350  pcl::PointXY point = point_array_cloud->points[i];
351  geometry_msgs::PointStamped ps;
352  bool ret; float rx, ry, rz;
353  ret = extract_point (latest_cloud_, point.x, point.y, rx, ry, rz);
354  if (ret) {
355  pcl::PointXYZ point_on_screen;
356  point_on_screen.x = rx;
357  point_on_screen.y = ry;
358  point_on_screen.z = rz;
359  result_cloud->points.push_back(point_on_screen);
360  }
361  }
362  sensor_msgs::PointCloud2::Ptr ros_cloud(new sensor_msgs::PointCloud2);
363  pcl::toROSMsg(*result_cloud, *ros_cloud);
364  ros_cloud->header = latest_cloud_header_;
365  pub_points_.publish(ros_cloud);
366  }
367 }
368 
369 void PointcloudScreenpoint::rect_cb (const geometry_msgs::PolygonStampedConstPtr& array_ptr) {
370  if (latest_cloud_.empty())
371  {
372  NODELET_ERROR_THROTTLE(1.0, "no point cloud was received");
373  return;
374  }
375 
376  int num_pts = array_ptr->polygon.points.size();
377  if ( num_pts < 2) {
378  NODELET_ERROR("Point size must be 2.");
379  return;
380  } else if ( num_pts > 2 ) {
381  NODELET_WARN("Expected point size is 2, got %ld. "
382  "Used first 2 points to compute mid-coords.",
383  array_ptr->polygon.points.size());
384  }
385 
386  int st_x = array_ptr->polygon.points[0].x;
387  int st_y = array_ptr->polygon.points[0].y;
388  int ed_x = array_ptr->polygon.points[1].x;
389  int ed_y = array_ptr->polygon.points[1].y;
390 
391  if (pub_point_.getNumSubscribers() > 0)
392  {
393  geometry_msgs::PointStamped ps;
394  bool ret; float rx, ry, rz;
395  ret = extract_point (latest_cloud_, (st_x + ed_x) / 2, (st_y + ed_y) / 2, rx, ry, rz);
396 
397  if (ret) {
398  ps.point.x = rx; ps.point.y = ry; ps.point.z = rz;
399  ps.header = latest_cloud_header_;
400  pub_point_.publish (ps);
401  }
402  }
403  if (pub_points_.getNumSubscribers() > 0)
404  {
405  sensor_msgs::PointCloud2 out_pts;
406  extract_rect (latest_cloud_, st_x, st_y, ed_x, ed_y, out_pts);
407  pub_points_.publish(out_pts);
408  }
409 }
410 
411 void PointcloudScreenpoint::poly_cb(const geometry_msgs::PolygonStampedConstPtr& array_ptr)
412 {
413  if (latest_cloud_.empty())
414  {
415  NODELET_ERROR_THROTTLE(1.0, "no point cloud was received");
416  return;
417  }
419  {
420  geometry_msgs::PolygonStamped result_polygon;
421  result_polygon.header = latest_cloud_header_;
422  for (size_t i = 0; i < array_ptr->polygon.points.size(); i++) {
423  geometry_msgs::Point32 p = array_ptr->polygon.points[i];
424  float rx, ry, rz;
425  bool ret = extract_point (latest_cloud_, p.x, p.y, rx, ry, rz);
426  if (!ret) {
427  NODELET_ERROR("Failed to project point");
428  continue;
429  }
430  geometry_msgs::Point32 p_projected;
431  p_projected.x = rx;
432  p_projected.y = ry;
433  p_projected.z = rz;
434  result_polygon.polygon.points.push_back(p_projected);
435  }
436  pub_polygon_.publish(result_polygon);
437  }
438 }
439 
441  const sensor_msgs::PointCloud2::ConstPtr& points_ptr,
442  const geometry_msgs::PointStamped::ConstPtr& pt_ptr)
443 {
444  boost::mutex::scoped_lock lock(mutex_);
445  points_cb (points_ptr);
446  point_cb (pt_ptr);
447 }
448 
450  const sensor_msgs::PointCloud2::ConstPtr& points_ptr,
451  const sensor_msgs::PointCloud2::ConstPtr& pt_arr_ptr)
452 {
453  boost::mutex::scoped_lock lock(mutex_);
454  points_cb (points_ptr);
455  point_array_cb(pt_arr_ptr);
456 }
457 
459  const sensor_msgs::PointCloud2::ConstPtr& points_ptr,
460  const geometry_msgs::PolygonStamped::ConstPtr& array_ptr)
461 {
462  boost::mutex::scoped_lock lock(mutex_);
463  points_cb (points_ptr);
464  poly_cb(array_ptr);
465 }
466 
468  const sensor_msgs::PointCloud2::ConstPtr& points_ptr,
469  const geometry_msgs::PolygonStamped::ConstPtr& array_ptr) {
470  boost::mutex::scoped_lock lock(mutex_);
471  points_cb(points_ptr);
472  rect_cb (array_ptr);
473 }
474 
475 bool PointcloudScreenpoint::checkpoint (const pcl::PointCloud< pcl::PointXYZ > &in_pts,
476  int x, int y,
477  float &resx, float &resy, float &resz)
478 {
479  if ((x < 0) || (y < 0) || (x >= in_pts.width) || (y >= in_pts.height)) {
480  NODELET_WARN("Requested point is out of image size. "
481  "point: (%d, %d) size: (%d, %d)",
482  x, y, in_pts.width, in_pts.height);
483  return false;
484  }
485 
486  pcl::PointXYZ p = in_pts.points[in_pts.width * y + x];
487  // search near points
488  NODELET_DEBUG("Request: screenpoint (%d, %d) => (%f, %f, %f)", x, y, p.x, p.y, p.z);
489  //return !(isnan (p.x) || ( (p.x == 0.0) && (p.y == 0.0) && (p.z == 0.0)));
490 
491  if ( !std::isnan (p.x) && ((p.x != 0.0) || (p.y != 0.0) || (p.z == 0.0)) ) {
492  resx = p.x; resy = p.y; resz = p.z;
493  return true;
494  }
495  return false;
496 }
497 
498 bool PointcloudScreenpoint::extract_point(const pcl::PointCloud< pcl::PointXYZ > &in_pts,
499  int reqx, int reqy,
500  float &resx, float &resy, float &resz)
501 {
502  int x, y;
503 
504  x = reqx < 0.0 ? ceil(reqx - 0.5) : floor(reqx + 0.5);
505  y = reqy < 0.0 ? ceil(reqy - 0.5) : floor(reqy + 0.5);
506  NODELET_DEBUG("Request : %d %d", x, y);
507 
508  if (checkpoint (in_pts, x, y, resx, resy, resz)) {
509  return true;
510  } else {
511  for (int n = 1; n < crop_size_; n++) {
512  for (int y2 = 0; y2 <= n; y2++) {
513  int x2 = n - y2;
514  if (checkpoint (in_pts, x + x2, y + y2, resx, resy, resz)) {
515  return true;
516  }
517  if (x2 != 0 && y2 != 0) {
518  if (checkpoint (in_pts, x - x2, y - y2, resx, resy, resz)) {
519  return true;
520  }
521  }
522  if (x2 != 0) {
523  if (checkpoint (in_pts, x - x2, y + y2, resx, resy, resz)) {
524  return true;
525  }
526  }
527  if (y2 != 0) {
528  if (checkpoint (in_pts, x + x2, y - y2, resx, resy, resz)) {
529  return true;
530  }
531  }
532  }
533  }
534  }
535  return false;
536 }
537 
538 void PointcloudScreenpoint::extract_rect (const pcl::PointCloud< pcl::PointXYZ >& in_pts,
539  int st_x, int st_y,
540  int ed_x, int ed_y,
541  sensor_msgs::PointCloud2& out_pts)
542 {
543  sensor_msgs::PointCloud2::Ptr points_ptr(new sensor_msgs::PointCloud2);
544  pcl::toROSMsg(in_pts, *points_ptr);
545 
546  if ( st_x < 0 ) st_x = 0;
547  if ( st_y < 0 ) st_y = 0;
548  if ( ed_x >= points_ptr->width ) ed_x = points_ptr->width -1;
549  if ( ed_y >= points_ptr->height ) ed_y = points_ptr->height -1;
550 
551  int wd = points_ptr->width;
552  int ht = points_ptr->height;
553  int rstep = points_ptr->row_step;
554  int pstep = points_ptr->point_step;
555 
556  out_pts.header = points_ptr->header;
557  out_pts.width = ed_x - st_x + 1;
558  out_pts.height = ed_y - st_y + 1;
559  out_pts.row_step = out_pts.width * pstep;
560  out_pts.point_step = pstep;
561  out_pts.is_bigendian = false;
562  out_pts.fields = points_ptr->fields;
563  out_pts.is_dense = false;
564  out_pts.data.resize(out_pts.row_step * out_pts.height);
565 
566  unsigned char * dst_ptr = &(out_pts.data[0]);
567 
568  for (size_t idx_y = st_y; idx_y <= ed_y; idx_y++) {
569  for (size_t idx_x = st_x; idx_x <= ed_x; idx_x++) {
570  const unsigned char * src_ptr = &(points_ptr->data[idx_y * rstep + idx_x * pstep]);
571  memcpy(dst_ptr, src_ptr, pstep);
572  dst_ptr += pstep;
573  }
574  }
575 }
576 
577 } // namespace jsk_pcl_ros
578 
jsk_pcl_ros::PointcloudScreenpoint
Definition: pointcloud_screenpoint.h:88
NODELET_ERROR
#define NODELET_ERROR(...)
jsk_pcl_ros::PointcloudScreenpoint::timeout_
double timeout_
Definition: pointcloud_screenpoint.h:222
depth_error_calibration.lock
lock
Definition: depth_error_calibration.py:32
_2
boost::arg< 2 > _2
message_filters::Synchronizer
i
int i
jsk_pcl_ros::PointcloudScreenpoint::extract_point
bool extract_point(const pcl::PointCloud< pcl::PointXYZ > &in_pts, int reqx, int reqy, float &resx, float &resy, float &resz)
Definition: pointcloud_screenpoint_nodelet.cpp:530
start
start
jsk_pcl_ros::PointcloudScreenpoint::checkpoint
bool checkpoint(const pcl::PointCloud< pcl::PointXYZ > &in_pts, int x, int y, float &resx, float &resy, float &resz)
Definition: pointcloud_screenpoint_nodelet.cpp:507
NODELET_ERROR_THROTTLE
#define NODELET_ERROR_THROTTLE(rate,...)
jsk_pcl_ros::PointcloudScreenpoint::configCallback
virtual void configCallback(Config &config, uint32_t level)
Definition: pointcloud_screenpoint_nodelet.cpp:207
p
p
jsk_pcl_ros::PointcloudScreenpoint::points_sub_
mf::Subscriber< sensor_msgs::PointCloud2 > points_sub_
Definition: pointcloud_screenpoint.h:198
pcl_conversions::toPCL
void toPCL(const pcl_msgs::ModelCoefficients &mc, pcl::ModelCoefficients &pcl_mc)
ros::spinOnce
ROSCPP_DECL void spinOnce()
NODELET_WARN
#define NODELET_WARN(...)
jsk_pcl_ros::PointcloudScreenpoint::~PointcloudScreenpoint
virtual ~PointcloudScreenpoint()
Definition: pointcloud_screenpoint_nodelet.cpp:102
attention_pose_set.x
x
Definition: attention_pose_set.py:18
jsk_pcl_ros::PointcloudScreenpoint::rect_cb
void rect_cb(const geometry_msgs::PolygonStamped::ConstPtr &array_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:401
pcl::fromROSMsg
void fromROSMsg(const sensor_msgs::PointCloud2 &cloud, pcl::PointCloud< T > &pcl_cloud)
ros::Publisher::publish
void publish(const boost::shared_ptr< M > &message) const
message_filters::Subscriber::unsubscribe
void unsubscribe()
ros::ok
ROSCPP_DECL bool ok()
jsk_pcl_ros::PointcloudScreenpoint::async_rect_
boost::shared_ptr< mf::Synchronizer< PolygonApproxSyncPolicy > > async_rect_
Definition: pointcloud_screenpoint.h:203
jsk_pcl_ros::PointcloudScreenpoint::point_array_sub_
mf::Subscriber< sensor_msgs::PointCloud2 > point_array_sub_
Definition: pointcloud_screenpoint.h:201
jsk_pcl_ros::PointcloudScreenpoint::async_point_array_
boost::shared_ptr< mf::Synchronizer< PointCloudApproxSyncPolicy > > async_point_array_
Definition: pointcloud_screenpoint.h:205
jsk_pcl_ros::PointcloudScreenpoint::onInit
virtual void onInit()
Definition: pointcloud_screenpoint_nodelet.cpp:79
jsk_pcl_ros::PointcloudScreenpoint::sync_point_array_
boost::shared_ptr< mf::Synchronizer< PointCloudExactSyncPolicy > > sync_point_array_
Definition: pointcloud_screenpoint.h:210
class_list_macros.h
jsk_pcl_ros::PointcloudScreenpoint::pub_point_
ros::Publisher pub_point_
Definition: pointcloud_screenpoint.h:195
jsk_pcl_ros
Definition: add_color_from_image.h:51
jsk_pcl_ros::PointcloudScreenpoint::sync_poly_cb
void sync_poly_cb(const sensor_msgs::PointCloud2::ConstPtr &points_ptr, const geometry_msgs::PolygonStamped::ConstPtr &array_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:490
jsk_pcl_ros::PointcloudScreenpoint::point_array_cb
void point_array_cb(const sensor_msgs::PointCloud2::ConstPtr &pt_arr_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:369
PLUGINLIB_EXPORT_CLASS
PLUGINLIB_EXPORT_CLASS(jsk_pcl_ros::AddColorFromImage, nodelet::Nodelet)
jsk_pcl_ros::PointcloudScreenpoint::n3d_
pcl::NormalEstimation< pcl::PointXYZ, pcl::Normal > n3d_
Definition: pointcloud_screenpoint.h:214
attention_pose_set.r
r
Definition: attention_pose_set.py:9
_1
boost::arg< 1 > _1
jsk_pcl_ros::PointcloudScreenpoint::extract_rect
void extract_rect(const pcl::PointCloud< pcl::PointXYZ > &in_pts, int st_x, int st_y, int ed_x, int ed_y, sensor_msgs::PointCloud2 &out_pts)
Definition: pointcloud_screenpoint_nodelet.cpp:570
jsk_pcl_ros::PointcloudScreenpoint::sync_point_
boost::shared_ptr< mf::Synchronizer< PointExactSyncPolicy > > sync_point_
Definition: pointcloud_screenpoint.h:209
message_filters::SimpleFilter::registerCallback
Connection registerCallback(const boost::function< void(P)> &callback)
jsk_pcl_ros::PointcloudScreenpoint::pub_polygon_
ros::Publisher pub_polygon_
Definition: pointcloud_screenpoint.h:196
jsk_pcl_ros::PointcloudScreenpoint::sync_rect_
boost::shared_ptr< mf::Synchronizer< PolygonExactSyncPolicy > > sync_rect_
Definition: pointcloud_screenpoint.h:208
jsk_pcl_ros::PointcloudScreenpoint::rect_sub_
mf::Subscriber< geometry_msgs::PolygonStamped > rect_sub_
Definition: pointcloud_screenpoint.h:199
jsk_pcl_ros::PointcloudScreenpoint::dyn_srv_
boost::shared_ptr< dynamic_reconfigure::Server< Config > > dyn_srv_
Definition: pointcloud_screenpoint.h:193
point
std::chrono::system_clock::time_point point
jsk_pcl_ros::PointcloudScreenpoint::unsubscribe
virtual void unsubscribe()
Definition: pointcloud_screenpoint_nodelet.cpp:198
message_filters::Subscriber::subscribe
void subscribe()
jsk_pcl_ros::PointcloudScreenpoint::sync_poly_
boost::shared_ptr< mf::Synchronizer< PolygonExactSyncPolicy > > sync_poly_
Definition: pointcloud_screenpoint.h:211
jsk_pcl_ros::PointcloudScreenpoint::latest_cloud_header_
std_msgs::Header latest_cloud_header_
Definition: pointcloud_screenpoint.h:224
jsk_pcl_ros::PointcloudScreenpoint::synchronization_
bool synchronization_
Definition: pointcloud_screenpoint.h:218
jsk_pcl_ros::PointcloudScreenpoint::mutex_
boost::mutex mutex_
Definition: pointcloud_screenpoint.h:192
jsk_pcl_ros::PointcloudScreenpoint::sync_point_cb
void sync_point_cb(const sensor_msgs::PointCloud2::ConstPtr &points_ptr, const geometry_msgs::PointStamped::ConstPtr &pt_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:472
nodelet::Nodelet
ros::Time
jsk_pcl_ros::PointcloudScreenpoint::point_sub_
mf::Subscriber< geometry_msgs::PointStamped > point_sub_
Definition: pointcloud_screenpoint.h:200
jsk_pcl_ros::PointcloudScreenpoint::subscribe
virtual void subscribe()
Definition: pointcloud_screenpoint_nodelet.cpp:120
jsk_pcl_ros::PointcloudScreenpoint::async_poly_
boost::shared_ptr< mf::Synchronizer< PolygonApproxSyncPolicy > > async_poly_
Definition: pointcloud_screenpoint.h:206
jsk_pcl_ros::PointcloudScreenpoint::pub_points_
ros::Publisher pub_points_
Definition: pointcloud_screenpoint.h:194
dump_depth_error.f
f
Definition: dump_depth_error.py:39
jsk_pcl_ros::PointcloudScreenpoint::srv_
ros::ServiceServer srv_
Definition: pointcloud_screenpoint.h:197
jsk_pcl_ros::PointcloudScreenpoint::points_cb
void points_cb(const sensor_msgs::PointCloud2::ConstPtr &msg)
Definition: pointcloud_screenpoint_nodelet.cpp:329
jsk_pcl_ros::PointcloudScreenpoint::approximate_sync_
bool approximate_sync_
Definition: pointcloud_screenpoint.h:218
pcl::toROSMsg
void toROSMsg(const pcl::PointCloud< T > &cloud, sensor_msgs::Image &msg)
jsk_pcl_ros::PointcloudScreenpoint::screenpoint_cb
bool screenpoint_cb(jsk_recognition_msgs::TransformScreenpoint::Request &req, jsk_recognition_msgs::TransformScreenpoint::Response &res)
Definition: pointcloud_screenpoint_nodelet.cpp:237
ros::Rate
NODELET_INFO_THROTTLE
#define NODELET_INFO_THROTTLE(rate,...)
jsk_pcl_ros::PointcloudScreenpoint::point_cb
void point_cb(const geometry_msgs::PointStamped::ConstPtr &pt_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:338
jsk_pcl_ros::PointcloudScreenpoint::search_size_
int search_size_
Definition: pointcloud_screenpoint.h:220
message_filters
jsk_pcl_ros::PointcloudScreenpoint::latest_cloud_
pcl::PointCloud< pcl::PointXYZ > latest_cloud_
Definition: pointcloud_screenpoint.h:225
ros::Publisher::getNumSubscribers
uint32_t getNumSubscribers() const
message_filters::Subscriber::getSubscriber
const ros::Subscriber & getSubscriber() const
jsk_pcl_ros::PointcloudScreenpoint::poly_sub_
mf::Subscriber< geometry_msgs::PolygonStamped > poly_sub_
Definition: pointcloud_screenpoint.h:202
jsk_pcl_ros::PointcloudScreenpoint::crop_size_
int crop_size_
Definition: pointcloud_screenpoint.h:221
attention_pose_set.y
y
Definition: attention_pose_set.py:19
jsk_pcl_ros::PointcloudScreenpoint::sync_point_array_cb
void sync_point_array_cb(const sensor_msgs::PointCloud2::ConstPtr &points_ptr, const sensor_msgs::PointCloud2::ConstPtr &pt_arr_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:481
pointcloud_screenpoint.h
jsk_pcl_ros::PointcloudScreenpoint::sync_rect_cb
void sync_rect_cb(const sensor_msgs::PointCloud2ConstPtr &points_ptr, const geometry_msgs::PolygonStamped::ConstPtr &array_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:499
jsk_pcl_ros::PointcloudScreenpoint::poly_cb
void poly_cb(const geometry_msgs::PolygonStamped::ConstPtr &array_ptr)
Definition: pointcloud_screenpoint_nodelet.cpp:443
jsk_pcl_ros::PointcloudScreenpoint::async_point_
boost::shared_ptr< mf::Synchronizer< PointApproxSyncPolicy > > async_point_
Definition: pointcloud_screenpoint.h:204
config
config
pose_with_covariance_sample.msg
msg
Definition: pose_with_covariance_sample.py:22
n
GLfloat n[6][3]
sample_pointcloud_localization_client.req
req
Definition: sample_pointcloud_localization_client.py:15
jsk_pcl_ros::PointcloudScreenpoint::normals_tree_
pcl::search::KdTree< pcl::PointXYZ >::Ptr normals_tree_
Definition: pointcloud_screenpoint.h:215
sample_empty_service_caller.res
res
Definition: sample_empty_service_caller.py:14
NODELET_DEBUG
#define NODELET_DEBUG(...)
ros::Time::now
static Time now()
jsk_pcl_ros::PointcloudScreenpoint::queue_size_
int queue_size_
Definition: pointcloud_screenpoint.h:219
pcl_conversions.h


jsk_pcl_ros
Author(s): Yohei Kakiuchi
autogenerated on Tue Jan 7 2025 04:05:45