00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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
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
00148
00149
00150
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
00167
00168 public:
00169 #ifndef SWIG
00170 InvestigationCMCGait&
00171 operator=(const InvestigationCMCGait &aInvestigationCMCGait);
00172 #endif
00173
00174
00175
00176
00177
00178
00179
00180
00181 virtual
void run();
00182
00183
00184
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 };
00202
00203
00204
00205
00206
00207