diff options
Diffstat (limited to 'LocomotorPrimitivesController.cpp')
-rw-r--r-- | LocomotorPrimitivesController.cpp | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/LocomotorPrimitivesController.cpp b/LocomotorPrimitivesController.cpp index 0f57111..d22ee71 100644 --- a/LocomotorPrimitivesController.cpp +++ b/LocomotorPrimitivesController.cpp @@ -1,59 +1,11 @@ #include <OpenSim/OpenSim.h> #include "LocomotorPrimitivesController.h" -#include "MuscleEMGProfile.h" #define VERBOSE 1 static const double TIME_DAMP = 0.1; -#if 0 -int LocomotorPrimitivesController::loadCsvData(const std::string &muscleName, const std::string &file) -{ - std::cout << ">> loading CSV data from " << file << std::endl; - std::ifstream data(file); - std::string line; - - std::cout << data.tellg() << std::endl; - - if (!data.is_open()) { - std::cerr << "Error loading CSV data from " << file << std::endl; - return -1; - } - - MuscleEMGProfile p(muscleName, 0); - - while (std::getline(data, line)) { - std::stringstream s(line); - std::string cell; - - int i = 0; - double x; - while (std::getline(s, cell, ',')) { - if (!isdigit(cell[0])) - continue; - - std::cout << "read cell(" << (i == 0 ? "x" : "y") << ") -> " << cell << std::endl; - double val = (double) atof(cell.c_str()); - - if (i == 1) - p.addData(x, val); - else - x = val; - - i = !i; - } - } - - data.close(); - - //_act.push_back(p); - std::cout << ">>> loaded EMG profile for " << p.getName() << ", " << p.getIdx() << "/" << p.getCapacity() << std::endl; - - return 0; -} -#endif - void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK::Vector &controls) const { double t = s.getTime(); @@ -96,7 +48,7 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK if (act > 0.0) last_twitch = t; - + //if (VERBOSE && act > 0.0) // std::cout << "(" << std::fixed << t << ") " << "v=" << std::fixed << v << ", act=" << std::fixed << act << std::endl; |