-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix IDTool and IDSolver to account for extra q's in state (#2971)
* add test with a model with extra q slot (ThorascapularShoulderModel) * fix new test in testID. allow InverseDynamicsSolver to handle model with different number of q's and u's. fix InverseDyanmicsTool for models with extra (unused) q slots * update CHANGELOG.md for ID fix * int -> size_t * size_t -> int * one more size_t -> int * stack allocate coordinate functions * address comments from review by @aymanhab * add thoracoscapularmodel from shared folder to ID test * also account for if u's are in a different order (than q's or coordinate's order). covers when qdot != u. * size_t -> int * add testBallJoint for accounting for u and udot order in ID * variable renaming and documentation cleanup * also test that ID will throw if incorrect udot is used * one more documentation cleanup * Replace one letter variable names * Use log_cout and formatting instead of std::cout, also disable testBallJoint as flaky due to issues unrelated to the test contents * Clarify comments and language * Use const reference instead of an actual std::vector/copy as argument for the new method Co-authored-by: carmichaelong <carmichaelong@gmail.com> Co-authored-by: aymanhab <ahabib@stanford.edu>
- Loading branch information
1 parent
8de529b
commit 62205cd
Showing
9 changed files
with
5,580 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Applications/ID/test/ThorascapularShoulderModel_ID_static.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<OpenSimDocument Version="40000"> | ||
<InverseDynamicsTool name="DummyModel"> | ||
<!--Name of the directory where results are written. Be default this is the directory in which the setup file is be executed.--> | ||
<results_directory></results_directory> | ||
<!--Name of the .osim file used to construct a model.--> | ||
<model_file>ThoracoscapularShoulderModel.osim</model_file> | ||
<!--Time range over which the inverse dynamics problem is solved.--> | ||
<time_range> 0.01 0.06</time_range> | ||
<!--List of forces by individual or grouping name (e.g. All, actuators, muscles, ...) to be excluded when computing model dynamics. 'All' also excludes external loads added via 'external_loads_file'.--> | ||
<forces_to_exclude> Muscles</forces_to_exclude> | ||
<!--XML file (.xml) containing the external loads applied to the model as a set of ExternalForce(s).--> | ||
<external_loads_file /> | ||
<!--The name of the file containing coordinate data. Can be a motion (.mot) or a states (.sto) file.--> | ||
<coordinates_file>ThorascapularShoulderModel_static.mot</coordinates_file> | ||
<!--Low-pass cut-off frequency for filtering the coordinates_file data (currently does not apply to states_file or speeds_file). A negative value results in no filtering. The default value is -1.0, so no filtering.--> | ||
<lowpass_cutoff_frequency_for_coordinates>-1</lowpass_cutoff_frequency_for_coordinates> | ||
<!--Name of the storage file (.sto) to which the generalized forces are written.--> | ||
<output_gen_force_file>ThorascapularShoulderModel_ID_output.sto</output_gen_force_file> | ||
<!--List of joints (keyword All, for all joints) to report body forces acting at the joint frame expressed in ground.--> | ||
<joints_to_report_body_forces /> | ||
<!--Name of the storage file (.sto) to which the body forces at specified joints are written.--> | ||
<output_body_forces_file /> | ||
</InverseDynamicsTool> | ||
</OpenSimDocument> |
13 changes: 13 additions & 0 deletions
13
Applications/ID/test/ThorascapularShoulderModel_static.mot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Default_Position.mot | ||
version=1 | ||
nRows=6 | ||
nColumns=18 | ||
inDegrees=no | ||
endheader | ||
time ground_thorax_rot_x ground_thorax_rot_y ground_thorax_rot_z ground_thorax_tx ground_thorax_ty ground_thorax_tz clav_prot clav_elev scapula_abduction scapula_elevation scapula_upward_rot scapula_winging plane_elv shoulder_elv axial_rot elbow_flexion pro_sup | ||
0.01 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 | ||
0.02 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 | ||
0.03 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 | ||
0.04 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 | ||
0.05 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 | ||
0.06 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.