From 1e13a8b9b0f86909804ca3260d003df8c0d7710d Mon Sep 17 00:00:00 2001 From: Nicholas Bianco Date: Wed, 2 Oct 2024 10:27:18 -0700 Subject: [PATCH] Fix indexing typo and add more debug statements --- OpenSim/Analyses/Test/testOutputReporter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Analyses/Test/testOutputReporter.cpp b/OpenSim/Analyses/Test/testOutputReporter.cpp index 47bb36c027..e4118cca3e 100644 --- a/OpenSim/Analyses/Test/testOutputReporter.cpp +++ b/OpenSim/Analyses/Test/testOutputReporter.cpp @@ -211,20 +211,24 @@ void simulateMuscle( //========================================================================== // 5. Verify files were written with correct values //========================================================================== + log_info("Loading the results from file"); TimeSeriesTable tableD("testOutputReporter_Outputs.sto"); TimeSeriesTable_ tableV3("testOutputReporter_OutputsVec3.sto"); TimeSeriesTable_ tableSV("testOutputReporter_OutputsSpatialVec.sto"); + log_info("Indexing initial values"); double val_t0 = tableD.getIndependentColumn()[0]; const SimTK::Real& val_ke0 = tableD.getRowAtIndex(0)[0]; - const Vec3& val_omega0 = tableV3.getRowAtIndex(01)[1]; + const Vec3& val_omega0 = tableV3.getRowAtIndex(0)[1]; const SimTK::SpatialVec& val_jrf0 = tableSV.getRowAtIndex(0)[1]; + log_info("Checking initial values"); ASSERT_EQUAL(t0, val_t0, SimTK::Eps); ASSERT_EQUAL(ke0, val_ke0, SimTK::Eps); ASSERT_EQUAL(ang_acc0, val_omega0, SimTK::Eps); ASSERT_EQUAL(reaction0, val_jrf0, SimTK::Eps); + log_info("Indexing final values"); double val_tf = tableD.getIndependentColumn()[tableD.getNumRows() - 1]; const SimTK::Real& val_ke = tableD.getRowAtIndex(tableD.getNumRows() - 1)[0]; const Vec3& val_omega = tableV3.getRowAtIndex(tableV3.getNumRows() - 1)[1]; @@ -236,6 +240,7 @@ void simulateMuscle( auto ang_acc = ball->getAngularAccelerationInGround(state); auto reaction = slider->calcReactionOnChildExpressedInGround(state); + log_info("Checking final values"); ASSERT_EQUAL(state.getTime(), val_tf, SimTK::Eps); ASSERT_EQUAL(ke, val_ke, SimTK::Eps); ASSERT_EQUAL(ang_acc, val_omega, SimTK::Eps);