Skip to content

Commit

Permalink
a bunch of stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinefalisse committed Jul 17, 2023
1 parent 3bcdedd commit 49639d6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
14 changes: 7 additions & 7 deletions Examples/example_COM_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"source": [
"# Jumping technique analysis\n",
"\n",
"In this example, we will compare different jumping techniques measured using OpenCap.\n",
"In this example, we will compare different jumping techniques using data measured with OpenCap.\n",
"\n",
"We will first set up our environment, then download and process OpenCap data, and finally analyze some results."
]
Expand Down Expand Up @@ -63,7 +63,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If the block above runs successfully, you should see that it installed several Python packages with a message like:\n",
"If the block above runs successfully, you should see that it installed several Python packages. You should get a message looking like this:\n",
"\n",
"```\n",
"Successfully installed asttokens-2.2.1 backcall-0.2.0 casadi-3.6.3 cmake-3.26.4 contourpy-1.1.0 cycler-0.11.0 decorator-5.1.1 evdev-1.6.1 executing-1.2.0 fonttools-4.41.0 ipython-8.14.0 jedi-0.18.2 joblib-1.3.1 kiwisolver-1.4.4 maskpass-0.3.6 matplotlib-3.7.2 matplotlib-inline-0.1.6 packaging-23.1 pandas-2.0.3 parso-0.8.3 pexpect-4.8.0 pickleshare-0.7.5 pillow-10.0.0 prompt-toolkit-3.0.39 ptyprocess-0.7.0 pure-eval-0.2.2 pygments-2.15.1 pynput-1.7.6 pyparsing-3.0.9 python-dateutil-2.8.2 python-decouple-3.8 python-xlib-0.33 pytz-2023.3 pyyaml-6.0 scipy-1.11.1 six-1.16.0 stack-data-0.6.2 traitlets-5.9.0 tzdata-2023.3 wcwidth-0.2.6\n",
Expand Down Expand Up @@ -109,7 +109,7 @@
"source": [
"# Download data\n",
"\n",
"First, enter the session ID of the OpenCap data collection containing the jumping data (3ef5cfad-cf8a-420b-af15-2d833a33cfb8). This will be used to download the data directly from OpenCap. Then, run the block of code to download the data."
"First, enter the session ID of the OpenCap data collection containing the jumping data. This will be used to download the data directly from OpenCap. Then, run the following block of code to download the data."
]
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@
"source": [
"# Process data\n",
"\n",
"Now that the data has been downloaded, you can extract kinematic parameters using OpenSim. To do so, we use a class named `utilsKinematics.py`. Take a look at the `utilsKinematics.py` code in the github repository to see all the things you can do.\n",
"Now that the data has been downloaded, you can extract kinematic parameters using OpenSim. To do so, we use a class named `utilsKinematics.py`. Take a look at the `utilsKinematics.py` code in the github repo to see all the available functions.\n",
"\n",
"For this example, we will extract the center of mass values, speeds, and accelerations of the different trials."
]
Expand Down Expand Up @@ -167,7 +167,7 @@
"source": [
"# Analyze data (part 1)\n",
"\n",
"Let's now compare the center of mass values and speeds between our two trials. Waht do you see? Does it make sense?"
"Let's now compare the center of mass values and speeds between our two trials. "
]
},
{
Expand Down Expand Up @@ -217,7 +217,7 @@
"source": [
"# Analyze data (part 2)\n",
"\n",
"Finally, let's compare the vertical forces results from the center of mass accelerations (F=ma). What do you see? Does it make sense? "
"Finally, lets compare the vertical forces results from the center of mass accelerations. To approximate these forces we will do a simple F = ma calculation."
]
},
{
Expand Down Expand Up @@ -261,7 +261,7 @@
"Version 1.0\n",
"\n",
"Creators: Antoine Falisse, Scott Uhlrich.\n",
"Last Updated on July 14, 2023\n",
"Last Updated on July 17, 2023\n",
"\n",
"You can also find a non-Colab version of this script [here](https://github.com/stanfordnmbl/opencap-processing/blob/main/Examples/example_COM_analysis.py)\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion UtilsDynamicSimulations/OpenSimAD/utilsOpenSimAD.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def filterNumpyArray(array, time, cutoff_frequency=6, order=4):
arrayFilt = signal.filtfilt(
b, a, array, axis=0,
padtype='odd', padlen=3*(max(len(b),len(a))-1))
print('numpy array filtered at {}Hz.'.format(cutoff_frequency))
# print('numpy array filtered at {}Hz.'.format(cutoff_frequency))

return arrayFilt

Expand Down
6 changes: 2 additions & 4 deletions example_kinetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
# Select which example you would like to run.
session_type = 'overground' # Options are 'overground' and 'treadmill'.
session_id = "4d5c3eb1-1a59-4ea1-9178-d3634610561c"
case = '10' # Change this to compare across settings.
case = '0' # Change this to compare across settings.
# Options are 'squat', 'STS', and 'jump'.
if session_type == 'overground':
trial_name = 'STS'
Expand Down Expand Up @@ -182,12 +182,10 @@
motion_type, time_window, repetition,
treadmill_speed)

settings['torque_driven_model'] = True

# %% Simulation.
run_tracking(baseDir, dataFolder, session_id, settings, case=case,
solveProblem=solveProblem, analyzeResults=analyzeResults)

# %% Plots.
# To compare different cases, add to the cases list, eg cases=['0','1'].
plotResultsOpenSimAD(dataFolder, session_id, trial_name, settings, cases=[case, '11'], mainPlots=False)
plotResultsOpenSimAD(dataFolder, session_id, trial_name, settings, cases=[case])
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ requests
casadi
pyyaml
joblib
cmake
cmake
seaborn

0 comments on commit 49639d6

Please sign in to comment.