BeobotConfig.C

Go to the documentation of this file.
00001 /*!@file Beobot/BeobotConfig.C A set of Beobot configuration parameters */
00002 // //////////////////////////////////////////////////////////////////// //
00003 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
00004 // University of Southern California (USC) and the iLab at USC.         //
00005 // See http://iLab.usc.edu for information about this project.          //
00006 // //////////////////////////////////////////////////////////////////// //
00007 // Major portions of the iLab Neuromorphic Vision Toolkit are protected //
00008 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
00009 // in Visual Environments, and Applications'' by Christof Koch and      //
00010 // Laurent Itti, California Institute of Technology, 2001 (patent       //
00011 // pending; application number 09/912,225 filed July 23, 2001; see      //
00012 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status).     //
00013 // //////////////////////////////////////////////////////////////////// //
00014 // This file is part of the iLab Neuromorphic Vision C++ Toolkit.       //
00015 //                                                                      //
00016 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can   //
00017 // redistribute it and/or modify it under the terms of the GNU General  //
00018 // Public License as published by the Free Software Foundation; either  //
00019 // version 2 of the License, or (at your option) any later version.     //
00020 //                                                                      //
00021 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope  //
00022 // that it will be useful, but WITHOUT ANY WARRANTY; without even the   //
00023 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
00024 // PURPOSE.  See the GNU General Public License for more details.       //
00025 //                                                                      //
00026 // You should have received a copy of the GNU General Public License    //
00027 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write   //
00028 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,   //
00029 // Boston, MA 02111-1307 USA.                                           //
00030 // //////////////////////////////////////////////////////////////////// //
00031 // Primary maintainer for this file: Christian Siagian <siagian@usc.edu>
00032 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Beobot/BeobotConfig.C $
00033 // $Id: BeobotConfig.C 6795 2006-06-29 20:45:32Z rjpeters $
00034 
00035 #include "Beobot/BeobotConfig.H"
00036 #include "Component/ModelManager.H"
00037 
00038 // ######################################################################
00039 BeobotConfig::BeobotConfig()
00040 {
00041   readconfig.openFile( "Beobot.conf" );
00042   init();
00043 }
00044 
00045 // ######################################################################
00046 BeobotConfig::BeobotConfig( std::string fileName )
00047 {
00048   readconfig.openFile( fileName.c_str() );
00049   init();
00050 }
00051 
00052 // ######################################################################
00053 BeobotConfig::~BeobotConfig()
00054 { }
00055 
00056 // ######################################################################
00057 void BeobotConfig::init()
00058 {
00059   // speed servo number on BeoChip
00060   speedServoNum =
00061     (unsigned int)readconfig.getItemValueF( "speedServoNum" );
00062   LDEBUG("speedServoNum: %d", speedServoNum);
00063 
00064   // steering servo number on BeoChip
00065   steerServoNum =
00066     (unsigned int)readconfig.getItemValueF( "steerServoNum" );
00067   LDEBUG("steerServoNum: %d", steerServoNum);
00068 
00069   // gear servo number on BeoChip
00070   gearServoNum =
00071     (unsigned int)readconfig.getItemValueF( "gearServoNum" );
00072   LDEBUG("gearServoNum: %d", gearServoNum);
00073 
00074   // speed servo neutral position
00075   speedNeutralVal =
00076     (unsigned int)readconfig.getItemValueF( "speedNeutralVal" );
00077   LDEBUG("speedNeutralVal: %d", speedNeutralVal);
00078 
00079   // speed servo minimum position
00080   speedMinVal =
00081     (unsigned int)readconfig.getItemValueF( "speedMinVal" );
00082   LDEBUG("speedMinVal: %d", speedMinVal);
00083 
00084   // speed servo maximum position
00085   speedMaxVal =
00086     (unsigned int)readconfig.getItemValueF( "speedMaxVal" );
00087   LDEBUG("speedMaxVal: %d", speedMaxVal);
00088 
00089   // steering servo neutral position
00090   steerNeutralVal =
00091     (unsigned int)readconfig.getItemValueF( "steerNeutralVal" );
00092   LDEBUG("steerNeutralVal: %d", steerNeutralVal);
00093 
00094   // steering servo minimum position
00095   steerMinVal =
00096     (unsigned int)readconfig.getItemValueF( "steerMinVal" );
00097   LDEBUG("steerMinVal: %d", steerMinVal);
00098 
00099   // steering servo maximum position
00100   steerMaxVal =
00101     (unsigned int)readconfig.getItemValueF( "steerMaxVal" );
00102   LDEBUG("steerMaxVal: %d", steerMaxVal);
00103 
00104   // gear servo neutral position
00105   gearNeutralVal =
00106     (unsigned int)readconfig.getItemValueF( "gearNeutralVal" );
00107   LDEBUG("gearNeutralVal: %d", gearNeutralVal);
00108 
00109   // gear servo minimum position
00110   gearMinVal =
00111     (unsigned int)readconfig.getItemValueF( "gearMinVal" );
00112   LDEBUG("gearMinVal: %d", gearMinVal);
00113 
00114   // gear servo maximum position
00115   gearMaxVal =
00116     (unsigned int)readconfig.getItemValueF( "gearMaxVal" );
00117   LDEBUG("gearMaxVal: %d", gearMaxVal);
00118 
00119   // PWM0 neutral values
00120   pwm0NeutralVal =
00121     (unsigned int)readconfig.getItemValueF( "pwm0NeutralVal" );
00122   LDEBUG("pwm0NeutralVal: %d", pwm0NeutralVal);
00123 
00124   // PWM0 minimum values
00125   pwm0MinVal =
00126     (unsigned int)readconfig.getItemValueF( "pwm0MinVal" );
00127   LDEBUG("pwm0MinVal: %d", pwm0MinVal);
00128 
00129   // PWM0 maximum values
00130   pwm0MaxVal =
00131     (unsigned int)readconfig.getItemValueF( "pwm0MaxVal" );
00132   LDEBUG("pwm0MaxVal: %d", pwm0MaxVal);
00133 
00134   // PWM1 neutral values
00135   pwm1NeutralVal =
00136     (unsigned int)readconfig.getItemValueF( "pwm1NeutralVal" );
00137   LDEBUG("pwm1NeutralVal: %d", pwm1NeutralVal);
00138 
00139   // PWM1 minimum values
00140   pwm1MinVal =
00141     (unsigned int)readconfig.getItemValueF( "pwm1MinVal" );
00142   LDEBUG("pwm1MinVal: %d", pwm1MinVal);
00143 
00144   // PWM1 maximum values
00145   pwm1MaxVal =
00146     (unsigned int)readconfig.getItemValueF( "pwm1MaxVal" );
00147   LDEBUG("pwm1MaxVal: %d", pwm1MaxVal);
00148 
00149   // BeoChip port location
00150   beoChipPort = readconfig.getItemValueS( "beoChipPort" );
00151   LDEBUG("beoChipPort: %s", beoChipPort.c_str());
00152 }
00153 
00154 // ######################################################################
00155 /* So things look consistent in everyone's emacs... */
00156 /* Local Variables: */
00157 /* indent-tabs-mode: nil */
00158 /* End: */
Generated on Sun May 8 08:40:12 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3