diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-01-22 18:42:29 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-01-22 18:42:29 +0100 |
commit | af6b09829ca942ead8ea6757308d431a6d8ccde9 (patch) | |
tree | 1dbc4d98822c7dfecec33fabef5a9fb5952f7fc2 /LocomotorPrimitivesController.cpp | |
parent | a1d0700c974aeacd4411213aff082f0e92018c3e (diff) |
LocomotorPrimitives: Tinkering to make simulation faster
No success yet... :-(
Diffstat (limited to 'LocomotorPrimitivesController.cpp')
-rw-r--r-- | LocomotorPrimitivesController.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/LocomotorPrimitivesController.cpp b/LocomotorPrimitivesController.cpp index 14fa764..0c13336 100644 --- a/LocomotorPrimitivesController.cpp +++ b/LocomotorPrimitivesController.cpp @@ -4,6 +4,9 @@ #define VERBOSE 1 +// XXX +extern clock_t ts_start; + static const double TIME_DAMP = 0.1; static const unsigned int N_PRINT = 1000; @@ -17,8 +20,10 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK int act_set_siz = getActuatorSet().getSize(); int nc = _act.getSmallestNumberOfStates(); - // Get the first nc states at a specified time (_NOT_ the state at nc as - // with getData()). + /* + * Get the first nc states at a specified time (_NOT_ the state at nc as + * with getData()). + */ _act.getDataAtTime(t, nc, _muscle_act); for (int i = 0; i < act_set_siz; i++) { @@ -28,7 +33,7 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK if (indices.getSize() != 0) { int idx = indices.get(0) - 1; if (n % N_PRINT == 0) - std::cout << t << " (" << idx << ") actuation data for '" << muscle->getName() << "' found: " << _muscle_act[idx] << std::endl; + std::cout << "[" << (1.e3 * clock() - ts_start) / CLOCKS_PER_SEC << "ms] " << t << " (" << idx << ") actuation data for '" << muscle->getName() << "' found: " << _muscle_act[idx] << std::endl; if (_muscle_act[idx] > 1.0) { std::cerr << "Error: muscle actuation larger than 1.0 (" << _muscle_act[idx] << "), truncating" << std::endl; @@ -41,8 +46,6 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK std::cerr << "Error: no actuation data for muscle '" << muscle->getName() << "' at time " << t << " found" << std::endl; continue; } - - //std::cout << " " << p.getName() << "(" << p.getIdx() << "/" << p.getCapacity() << ")" << std::endl; } n++; |