diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-01-16 17:00:30 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-01-16 17:00:30 +0100 |
commit | 1ed2797955836050c1a84121c1fbd053f96b646f (patch) | |
tree | d68cc3be4aae751b67fa73abb50ca8d09f4c50dc /LocomotorPrimitivesController.h | |
parent | 8f37deb27bb959c593ee4a69ace1a52fa6331f9d (diff) |
LocomotorPrimitivesController: Fix to read correct data from storage
Diffstat (limited to 'LocomotorPrimitivesController.h')
-rw-r--r-- | LocomotorPrimitivesController.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/LocomotorPrimitivesController.h b/LocomotorPrimitivesController.h index c0f75be..702a3a5 100644 --- a/LocomotorPrimitivesController.h +++ b/LocomotorPrimitivesController.h @@ -7,12 +7,21 @@ class LocomotorPrimitivesController : public OpenSim::Controller { OpenSim_DECLARE_CONCRETE_OBJECT(LocomotorPrimitivesController, OpenSim::Controller); public: - LocomotorPrimitivesController(OpenSim::Storage act, double alpha) : OpenSim::Controller(), _act(act), _alpha(alpha) { } + LocomotorPrimitivesController(OpenSim::Storage act, double alpha) + : OpenSim::Controller(), _act(act), _alpha(alpha) + { + _muscle_act = new double[act.getSmallestNumberOfStates()]; + } + + ~LocomotorPrimitivesController() + { + delete[] _muscle_act; + } - int loadCsvData(const std::string &muscleName, const std::string &file); void computeControls(const SimTK::State &s, SimTK::Vector &controls) const; private: double _alpha; + double *_muscle_act; OpenSim::Storage _act; }; |