Page History
...
Learn More and Future Work
Importing APDM Sensor Data
Anchor | ||||
---|---|---|---|---|
|
Typically, APDM exports a trial as a .h5 file and as a .csv ASCII text file that is comma delimited, grouped in order by sensor. The OpenSense APDM Reader can only read CSV file types.
To read the APDM CSV file, you must create a file that associates the column labels in the APDM .csv file with an OpenSim model body segment. You can open and edit this file in any text editor. In this settings/XML file you specify the following information:
- <ExperimentalSensor name> A string to identify the specific column in the APDM sensor file. In our example, the first sensor uses the column name "Trunk".
- <name_in_model> The corresponding name of the sensor in the OpenSim Model. The first sensor is associated with the torso_imu segment of the model.
An example Download an example APDM Settings file for APDM sensors can be Downloaded here. and a corresponding example APDM sensor data. You can open and edit this file in any text editor. A snippet of the Settings file is shown below:
Matlab commands to create an orientations file from APDM IMU sensor data
...
Code Block |
---|
% Import the OpenSim libraries import org.opensim.modeling.*; % Define the trial name trialName = 'myAPDMFileexampleAPDM_Data.csv'; % Create an APDMDataReader and supply the settings file that maps IMUs to your model apdmSettings = APDMDataReaderSettings('myAPDMMappingsexampleAPDM_Settings.xml'); myAPDMDataReader = APDMDataReader(apdmSettings); % Read the quaternion data and write it to a STO file for use in OpenSense workflow tables = myAPDMDataReader.read( trialName ); quaternionTable = myAPDMDataReader.getOrientationsTable(tables); STOFileAdapterQuaternion.write(quaternionTable, strrep(trialName,'.csv', '_orientations.sto') ); |
...
To use the OpenSense APDM command-line tool to read in the APDM data and export an orientations .sto file to use in OpenSense, you would use the below call.
Code Block |
---|
>> opensense -ReadAPDM myAPDFileexampleAPDM_Data.csv myAPDMMappingsexampleAPDM_Settings.xml |
Future Work
...