Our team is currently working on importing APDM IMU data into OpenSim 4.3. We noticed that our data rate does not match after performing the following step
Code: Select all
opensense -ReadAPDM exampleAPDM_Data.csv exampleAPDM_Settings.xml
Code: Select all
dataRate = 128; // Will fix after reading computing it from time column
This data rate of 128 Hz does not get overwritten by computation of the time column. This rate remains the same no matter the users input. The following is a suggested fix, maybe not the best way but it works
Code: Select all
// Calculating dataRate
std::getline(in_stream, line);
double firstTimeStep = std::stod(line,0)/1E6;
std::getline(in_stream, line);
double secondTimeStep = std::stod(line,0)/1E6;
dataRate = round(1 / (secondTimeStep - firstTimeStep));
The above code was added to the end of the if statement
Code: Select all
if (tokens[0] == "Format=7") {
Successfully tested with our 200 Hz data input.
Posting here as reference for users, GitHub issue has also been created https://github.com/opensim-org/opensim-core/issues/3283
Best regards,
Fouad