diff options
author | Tobias Klauser <tobias.klauser@uzh.ch> | 2013-01-28 16:15:50 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-01-28 16:33:08 +0100 |
commit | d2fb8067167785b299482d247aaf90a35f55b62c (patch) | |
tree | d12fc756e9fecf935cbc46e1d6a3f89895868049 /LocomotorPrimitivesController.cpp | |
parent | e5e089fe6c136d3962a066f9a8c7b56009459b16 (diff) |
LocomotorPrimitives: Switch to using Logger class for logging
Diffstat (limited to 'LocomotorPrimitivesController.cpp')
-rw-r--r-- | LocomotorPrimitivesController.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/LocomotorPrimitivesController.cpp b/LocomotorPrimitivesController.cpp index 27ac205..0bdaf81 100644 --- a/LocomotorPrimitivesController.cpp +++ b/LocomotorPrimitivesController.cpp @@ -2,14 +2,11 @@ #include "LocomotorPrimitivesController.h" -#define VERBOSE 1 - -// XXX -extern clock_t ts_start; - static const double TIME_DAMP = 0.1; static const unsigned int N_PRINT = 1000; +static Logger &logger = Logger::getInstance(); + int LocomotorPrimitivesController::checkControls() { const int act_set_siz = getActuatorSet().getSize(); @@ -22,7 +19,7 @@ int LocomotorPrimitivesController::checkControls() const OpenSim::Array<int> indices = _act.getColumnIndicesForIdentifier(muscle->getName()); if (indices.getSize() == 0) { - std::cerr << "Error: no actuation data for muscle '" << muscle->getName() << "' found" << std::endl; + logger.err("no actuation data for muscle '%s' found\n", muscle->getName().c_str()); ret--; } } @@ -52,10 +49,11 @@ 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 << "[" << (1.e3 * clock() - ts_start) / CLOCKS_PER_SEC << "ms] " << t << " (" << idx << ") actuation data for '" << muscle->getName() << "' found: " << _muscle_act[idx] << std::endl; + logger.log("%f (%d) actuation data for muscle '%s' found: %f\n", + t, idx, muscle->getName().c_str(), _muscle_act[idx]); if (_muscle_act[idx] > 1.0) { - std::cerr << "Error: muscle actuation larger than 1.0 (" << _muscle_act[idx] << "), truncating" << std::endl; + logger.err("muscle actuation larger than 1.0 (%f), truncating to 1.0\n", _muscle_act[idx]); _muscle_act[idx] = 1.0; } |