00001 #ifndef __CALIBRATION_H 00002 #define __CALIBRATION_H 00003 00004 #include <boost/shared_ptr.hpp> 00005 #include <mimas/mm_object.h> 00006 #include <mimas/mm_xml_reference.h> 00007 #include "mi_pose.hh" 00008 00012 class calibration: public mimas::mm_object 00013 { 00014 public: 00018 calibration( const mimas::mm_xml_reference< XalanElement > 00019 &calibration_node ) throw (mimas::mm_exception); 00021 int get_width(void) const { return width; } 00023 int get_height(void) const { return height; } 00025 void set_width( int _width ) { width = _width; } 00027 void set_height( int _height ) { height = _height; } 00029 int get_middle_x(void) const { return width / 2; } 00031 int get_middle_y(void) const { return height / 2; } 00034 double get_pixel_size(void) const 00035 { return pixel_size / get_scale(); } 00037 double get_focus_distance(void) const 00038 { return focus_distance + focus_shift * steps; } 00040 void setSteps( int _steps ) { steps = _steps; } 00042 int getSteps(void) const { return steps; } 00044 double get_scale(void) const 00045 { return 1.0 + scale_change * steps; } 00046 protected: 00048 int steps; 00050 int width; 00052 int height; 00054 double pixel_size; 00056 double focus_distance; 00058 double focus_shift; 00060 double scale_change; 00061 }; 00062 00064 typedef boost::shared_ptr< calibration > calibration_ptr; 00065 00066 #endif