summaryrefslogtreecommitdiff
path: root/LocomotorPrimitivesController.h
diff options
context:
space:
mode:
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;
};