Skip to content

Commit

Permalink
add pause key to example
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Oct 18, 2023
1 parent 58515af commit 07bdf59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions samples/maps_voxelmap_from_tum_dataset/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void TestVoxelMapFromTUM(
std::cout << "Close the window to exit" << std::endl;

size_t rawlogIndex = 0;
bool paused = false;

mrpt::Clock::time_point lastObsTim;

Expand All @@ -136,7 +137,7 @@ void TestVoxelMapFromTUM(
win.get3DSceneAndLock();

// Get and process one observation:
if (rawlogIndex < dataset.size())
if (rawlogIndex < dataset.size() && !paused)
{
mrpt::obs::CObservation3DRangeScan::Ptr obs;

Expand Down Expand Up @@ -184,7 +185,7 @@ void TestVoxelMapFromTUM(

// Update the voxel map visualization:
static int decimUpdateViz = 0;
if (decimUpdateViz++ > 10)
if (decimUpdateViz++ > 20)
{
decimUpdateViz = 0;
map.renderingOptions.generateFreeVoxels = false;
Expand All @@ -209,7 +210,7 @@ void TestVoxelMapFromTUM(

switch (k)
{
//
case ' ': paused = !paused; break;
};
}

Expand Down

0 comments on commit 07bdf59

Please sign in to comment.