From 1ed2797955836050c1a84121c1fbd053f96b646f Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 16 Jan 2013 17:00:30 +0100 Subject: LocomotorPrimitivesController: Fix to read correct data from storage --- LocomotorPrimitivesController.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'LocomotorPrimitivesController.h') 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; }; -- cgit v1.2.3-54-g00ecf