gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.19k stars 480 forks source link

World::GetRealTime does not advance when simulation is paused, and World::Step() is called one step at a time. #1193

Open osrf-migration opened 10 years ago

osrf-migration commented 10 years ago

Original report (archived issue) by John Hsu (Bitbucket: hsu, GitHub: hsu).


example test that leads to failure against gazebo_3.0 branch:

$ hg diff test/integration/physics.cc 
diff -r a2ce834a0060a533486a5c5645918a55f22dd3de test/integration/physics.cc
--- a/test/integration/physics.cc   Tue May 20 15:20:15 2014 -0700
+++ b/test/integration/physics.cc   Tue May 20 18:05:57 2014 -0700
@@ -71,6 +71,15 @@
   EXPECT_GT(dt, 0);
   t = world->GetSimTime().Double();
   EXPECT_GT(t, 0.99*dt*static_cast<double>(steps+1));
+
+  // test World::GetRealTime()
+  world->SetPaused(true);
+  double startRealTime = world->GetRealTime().Double();
+  for(unsigned int i = 0; i < 2000; ++i)
+  {
+    world->Step(1);
+    EXPECT_GT(world->GetRealTime().Double(), startRealTime);
+  }
 }

 TEST_P(PhysicsTest, EmptyWorld)

Documentation on what World::GetRealTime() should do does not specify if this is the expected behavior.

osrf-migration commented 10 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I pushed the failing test to branch issue_1193 in c7b54eceb8be11c24292370b67e432b997802d91.

osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).