@@ -59,7 +59,8 @@ BoxBounceWorld makeFourBoxBounceWorld(double pitch)
5959{
6060 auto world = World::create (" issue870_boxes" );
6161 world->setGravity (Eigen::Vector3d::Zero ());
62- world->setTimeStep (0.002 );
62+ // Use a small time step to keep the symmetric configuration stable.
63+ world->setTimeStep (0.0005 );
6364
6465 auto makeBoxSkeleton = [&](const std::string& name,
6566 bool weld,
@@ -176,7 +177,8 @@ TEST(Issue870, RotatedBoxesRemainSymmetricBetweenWeldedStops)
176177 const double softLimit = barrier + 1e-2 ; // allow tiny penetration tolerance
177178 // Run long enough to cover multiple bounces without letting numerical drift
178179 // dominate the signal.
179- const int steps = 900 ;
180+ // Keep total simulated time roughly consistent with the original test.
181+ const int steps = 3600 ;
180182
181183 double maxPosDiff = 0.0 ;
182184 double maxVelDiff = 0.0 ;
@@ -228,9 +230,9 @@ TEST(Issue870, RotatedBoxesRemainSymmetricBetweenWeldedStops)
228230
229231 // This test is sensitive to platform-specific collision/contact differences.
230232 // Use looser thresholds to guard against regressions while avoiding flakes.
231- EXPECT_LT (maxPosDiff, 1e-1 );
232- EXPECT_LT (maxVelDiff, 3e1 );
233- EXPECT_LT (maxSymmetryError, 2e0 );
233+ EXPECT_LT (maxPosDiff, 1e-5 );
234+ EXPECT_LT (maxVelDiff, 1e-5 );
235+ EXPECT_LT (maxSymmetryError, 1e-4 );
234236 EXPECT_LT (maxAbsPosition, softLimit);
235237}
236238
0 commit comments