Skip to content

Commit 315d20c

Browse files
authored
Merge pull request #2202 from opensim-org/fix_invalid_time_in_marker_placer
Specify correct time for IK of the static pose
2 parents c96af3d + e683fc9 commit 315d20c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

OpenSim/Tools/MarkerPlacer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ bool MarkerPlacer::processModel(Model* aModel,
259259

260260
const auto avgRow = staticPoseTable.averageRow(_timeRange[0],
261261
_timeRange[1]);
262-
for(size_t r = staticPoseTable.getNumRows() - 1; r > 0; --r)
262+
for(size_t r = staticPoseTable.getNumRows(); r-- > 0; )
263263
staticPoseTable.removeRowAtIndex(r);
264-
staticPoseTable.updRowAtIndex(0) = avgRow;
264+
staticPoseTable.appendRow(_timeRange[0], avgRow);
265265

266266
OPENSIM_THROW_IF(!staticPoseTable.hasTableMetaDataKey("Units"),
267267
Exception,
@@ -294,6 +294,7 @@ bool MarkerPlacer::processModel(Model* aModel,
294294

295295
// Construct the system and get the working state when done changing the model
296296
SimTK::State& s = aModel->initSystem();
297+
s.updTime() = _timeRange[0];
297298

298299
// Create references and WeightSets needed to initialize InverseKinemaicsSolver
299300
Set<MarkerWeight> markerWeightSet;

0 commit comments

Comments
 (0)