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 _bumblebee2_driver_h_ 00026 #define _bumblebee2_driver_h_ 00027 00028 #include <iri_base_driver/iri_base_driver.h> 00029 #include <iri_bumblebee2/Bumblebee2Config.h> 00030 00031 //include bumblebee2_driver main library 00032 #include "bumblebee.h" 00033 #include "firewireserver.h" 00034 #include <camera_common.h> 00035 00036 enum 00037 { 00038 LEFT=0, 00039 RIGHT=1 00040 }; 00041 00042 #define NUM_CAM 2 00043 00063 class Bumblebee2Driver : public iri_base_driver::IriBaseDriver 00064 { 00065 private: 00066 // private attributes and methods 00067 // private attributes and methods 00068 CBumblebee *camera; 00069 CFirewireServer *server; 00070 // reconfigure attributes 00071 uint64_t camera_id; 00072 // default_configuration 00073 TCameraConfig default_conf; 00074 // current configuration 00075 TCameraConfig current_conf; 00076 // default_configuration 00077 TCameraConfig desired_conf; 00078 // calibration file 00079 std::vector<std::string> calibration_files; 00080 // frame identifier 00081 std::vector<std::string> frame_ids; 00082 protected: 00087 void change_config(TCameraConfig *new_conf); 00088 public: 00095 typedef iri_bumblebee2::Bumblebee2Config Config; 00096 00103 Config config_; 00104 00113 Bumblebee2Driver(void); 00114 00125 bool openDriver(void); 00126 00137 bool closeDriver(void); 00138 00149 bool startDriver(void); 00150 00161 bool stopDriver(void); 00162 00174 void config_update(Config& new_cfg, uint32_t level=0); 00175 00176 // here define all bumblebee2_driver interface methods to retrieve and set 00177 // the driver parameters 00182 void get_current_config(TCameraConfig *current_conf); 00187 void get_images(char **left_image,char **right_image); 00192 std::string get_new_frame_event(void); 00197 void get_calibration_files(std::vector<std::string> &calibration_files); 00202 void get_frame_ids(std::vector<std::string> &frame_ids); 00203 00210 ~Bumblebee2Driver(void); 00211 }; 00212 00213 #endif