firewire_camera_driver.h
Go to the documentation of this file.
00001 // Copyright (C) 2010-2011 Institut de Robotica i Informatica Industrial, CSIC-UPC.
00002 // Author 
00003 // All rights reserved.
00004 //
00005 // This file is part of iri-ros-pkg
00006 // iri-ros-pkg is free software: you can redistribute it and/or modify
00007 // it under the terms of the GNU Lesser General Public License as published by
00008 // the Free Software Foundation, either version 3 of the License, or
00009 // at your option) any later version.
00010 //
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public License
00017 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 // 
00019 // IMPORTANT NOTE: This code has been generated through a script from the 
00020 // iri_ros_scripts. Please do NOT delete any comments to guarantee the correctness
00021 // of the scripts. ROS topics can be easly add by using those scripts. Please
00022 // refer to the IRI wiki page for more information:
00023 // http://wikiri.upc.es/index.php/Robotics_Lab
00024 
00025 #ifndef _firewire_camera_driver_h_
00026 #define _firewire_camera_driver_h_
00027 
00028 #include <iri_base_driver/iri_base_driver.h>
00029 #include <iri_firewire_camera/FirewireCameraConfig.h>
00030 
00031 //include firewire_camera_driver main library
00032 #include "firewirecamera.h"
00033 #include "firewireserver.h"
00034 #include "camera_common.h"
00035 
00055 class FirewireCameraDriver : public iri_base_driver::IriBaseDriver
00056 {
00057   private:
00058     // private attributes and methods
00059     CFirewireCamera *camera;
00060     CFirewireServer *server;
00061     long int camera_id;
00062     int ISO_speed;
00063     // desired configuration
00064     TCameraConfig desired_conf;
00065     // current configuration
00066     TCameraConfig current_conf;
00067     // default_configuration
00068     TCameraConfig default_conf;
00069     // calibration file
00070     std::string calibration_file;
00071     // frame identifier
00072     std::string frame_id;
00073   protected:
00078     void change_config(TCameraConfig *new_conf);
00083     void dyn_rec_to_camera(iri_firewire_camera::FirewireCameraConfig &dyn_rec_config,TCameraConfig &camera_config);
00088     void camera_to_dyn_rec(TCameraConfig &camera_config,iri_firewire_camera::FirewireCameraConfig &dyn_rec_config);
00093     void set_white_balance(bool *enable, int *mode, int *u_b_value, int *v_r_value);
00098     void set_shutter(bool *enable, int *mode, int *value); 
00103     void set_gain(bool *enable, int *mode, int *value);
00104   public:
00111     typedef iri_firewire_camera::FirewireCameraConfig Config;
00112 
00119     Config config_;
00120 
00129     FirewireCameraDriver();
00130 
00141     bool openDriver(void);
00142 
00153     bool closeDriver(void);
00154 
00165     bool startDriver(void);
00166 
00177     bool stopDriver(void);
00178 
00190     void config_update(Config& new_cfg, uint32_t level=0);
00191 
00192     // here define all firewire_camera_driver interface methods to retrieve and set
00193     // the driver parameters
00198     void set_ISO_speed(int iso_speed); 
00203     void get_image(char **image_data);
00208     void set_config(TCameraConfig *new_conf); 
00213     void get_current_config(TCameraConfig *current_conf);
00218     void get_desired_config(TCameraConfig *desired_conf);
00223     void get_default_config(TCameraConfig *default_conf);
00228     std::string get_new_frame_event(void);
00233     std::string get_calibration_file(void);
00238     std::string get_frame_id(void);
00245     ~FirewireCameraDriver();
00246 };
00247 
00248 #endif


iri_firewire_camera
Author(s): Sergi Hernandez Juan
autogenerated on Fri Dec 6 2013 22:28:49