APDM Format 7 Data Rate

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Fouad Matari
Posts: 3
Joined: Mon Mar 12, 2018 7:57 am

APDM Format 7 Data Rate

Post by Fouad Matari » Tue Aug 23, 2022 10:25 am

Hi,

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
After a bit of digging around, we located the issue within APDMDataReader.cpp - Line 71

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

Tags:

POST REPLY