Fawkes API  Fawkes Development Version
ir_pcl_thread.h
00001 
00002 /***************************************************************************
00003  *  ir_pcl_thread.h - Robotino IR point cloud thread
00004  *
00005  *  Created: Mon Mar 26 14:05:08 2012
00006  *  Copyright  2011-2012  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #ifndef __PLUGINS_ROBOTINO_IR_PCL_THREAD_H_
00024 #define __PLUGINS_ROBOTINO_IR_PCL_THREAD_H_
00025 
00026 #include <core/threading/thread.h>
00027 #include <aspect/blocked_timing.h>
00028 #include <aspect/logging.h>
00029 #include <aspect/configurable.h>
00030 #include <aspect/blackboard.h>
00031 #include <aspect/pointcloud.h>
00032 #include <pcl_utils/utils.h>
00033 
00034 #include <pcl/point_cloud.h>
00035 #include <pcl/point_types.h>
00036 
00037 
00038 namespace fawkes {
00039   class RobotinoSensorInterface;
00040 }
00041 
00042 class RobotinoIrPclThread
00043 : public fawkes::Thread,
00044   public fawkes::BlockedTimingAspect,
00045   public fawkes::BlackBoardAspect,
00046   public fawkes::PointCloudAspect,
00047   public fawkes::LoggingAspect
00048 {
00049  public:
00050   RobotinoIrPclThread();
00051 
00052   virtual void init();
00053   virtual void loop();
00054   virtual void finalize();
00055 
00056  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
00057  protected: virtual void run() { Thread::run(); }
00058 
00059  private: // members
00060   fawkes::RobotinoSensorInterface *sens_if_;
00061 
00062   fawkes::RefPtr<pcl::PointCloud<pcl::PointXYZ> > pcl_xyz_;
00063 
00064   float *angle_sines_;
00065   float *angle_cosines_;
00066 };
00067 
00068 
00069 #endif