diff --git a/Examples/example_COM_analysis.ipynb b/Examples/example_COM_analysis.ipynb index 436df8fa..4fe5bdc8 100644 --- a/Examples/example_COM_analysis.ipynb +++ b/Examples/example_COM_analysis.ipynb @@ -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." ] @@ -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", @@ -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." ] }, { @@ -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." ] @@ -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. " ] }, { @@ -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, let’s compare the vertical forces results from the center of mass accelerations. To approximate these forces we will do a simple F = ma calculation." ] }, { @@ -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", diff --git a/UtilsDynamicSimulations/OpenSimAD/utilsOpenSimAD.py b/UtilsDynamicSimulations/OpenSimAD/utilsOpenSimAD.py index 5b6f5235..46753ab4 100644 --- a/UtilsDynamicSimulations/OpenSimAD/utilsOpenSimAD.py +++ b/UtilsDynamicSimulations/OpenSimAD/utilsOpenSimAD.py @@ -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 diff --git a/example_kinetics.py b/example_kinetics.py index 8403d2ae..79dde2c2 100644 --- a/example_kinetics.py +++ b/example_kinetics.py @@ -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' @@ -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]) diff --git a/requirements.txt b/requirements.txt index f5d92455..61b9e177 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,5 @@ requests casadi pyyaml joblib -cmake \ No newline at end of file +cmake +seaborn \ No newline at end of file