Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * box_relative.h - A simple implementation of a relative position model 00004 * for boxes 00005 * 00006 * Created: Thu Jun 08 19:21:35 2006 00007 * Copyright 2005-2006 Tim Niemueller [www.niemueller.de] 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. A runtime exception applies to 00015 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Library General Public License for more details. 00021 * 00022 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00023 */ 00024 00025 #ifndef __FIREVISION_MODELS_RELPOS_BOX_H_ 00026 #define __FIREVISION_MODELS_RELPOS_BOX_H_ 00027 00028 #include <models/relative_position/relativepositionmodel.h> 00029 00030 // include <utils/kalman_filter/ckalman_filter_2dim.h> 00031 00032 namespace firevision { 00033 #if 0 /* just to make Emacs auto-indent happy */ 00034 } 00035 #endif 00036 00037 class BoxRelative : public RelativePositionModel 00038 { 00039 public: 00040 BoxRelative(unsigned int image_width, unsigned int image_height, 00041 float camera_height, 00042 float camera_offset_x, float camera_offset_y, 00043 float camera_ori, 00044 float horizontal_angle, float vertical_angle 00045 ); 00046 00047 virtual const char * get_name() const; 00048 virtual void set_center(float x, float y); 00049 virtual void set_center(const center_in_roi_t& c); 00050 virtual void set_radius(float r); 00051 00052 virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f); 00053 virtual void get_pan_tilt(float *pan, float *tilt) const; 00054 00055 virtual void set_horizontal_angle(float angle_deg); 00056 virtual void set_vertical_angle(float angle_deg); 00057 00058 virtual float get_distance() const; 00059 00060 virtual float get_x() const; 00061 virtual float get_y() const; 00062 00063 virtual float get_bearing() const; 00064 virtual float get_slope() const; 00065 00066 virtual void calc(); 00067 virtual void calc_unfiltered(); 00068 virtual void reset(); 00069 00070 virtual bool is_pos_valid() const; 00071 00072 private: 00073 float DEFAULT_X_VARIANCE; 00074 float DEFAULT_Y_VARIANCE; 00075 00076 float pan_rad_per_pixel; 00077 float tilt_rad_per_pixel; 00078 00079 center_in_roi_t center; 00080 float pan; 00081 float tilt; 00082 00083 float horizontal_angle; 00084 float vertical_angle; 00085 00086 unsigned int image_width; 00087 unsigned int image_height; 00088 00089 float camera_height; 00090 float camera_offset_x; 00091 float camera_offset_y; 00092 float camera_orientation; 00093 00094 float last_x; 00095 float last_y; 00096 bool last_available; 00097 float box_x; 00098 float box_y; 00099 float bearing; 00100 float slope; 00101 float distance_box_motor; 00102 float distance_box_cam; 00103 00104 /* 00105 float var_proc_x; 00106 float var_proc_y; 00107 float var_meas_x; 00108 float var_meas_y; 00109 kalmanFilter2Dim *kalman_filter; 00110 00111 void applyKalmanFilter(); 00112 */ 00113 }; 00114 00115 } // end namespace firevision 00116 00117 #endif // __FIREVISION_MODELS_RELPOS_BOX_H_ 00118