Skip to content

Commit 448a807

Browse files
authored
Merge pull request #4273 from opensim-org/example_2d_walking_final_time_fix
Fix inconsistency in final time and filtered coordinate data in `example2DWalking` and `example2DWalkingMetabolics`
2 parents 6265c5c + 6ef687a commit 448a807

7 files changed

Lines changed: 8 additions & 7 deletions

File tree

Bindings/Java/Matlab/examples/Moco/example2DWalking/example2DWalking.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
track.set_track_reference_position_derivatives(true);
9090
track.set_apply_tracked_states_to_guess(true);
9191
track.set_initial_time(0.0);
92-
track.set_final_time(0.47008941);
92+
track.set_final_time(0.470089);
9393
study = track.initialize();
9494
problem = study.updProblem();
9595

Bindings/Java/Matlab/examples/Moco/example2DWalking/example2DWalkingMetabolics.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
track.set_track_reference_position_derivatives(true);
109109
track.set_apply_tracked_states_to_guess(true);
110110
track.set_initial_time(0.0);
111-
track.set_final_time(0.47008941);
111+
track.set_final_time(0.470089);
112112

113113
% Call initialize() to get the internal MocoStudy. This will allow us to
114114
% make further modifications to the MocoProblem.

Bindings/Python/examples/Moco/example2DWalking/example2DWalking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
track.set_track_reference_position_derivatives(True)
9191
track.set_apply_tracked_states_to_guess(True)
9292
track.set_initial_time(0.0)
93-
track.set_final_time(0.47008941)
93+
track.set_final_time(0.470089)
9494
study = track.initialize()
9595
problem = study.updProblem()
9696

Bindings/Python/examples/Moco/example2DWalking/example2DWalkingMetabolics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
track.set_track_reference_position_derivatives(True)
110110
track.set_apply_tracked_states_to_guess(True)
111111
track.set_initial_time(0.0)
112-
track.set_final_time(0.47008941)
112+
track.set_final_time(0.470089)
113113

114114
# Call initialize() to get the internal MocoStudy. This will allow us to
115115
# make further modifications to the MocoProblem.
@@ -216,7 +216,7 @@
216216
# To report the COT we multiply the metabolic cost objective term by 10 because
217217
# it had been scaled by 0.1
218218
print(' ')
219-
print(f'The metabolic cost of transport is: {10*solution.getObjectiveTerm('met'):.3f} J/kg/m')
219+
print(f'The metabolic cost of transport is: {10*solution.getObjectiveTerm("met"):.3f} J/kg/m')
220220
print(' ')
221221

222222
# Visualize the result.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ performance and stability in wrapping solutions.
4747
- Fixed a compile-time issue where `OutputReporter` was using the `Model` API without having access to its definition.
4848
- Added `ScopeExit`, which is a lightweight C++-only class for calling a function/lambda when it destructs (similar to `std::experimental::scope_exit`).
4949
- Fixed a leak in `Model::extendConnectToModel` that can occur when an exception is thrown midway through model graph creation.
50+
- Fixed an issue where the final time used for `example2DWalking` and `example2DWalkingMetabolics` was inconsistent with the filtered coordinate reference data. (#4273)
5051
- Fixed an issue where `StdVectorDouble::get()` would return `java.lang.Double` in Matlab
5152
- Fixed an issue in the Java bindings where setting the `Manager::IntegratorMethod` via `setIntegratorMethod()` with an integer argument did not work. (#4277)
5253

OpenSim/Examples/Moco/example2DWalking/example2DWalking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ MocoSolution gaitTracking(double controlEffortWeight = 10,
8080
track.set_track_reference_position_derivatives(true);
8181
track.set_apply_tracked_states_to_guess(true);
8282
track.set_initial_time(0.0);
83-
track.set_final_time(0.47008941);
83+
track.set_final_time(0.470089);
8484
MocoStudy study = track.initialize();
8585
MocoProblem& problem = study.updProblem();
8686

OpenSim/Examples/Moco/example2DWalking/example2DWalkingMetabolics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void gaitTrackingMetabolics() {
118118
track.set_track_reference_position_derivatives(true);
119119
track.set_apply_tracked_states_to_guess(true);
120120
track.set_initial_time(0.0);
121-
track.set_final_time(0.47008941);
121+
track.set_final_time(0.470089);
122122
MocoStudy study = track.initialize();
123123
MocoProblem& problem = study.updProblem();
124124

0 commit comments

Comments
 (0)