diff --git a/io/include/pcl/io/freenect2_grabber.h b/io/include/pcl/io/freenect2_grabber.h index 0b6adcb84eb..488ae654508 100644 --- a/io/include/pcl/io/freenect2_grabber.h +++ b/io/include/pcl/io/freenect2_grabber.h @@ -62,16 +62,16 @@ namespace pcl CPU, OPENCL, OPENGL }; -class PCL_EXPORTS k4w2Grabber : public Grabber +class PCL_EXPORTS Freenect2Grabber : public Grabber { public: typedef - void (sig_cb_k4w2_point_cloud_rgb) + void (sig_cb_freenect2_point_cloud_rgb) (const pcl::PointCloud::ConstPtr&); - k4w2Grabber(processor p = CPU, std::string serial = std::string()); + Freenect2Grabber(processor p = CPU, std::string serial = std::string()); virtual - ~k4w2Grabber() throw(); + ~Freenect2Grabber() throw(); virtual bool isRunning() const; @@ -85,7 +85,7 @@ class PCL_EXPORTS k4w2Grabber : public Grabber virtual std::string getName() const { - return (std::string("K4W2Grabber")); + return (std::string("Freenect2Grabber")); } virtual std::string @@ -104,7 +104,7 @@ class PCL_EXPORTS k4w2Grabber : public Grabber void prepareMake3D(const libfreenect2::Freenect2Device::IrCameraParams & depth_p); // Signals to indicate whether new clouds are available - boost::signals2::signal* point_cloud_rgb_signal_; + boost::signals2::signal* point_cloud_rgb_signal_; boost::thread thread_; diff --git a/io/src/freenect2_grabber.cpp b/io/src/freenect2_grabber.cpp index a2b76983367..351da3d64bd 100644 --- a/io/src/freenect2_grabber.cpp +++ b/io/src/freenect2_grabber.cpp @@ -38,7 +38,7 @@ #include #include -pcl::k4w2Grabber::k4w2Grabber (processor p, +pcl::Freenect2Grabber::Freenect2Grabber (processor p, std::string serial) : Grabber (), is_running_ (false), @@ -100,33 +100,33 @@ pcl::k4w2Grabber::k4w2Grabber (processor p, dev_->setColorFrameListener (listener_); dev_->setIrAndDepthFrameListener (listener_); - point_cloud_rgb_signal_ = createSignal (); + point_cloud_rgb_signal_ = createSignal (); } -pcl::k4w2Grabber::~k4w2Grabber () throw () +pcl::Freenect2Grabber::~Freenect2Grabber () throw () { dev_->stop (); dev_->close (); - disconnect_all_slots (); + disconnect_all_slots (); } void -pcl::k4w2Grabber::start () +pcl::Freenect2Grabber::start () { if (!is_running_) { - need_xyzrgb_ = num_slots () > 0; + need_xyzrgb_ = num_slots () > 0; frequency_.reset (); is_running_ = true; - thread_ = boost::thread (&k4w2Grabber::run, this); + thread_ = boost::thread (&Freenect2Grabber::run, this); } } void -pcl::k4w2Grabber::stop () +pcl::Freenect2Grabber::stop () { if (is_running_) { @@ -136,20 +136,20 @@ pcl::k4w2Grabber::stop () } bool -pcl::k4w2Grabber::isRunning () const +pcl::Freenect2Grabber::isRunning () const { return (is_running_); } float -pcl::k4w2Grabber::getFramesPerSecond () const +pcl::Freenect2Grabber::getFramesPerSecond () const { boost::mutex::scoped_lock lock (fps_mutex_); return (frequency_.getFrequency ()); } void -pcl::k4w2Grabber::prepareMake3D (const libfreenect2::Freenect2Device::IrCameraParams & depth_p) +pcl::Freenect2Grabber::prepareMake3D (const libfreenect2::Freenect2Device::IrCameraParams & depth_p) { const int w = 512; const int h = 424; @@ -166,7 +166,7 @@ pcl::k4w2Grabber::prepareMake3D (const libfreenect2::Freenect2Device::IrCameraPa } void -pcl::k4w2Grabber::run () +pcl::Freenect2Grabber::run () { dev_->start (); diff --git a/visualization/tools/freenect2_viewer.cpp b/visualization/tools/freenect2_viewer.cpp index 8ba37ec750f..184c5a644c1 100644 --- a/visualization/tools/freenect2_viewer.cpp +++ b/visualization/tools/freenect2_viewer.cpp @@ -60,24 +60,24 @@ printHelp (int, } template -class k4w2Viewer +class Freenect2Viewer { public: typedef pcl::PointCloud PointCloudT; - k4w2Viewer (pcl::k4w2Grabber& grabber) : + Freenect2Viewer (pcl::Freenect2Grabber& grabber) : grabber_ (grabber), - viewer_ ("k4w2 Viewer") + viewer_ ("Freenect2 Viewer") { viewer_.setCameraFieldOfView (0.785398); // approximately 45 degrees viewer_.setCameraPosition (0, 0, 0, 0, 0, 1, 0, 1, 0); - viewer_.registerKeyboardCallback (&k4w2Viewer::keyboardCallback, *this); - viewer_.registerPointPickingCallback (&k4w2Viewer::pointPickingCallback, *this); + viewer_.registerKeyboardCallback (&Freenect2Viewer::keyboardCallback, *this); + viewer_.registerPointPickingCallback (&Freenect2Viewer::pointPickingCallback, *this); } - ~k4w2Viewer () + ~Freenect2Viewer () { connection_.disconnect (); } @@ -86,7 +86,7 @@ class k4w2Viewer run () { boost::function f = boost::bind (&k4w2Viewer::cloudCallback, this, _1); + (const typename PointCloudT::ConstPtr&)> f = boost::bind (&Freenect2Viewer::cloudCallback, this, _1); connection_ = grabber_.registerCallback (f); grabber_.start (); @@ -152,7 +152,7 @@ class k4w2Viewer pcl::console::print_value ("%.3f\n", z); } - pcl::k4w2Grabber& grabber_; + pcl::Freenect2Grabber& grabber_; pcl::visualization::PCLVisualizer viewer_; boost::signals2::connection connection_; @@ -165,7 +165,7 @@ int main (int argc, char** argv) { - print_info ("Viewer for K4W2 devices (run with --help for more information)\n", argv[0]); + print_info ("Viewer for Freenect2 devices (run with --help for more information)\n", argv[0]); if (find_switch (argc, argv, "--help") || find_switch (argc, argv, "-h")) { @@ -189,9 +189,9 @@ main (int argc, try { - pcl::k4w2Grabber grabber (pcl::OPENGL); + pcl::Freenect2Grabber grabber (pcl::OPENGL); - k4w2Viewer viewer (grabber); + Freenect2Viewer viewer (grabber); viewer.run (); } catch (pcl::io::IOException& e)