00001 /************************************************************************************************/ 00002 /*! \file DMURateGyro.cpp 00003 * \brief The DMURateGyro class provides the interface for h/w DMU rate gyros. 00004 * \author $Author: jayhawk_hokie $ 00005 * \version $Revision: 1.11 $ 00006 * \date $Date: 2007/08/07 18:55:26 $ 00007 ************************************************************************************************/ 00008 /*! 00009 * 00010 ************************************************************************************************/ 00011 #include <string.h> 00012 #include "DMURateGyro.h" 00013 00014 /*! \brief DMURateGyro constructor 00015 * @ param handle XML handle with current whorl as starting node 00016 * @ param rateGyro rate gyro name as given in xml config file 00017 */ 00018 00019 DMURateGyro::DMURateGyro(TiXmlHandle handle, string rateGyro) 00020 { 00021 int response; // error checking for parsing 00022 00023 // parse xml file to get rate gyro data 00024 00025 TiXmlHandle rgHandle = handle.FirstChild("HARDWARE_PROPERTIES").FirstChild("DMU_RATE_GYRO").FirstChild(rateGyro); 00026 00027 response = rgHandle.Child("ChannelID", 0).Element() -> QueryIntAttribute("value", &m_channelID); 00028 checkResponse(response); 00029 response = rgHandle.Child("Mode",0).Element() -> QueryIntAttribute("value", &m_mode); 00030 checkResponse(response); 00031 response = rgHandle.Child("Offset",0).Element() -> QueryFloatAttribute("value", &m_offset); 00032 checkResponse(response); 00033 response = rgHandle.Child("ScaleFactor",0).Element() -> QueryFloatAttribute("value", &m_rateScaleFactor); 00034 00035 if (Initialize() != 0 ) 00036 { 00037 cerr << " error, DMURateGyro::Initialize() is not happy " << endl; 00038 } 00039 else 00040 { 00041 // Having Problems with first several samples for the Rate gyros on Whorl-I, temp fix. 8-7-07 SAK 00042 double temp; 00043 for( int i=0; i<10; i++ ) 00044 { 00045 temp = GetMeasurement( ).GetAsDouble( ); 00046 //cerr << "Rate Voltage: " << GetMeasurement( ).GetAsDouble( ) << endl; 00047 } 00048 cerr << "\nSensor Set: " << rateGyro << endl; 00049 } 00050 }; 00051 00052 // Do not change the comments below - they will be added automatically by CVS 00053 /***************************************************************************** 00054 * $Log: DMURateGyro.cpp,v $ 00055 * Revision 1.11 2007/08/07 18:55:26 jayhawk_hokie 00056 * Rate Sample reading issue. 00057 * 00058 * Revision 1.10 2007/05/22 18:21:11 jayhawk_hokie 00059 * *** empty log message *** 00060 * 00061 * Revision 1.9 2007/01/12 20:25:31 bwilliam 00062 * Modified to use XML parser. 00063 * 00064 * Revision 1.8 2005/04/26 17:20:38 cakinli 00065 * Updated Makefiles to build a single libdsacss.a in the src directory to alleviate linking issues with the multiple, per-directory libraries. 00066 * 00067 * Revision 1.7 2004/05/27 19:07:28 shoemaker 00068 * Made changes corresponding to new daq card settings and calibration methods 00069 * 00070 * Revision 1.6 2004/04/11 19:33:25 shoemaker 00071 * Fixed bugs in analog code and cleaned up random messages 00072 * 00073 * Revision 1.5 2004/04/08 06:07:08 shoemaker 00074 * Added analog MoPak calibration routines 00075 * 00076 * Revision 1.4 2004/03/29 16:43:11 shoemaker 00077 * Added code to work with analog DAQ card code 00078 * 00079 * Revision 1.3 2003/08/18 19:15:32 mavandyk 00080 * Changed config parsing 00081 * 00082 * Revision 1.2 2003/08/13 23:19:53 mavandyk 00083 * Fixed a few lines that had warnings. 00084 * 00085 * Revision 1.1 2003/08/06 21:41:54 mavandyk 00086 * Added config parsing. 00087 * 00088 * Revision 1.4 2003/07/18 17:22:13 shoemaker 00089 * Now uses Measurement class. Still has timing and data-wasting issues. 00090 * 00091 * Revision 1.3 2003/07/03 16:54:50 shoemaker 00092 * Added semi-working versions of DMU code 00093 * 00094 * Revision 1.2 2003/06/26 20:12:08 mavandyk 00095 * Added code to inline functions for the calls to the DMU class. 00096 * 00097 * Revision 1.1 2003/06/25 21:49:23 mavandyk 00098 * Alter architechture of class structure. 00099 * 00100 * Revision 1.1.1.1 2003/06/06 18:44:15 simpliciter 00101 * Initial submission. 00102 * 00103 * 00104 ******************************************************************************/