Skip to content

Commit

Permalink
* Fixed bug PointCloudLibrary#705 in @PCDGrabber@ which included Open…
Browse files Browse the repository at this point in the history
…NI calls in the code without testing whether the OpenNI library is installed and exists -- HAVE_OPENNI guards (thanks Andy and Bill)

git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@5971 a9d63959-f2ad-4865-b262-bf0e56cfafb6
  • Loading branch information
rbrusu committed Jun 22, 2012
1 parent 4cd0164 commit f2c5329
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions io/include/pcl/io/pcd_grabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
#include <string>
#include <vector>
#include <pcl/ros/conversions.h>

#ifdef HAVE_OPENNI
#include <pcl/io/openni_camera/openni_depth_image.h>
#endif

namespace pcl
{
Expand Down Expand Up @@ -145,7 +148,10 @@ namespace pcl
publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const;

boost::signals2::signal<void (const boost::shared_ptr<const pcl::PointCloud<PointT> >&)>* signal_;

#ifdef HAVE_OPENNI
boost::signals2::signal<void (const boost::shared_ptr<openni_wrapper::DepthImage>&)>* depth_image_signal_;
#endif
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -154,7 +160,9 @@ namespace pcl
: PCDGrabberBase (pcd_path, frames_per_second, repeat)
{
signal_ = createSignal<void (const boost::shared_ptr<const pcl::PointCloud<PointT> >&)>();
#ifdef HAVE_OPENNI
depth_image_signal_ = createSignal <void (const boost::shared_ptr<openni_wrapper::DepthImage>&)> ();
#endif
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -163,7 +171,9 @@ namespace pcl
: PCDGrabberBase (pcd_files, frames_per_second, repeat), signal_ ()
{
signal_ = createSignal<void (const boost::shared_ptr<const pcl::PointCloud<PointT> >&)>();
#ifdef HAVE_OPENNI
depth_image_signal_ = createSignal <void (const boost::shared_ptr<openni_wrapper::DepthImage>&)> ();
#endif
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -177,6 +187,7 @@ namespace pcl

signal_->operator () (cloud);

#ifdef HAVE_OPENNI
// If dataset is not organized, return
if (!cloud->isOrganized ())
return;
Expand All @@ -195,6 +206,7 @@ namespace pcl
boost::shared_ptr<openni_wrapper::DepthImage> depth_image (new openni_wrapper::DepthImage (depth_meta_data, 0.075, 525, 0, 0));
if (depth_image_signal_->num_slots() > 0)
depth_image_signal_->operator()(depth_image);
#endif
}
}
#endif

0 comments on commit f2c5329

Please sign in to comment.