summaryrefslogtreecommitdiff
path: root/LocomotorPrimitivesController.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-01-16 17:00:30 +0100
committerTobias Klauser <tklauser@distanz.ch>2013-01-16 17:00:30 +0100
commit1ed2797955836050c1a84121c1fbd053f96b646f (patch)
treed68cc3be4aae751b67fa73abb50ca8d09f4c50dc /LocomotorPrimitivesController.h
parent8f37deb27bb959c593ee4a69ace1a52fa6331f9d (diff)
LocomotorPrimitivesController: Fix to read correct data from storage
Diffstat (limited to 'LocomotorPrimitivesController.h')
-rw-r--r--LocomotorPrimitivesController.h13
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;
};