opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
783 stars 317 forks source link

Computation of time frames to do InverseKinematics is off by 1 sometimes #518

Open aymanhab opened 9 years ago

aymanhab commented 9 years ago

This is a bug reported in 3.2 and can be reproduced in master. InverseKinematicsTool tries to compute number of frames to solve (unnecessarily as it can just iterate over what's available within the specified timerange) and it ends up computing Nframes = std::int((final_time-start_time)/dt)+1 where dt = 1/samplingFrequency in .trc file header, due to numerical round-off this can lead to missing last frame downstream.

chrisdembia commented 9 years ago

I think I have run into this issue! I agree with Ayman. I don't think there's a need to rely on samplingFrequency.

tkuchida commented 7 years ago

Also reported on the Forum (topic 8037).