You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, many non-scripting OpenSim users may need to time-normalize the output motion/storage files and I think it would be great to provide a GUI script in Resources.zip\Code\GUI, something like this:
importorg.opensim.utilsasutilsimportosFC=-1# cutoff frequency for lowpass Butterworth filter (negative means no filter)N=101# number of frames for time normalization (Default = 101 (0-100%))# choose a file in GUIfullFileName=utils.FileUtils.getInstance().browseForFilename( \
utils.FileUtils.MotionFileFilter, 'Select a Motion or Storage File')
# separate directory, file name and the extension folderName=os.path.dirname(fullFileName)
fileName, fileExt=os.path.splitext( os.path.basename(fullFileName) )
outputName=os.path.join(folderName, fileName+'_resampled'+fileExt)
# read filedata=modeling.Storage(fullFileName)
# get first and last time framestf=data.getFirstTime()
tl=data.getLastTime()
ifFC>0:
# add pad to the signal and apply Butterworth filterrow=data.sizedata.pad( int(row/2) )
data.lowpassIIR(FC)
# data.lowpassFIR(4, FC)data.crop(tf,tl) # remove pad# time intervaldt=float(tl-tf)/(N-1)
# resample (normalize) to N points# data.resample(dt, 5)data.resampleLinear(dt)
data.print(outputName)
print(outputName)
print('Resampled Successfully.')
Thank you.
The text was updated successfully, but these errors were encountered:
Hi, many non-scripting OpenSim users may need to time-normalize the output motion/storage files and I think it would be great to provide a GUI script in
Resources.zip\Code\GUI
, something like this:Thank you.
The text was updated successfully, but these errors were encountered: