diff --git a/source/RobotAPI/components/ArViz/ArVizStorage.cpp b/source/RobotAPI/components/ArViz/ArVizStorage.cpp index 1fbb408ccc47d4aaea245b50a8b0da3adbd302cf..3891d216e8f43d90e59f45ad46ef9ea270a64ad7 100644 --- a/source/RobotAPI/components/ArViz/ArVizStorage.cpp +++ b/source/RobotAPI/components/ArViz/ArVizStorage.cpp @@ -205,6 +205,14 @@ namespace armarx return result; } + viz::data::LayerUpdates ArVizStorage::pullUpdatesSinceAndSendInteractions( + Ice::Long revision, viz::data::InteractionFeedbackSeq const& interactions, const Ice::Current& c) + { + // TODO: Implement storing the interactions somewhere + + return pullUpdatesSince(revision, c); + } + void ArVizStorage::record() { while (!recordingTask->isStopped()) diff --git a/source/RobotAPI/components/ArViz/ArVizStorage.h b/source/RobotAPI/components/ArViz/ArVizStorage.h index 02ebc981525bdc26ce277867950e79bbed39d17a..69299fb6ee451c28084ca4b27e1985dc0034336b 100644 --- a/source/RobotAPI/components/ArViz/ArVizStorage.h +++ b/source/RobotAPI/components/ArViz/ArVizStorage.h @@ -86,6 +86,10 @@ namespace armarx // StorageInterface interface viz::data::LayerUpdates pullUpdatesSince(Ice::Long revision, const Ice::Current&) override; + viz::data::LayerUpdates pullUpdatesSinceAndSendInteractions( + Ice::Long revision, + viz::data::InteractionFeedbackSeq const& interactions, + const Ice::Current&) override; std::string startRecording(std::string const& prefix, const Ice::Current&) override; void stopRecording(const Ice::Current&) override; viz::data::RecordingSeq getAllRecordings(const Ice::Current&) override; diff --git a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp index 2c5ab83a79ff650f27d4a5691c66aeac5d0bb06c..f1675bdd2695d06762f120677b071ec1e5e7c5e8 100644 --- a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp +++ b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp @@ -95,7 +95,7 @@ namespace armarx::viz callbackData = new CoinVisualizerWrapper; callbackData->this_ = this; - callback = newCallback_StorageInterface_pullUpdatesSince(callbackData, + callback = newCallback_StorageInterface_pullUpdatesSinceAndSendInteractions(callbackData, &CoinVisualizerWrapper::onUpdateSuccess, &CoinVisualizerWrapper::onUpdateFailure); @@ -385,8 +385,8 @@ namespace armarx::viz storage = stateStorage; root->removeAllChildren(); layers.data.clear(); - edUpdates.revision = 0; - edUpdates.updates.clear(); + pulledUpdates.revision = 0; + pulledUpdates.updates.clear(); updateResult = CoinVisualizerUpdateResult::SUCCESS; state = CoinVisualizerState::RUNNING; } @@ -417,10 +417,8 @@ namespace armarx::viz data::LayerUpdates currentUpdates = pulledUpdates; updateResult = CoinVisualizerUpdateResult::WAITING; timing.waitStart = time_start; - storage->begin_pullUpdatesSince(currentUpdates.revision, callback); - - // TODO: Also send the interaction feedback to the storage - // Would be best to do it in a single network call + storage->begin_pullUpdatesSinceAndSendInteractions( + currentUpdates.revision, interactionFeedbackBuffer, callback); // Clear interaction feedback buffer after it has been sent interactionFeedbackBuffer.clear(); diff --git a/source/RobotAPI/components/ArViz/Coin/Visualizer.h b/source/RobotAPI/components/ArViz/Coin/Visualizer.h index 0581a386915ac39af0de6c4cf92262ff5d09b8a0..cffa7eb0c6d3b612f1e009d149d8046b1fb4a39c 100644 --- a/source/RobotAPI/components/ArViz/Coin/Visualizer.h +++ b/source/RobotAPI/components/ArViz/Coin/Visualizer.h @@ -247,7 +247,7 @@ namespace armarx::viz void onUpdateSuccess(data::LayerUpdates const& updates); void onUpdateFailure(Ice::Exception const& ex); IceUtil::Handle<CoinVisualizerWrapper> callbackData; - armarx::viz::Callback_StorageInterface_pullUpdatesSincePtr callback; + armarx::viz::Callback_StorageInterface_pullUpdatesSinceAndSendInteractionsPtr callback; std::mutex storageMutex; viz::StorageInterfacePrx storage; diff --git a/source/RobotAPI/interface/ArViz/Component.ice b/source/RobotAPI/interface/ArViz/Component.ice index 6a855c9344eea0f901fbc33e03dcececed41f1e4..8972819eaa75a48063ac67234dc2f854caaecc58 100644 --- a/source/RobotAPI/interface/ArViz/Component.ice +++ b/source/RobotAPI/interface/ArViz/Component.ice @@ -90,6 +90,9 @@ interface StorageInterface { data::LayerUpdates pullUpdatesSince(long revision); + data::LayerUpdates pullUpdatesSinceAndSendInteractions( + long revision, data::InteractionFeedbackSeq interactions); + string startRecording(string prefix); void stopRecording(); diff --git a/source/RobotAPI/interface/ArViz/Elements.ice b/source/RobotAPI/interface/ArViz/Elements.ice index 8b7aa4db0421cac22c9e1a5d582337323b8534eb..550f75bbff5d8e261ac1a4b7a6b5e36c4675f4fa 100644 --- a/source/RobotAPI/interface/ArViz/Elements.ice +++ b/source/RobotAPI/interface/ArViz/Elements.ice @@ -99,6 +99,8 @@ module data GlobalPose chosenPose; }; + sequence<InteractionFeedback> InteractionFeedbackSeq; + module ElementFlags { const int NONE = 0;