...
Example code for using the C3DFileAdapter in C++ is found below. This code is part of a test script that runs the C3D reader and checks for correct values.
Expand |
---|
...
Importing Force
...
Data: COP
...
and NaNs
When computing Center of Pressure you import your force data, you can use the origin of the force plate or center of pressure (COP) , often the numerical value will be computed as NaN (Not A Number). NaN values occur to express the forces. The C3DFileAdapter includes an input parameter (ForceLocation) that allows you to choose OriginOfForcePlate or CenterOfPressure. Using the COP is helpful for visualization, but can lead to NaN values. In particular, when the force values become go to zero. Typically, most COP computation systems include some cut-off value that zeros all forces below a threshold, which stops these NaNs from occurring. OpenSim does not do any processing of your force or COP and so when converting your C3D files to mot files, you may encounter NaN values. the COP value is undefined (NaN). This is problematic during Inverse Dynamics analysis as you will get all NaN values for the output moments. This is because OpenSim splines the force and COP data before computing joint moments and don't know how to deal with NaN valuesthe splines are undefined in the presence of NaNs for your input data. If you find that your mot files are containing NaNs for COPs after conversion, you don't necessarily have to perform additional computations to remove the NaNs. The C3DFileAdapter includes an input parameter that determines how the forces are represented, so you can use the appropriate input parameter to have the forces and moments represented at the origin of the plate, rather than as a COP. This negates any chance for NaNs being included in your forces OriginOfForcePlate flag when you import your C3D data.
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Next: Tools for Preparing Motion Data Previous: Storage (.sto) Files Home: Preparing Your Data |
...