Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

InvestigationCMCGait.h

00001 // InvestigationCMCGait.h 00002 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00003 // Copyright (c) 2006 Stanford University and Realistic Dynamics, Inc. 00004 // Contributors: Frank C. Anderson, Ph.D. 00005 // 00006 // Permission is hereby granted, free of charge, to any person obtaining 00007 // a copy of this software and associated documentation files (the 00008 // "Software"), to deal in the Software without restriction, including 00009 // without limitation the rights to use, copy, modify, merge, publish, 00010 // distribute, sublicense, and/or sell copies of the Software, and to 00011 // permit persons to whom the Software is furnished to do so, subject 00012 // to the following conditions: 00013 // 00014 // The above copyright notice and this permission notice shall be included 00015 // in all copies or substantial portions of the Software. 00016 // 00017 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00018 // EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 00019 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 00020 // PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, 00021 // CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00022 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 00023 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH 00024 // THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00025 // 00026 // This software, originally developed by Realistic Dynamics, Inc., was 00027 // transferred to Stanford University on November 1, 2006. 00028 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00029 //#ifndef __InvestigationCMCGait_h__ 00030 //#define __InvestigationCMCGait_h__ 00031 00032 #include "rdCMCDLL.h" 00033 #include <OpenSim/Tools/Object.h> 00034 #include <OpenSim/Tools/PropertyBool.h> 00035 #include <OpenSim/Tools/PropertyStr.h> 00036 #include <OpenSim/Tools/PropertyInt.h> 00037 #include <OpenSim/Tools/Storage.h> 00038 #include <OpenSim/Tools/FunctionSet.h> 00039 #include <OpenSim/Simulation/Model/Investigation.h> 00040 #include <OpenSim/Simulation/Control/ControlSet.h> 00041 class XMLDocument; 00042 00043 //============================================================================= 00044 //============================================================================= 00051 class RDCMC_API InvestigationCMCGait: public OpenSim::Investigation 00052 { 00053 //============================================================================= 00054 // MEMBER VARIABLES 00055 //============================================================================= 00056 private: 00059 OpenSim::PropertyStr _desiredKinematicsFileNameProp; 00060 std::string &_desiredKinematicsFileName; 00062 OpenSim::PropertyStr _externalLoadsFileNameProp; 00063 std::string &_externalLoadsFileName; 00066 OpenSim::PropertyStr _externalLoadsModelKinematicsFileNameProp; 00067 std::string &_externalLoadsModelKinematicsFileName; 00070 OpenSim::PropertyStr _externalLoadsBody1Prop; 00071 std::string &_externalLoadsBody1; 00074 OpenSim::PropertyStr _externalLoadsBody2Prop; 00075 std::string &_externalLoadsBody2; 00077 OpenSim::PropertyStr _taskSetFileNameProp; 00078 std::string &_taskSetFileName; 00081 OpenSim::PropertyStr _constraintsFileNameProp; 00082 std::string &_constraintsFileName; 00084 OpenSim::PropertyStr _rraControlsFileNameProp; 00085 std::string &_rraControlsFileName; 00088 OpenSim::PropertyDbl _lowpassCutoffFrequencyProp; 00089 double &_lowpassCutoffFrequency; 00093 OpenSim::PropertyDbl _lowpassCutoffFrequencyForLoadKinematicsProp; 00094 double &_lowpassCutoffFrequencyForLoadKinematics; 00097 OpenSim::PropertyDbl _targetDTProp; 00098 double &_targetDT; 00100 OpenSim::PropertyBool _useCurvatureFilterProp; 00101 bool &_useCurvatureFilter; 00103 OpenSim::PropertyBool _useReflexesProp; 00104 bool &_useReflexes; 00112 OpenSim::PropertyBool _useFastTargetProp; 00113 bool &_useFastTarget; 00115 OpenSim::PropertyDbl _optimizerDXProp; 00116 double &_optimizerDX; 00118 OpenSim::PropertyDbl _convergenceCriterionProp; 00119 double &_convergenceCriterion; 00121 OpenSim::PropertyInt _maxIterationsProp; 00122 int &_maxIterations; 00125 OpenSim::PropertyInt _printLevelProp; 00126 int &_printLevel; 00128 OpenSim::PropertyBool _includePipelineActuatorsProp; 00129 bool &_includePipelineActuators; 00131 OpenSim::PropertyStr _adjustedCOMBodyProp; 00132 std::string &_adjustedCOMBody; 00135 OpenSim::PropertyStr _adjustedCOMFileNameProp; 00136 std::string &_adjustedCOMFileName; 00138 OpenSim::PropertyBool _computeAverageResidualsProp; 00139 bool &_computeAverageResiduals; 00142 OpenSim::PropertyBool _adjustCOMToReduceResidualsProp; 00143 bool &_adjustCOMToReduceResiduals; 00144 00145 00146 //============================================================================= 00147 // METHODS 00148 //============================================================================= 00149 //-------------------------------------------------------------------------- 00150 // CONSTRUCTION 00151 //-------------------------------------------------------------------------- 00152 public: 00153 virtual ~InvestigationCMCGait(); 00154 InvestigationCMCGait(); 00155 InvestigationCMCGait(const std::string &aFileName); 00156 InvestigationCMCGait(DOMElement *aElement); 00157 InvestigationCMCGait(const InvestigationCMCGait &aObject); 00158 virtual OpenSim::Object* copy() const; 00159 virtual OpenSim::Object* copy(DOMElement *aElement) const; 00160 private: 00161 void setNull(); 00162 void setupProperties(); 00163 void constructCorrectiveSprings(); 00164 00165 //-------------------------------------------------------------------------- 00166 // OPERATORS 00167 //-------------------------------------------------------------------------- 00168 public: 00169 #ifndef SWIG 00170 InvestigationCMCGait& 00171 operator=(const InvestigationCMCGait &aInvestigationCMCGait); 00172 #endif 00173 00174 //-------------------------------------------------------------------------- 00175 // GET AND SET 00176 //-------------------------------------------------------------------------- 00177 00178 //-------------------------------------------------------------------------- 00179 // INTERFACE 00180 //-------------------------------------------------------------------------- 00181 virtual void run(); 00182 00183 //-------------------------------------------------------------------------- 00184 // UTILITY 00185 //-------------------------------------------------------------------------- 00186 #ifndef SWIG 00187 OpenSim::ControlSet* 00188 constructRRAControlSet(OpenSim::ControlSet *aControlConstraints); 00189 void 00190 setControlsToUseStepsExceptResiduals( 00191 const OpenSim::ControlSet *aRRAControlSet,OpenSim::ControlSet *ControlSet); 00192 void initializeExternalLoads(); 00193 void computeInitialStatesFromCoordinates( 00194 const OpenSim::FunctionSet &aQSet,OpenSim::Array<double> &rYI); 00195 void computeAverageResiduals( 00196 OpenSim::Array<double> &rFAve,OpenSim::Array<double> &rMAve); 00197 void adjustCOMToReduceResiduals( 00198 const OpenSim::Array<double> &aFAve,const OpenSim::Array<double> &aMAve); 00199 #endif 00200 //============================================================================= 00201 }; // END of class InvestigationCMCGait 00202 //============================================================================= 00203 //============================================================================= 00204 00205 //#endif // __InvestigationCMCGait_h__ 00206 00207

Generated on Wed Nov 1 16:04:31 2006 for Computed Muscle Control (CMC) API by doxygen 1.3.8