Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * projection.h - Laser data projection filter 00004 * 00005 * Created: Tue Mar 22 16:30:51 2011 00006 * Copyright 2011 Christoph Schwering 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_LASER_FILTER_FILTERS_PROJECTION_H_ 00024 #define __PLUGINS_LASER_FILTER_FILTERS_PROJECTION_H_ 00025 00026 #include "filter.h" 00027 00028 #ifndef HAVE_TF 00029 # error LaserProjectionDataFilter only availabe with TF 00030 #endif 00031 00032 #include <tf/transform_listener.h> 00033 00034 #include <string> 00035 00036 namespace fawkes { 00037 class Configuration; 00038 class Logger; 00039 } 00040 00041 class LaserProjectionDataFilter : public LaserDataFilter 00042 { 00043 public: 00044 LaserProjectionDataFilter(fawkes::tf::TransformListener *tf_listener, 00045 std::string target_frame, 00046 float not_from_x, float not_to_x, 00047 float not_from_y, float not_to_y, 00048 float only_from_z, float only_to_z, 00049 unsigned int in_data_size, 00050 std::vector<LaserDataFilter::Buffer *> &in); 00051 ~LaserProjectionDataFilter(); 00052 00053 void filter(); 00054 00055 private: 00056 inline void set_output(float *outbuf, fawkes::tf::Point &p); 00057 00058 private: 00059 fawkes::tf::TransformListener *tf_listener_; 00060 const std::string target_frame_; 00061 const float not_from_x_, not_to_x_; 00062 const float not_from_y_, not_to_y_; 00063 const float only_from_z_, only_to_z_; 00064 00065 float sin_angles360[360]; 00066 float cos_angles360[360]; 00067 float sin_angles720[720]; 00068 float cos_angles720[720]; 00069 00070 float index_factor_; 00071 }; 00072 00073 #endif