diff --git a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp index 81a70d33efb765024524bbc255f4c268141ed1d6..cf1c8de7761ce795fce2dc9064e7768a68793914 100644 --- a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp +++ b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp @@ -262,6 +262,7 @@ namespace armarx::viz layers.clear(); pulledUpdates.updateCounter = 0; pulledUpdates.updates.clear(); + updateResult = CoinVisualizerUpdateResult::SUCCESS; state = CoinVisualizerState::RUNNING; } break; @@ -290,13 +291,14 @@ namespace armarx::viz // We should restart the pull for updates so it can run in parallel updateResult = CoinVisualizerUpdateResult::WAITING; - storage->begin_pullUpdatesSince(pulledUpdates.updateCounter, callback); + LayerUpdates currentUpdates = pulledUpdates; + storage->begin_pullUpdatesSince(currentUpdates.updateCounter, callback); auto layerIDsBefore = getLayerIDs(); IceUtil::Time time_afterPull = IceUtil::Time::now(); - for (LayerUpdate const& update : pulledUpdates.updates) + for (LayerUpdate const& update : currentUpdates.updates) { apply(update); } @@ -310,11 +312,11 @@ namespace armarx::viz IceUtil::Time time_afterLayersChanged = IceUtil::Time::now(); // Most of the time is spent in apply - ARMARX_INFO << "Updates: " << pulledUpdates.updates.size() - << "\nTotal: " << (time_afterLayersChanged - time_start).toMilliSecondsDouble() - << "\nPull: " << (time_afterPull - time_start).toMilliSecondsDouble() - << "\nApply: " << (time_afterApply - time_afterPull).toMilliSecondsDouble() - << "\nLayers: " << (time_afterLayersChanged - time_afterApply).toMilliSecondsDouble(); + // ARMARX_INFO << "Updates: " << pulledUpdates.updates.size() + // << "\nTotal: " << (time_afterLayersChanged - time_start).toMilliSecondsDouble() + // << "\nPull: " << (time_afterPull - time_start).toMilliSecondsDouble() + // << "\nApply: " << (time_afterApply - time_afterPull).toMilliSecondsDouble() + // << "\nLayers: " << (time_afterLayersChanged - time_afterApply).toMilliSecondsDouble(); } break; case CoinVisualizerUpdateResult::WAITING: diff --git a/source/RobotAPI/components/ArVizExample/ArVizExample.cpp b/source/RobotAPI/components/ArVizExample/ArVizExample.cpp index b112aeac760fa1c24b593c6fa807e2db63faed62..11e153134e6d67ba0a09c25f92e5e2fbcee5beec 100644 --- a/source/RobotAPI/components/ArVizExample/ArVizExample.cpp +++ b/source/RobotAPI/components/ArVizExample/ArVizExample.cpp @@ -709,12 +709,12 @@ void fillPointsLayer(viz::Layer& layer, double timeInSeconds) viz::ColoredPoint p; p.color = viz::Color{255, 255, 0, 255}; - for (int x = -400; x <= 400; ++x) + for (int x = -200; x <= 200; ++x) { p.x = 2.0f * x; double phase = timeInSeconds + x / 50.0f; double heightT = std::max(0.0, std::min(0.5 * (1.0 + std::sin(phase)), 1.0)); - for (int y = -400; y <= 400; ++y) + for (int y = -200; y <= 200; ++y) { p.y = 2.0f * y; p.z = 100.0 * heightT;