From 3b04ab9ee1c62a70e6bc1d11e2b5a34c8672ff9a Mon Sep 17 00:00:00 2001 From: Fabian Reister <fabian.reister@kit.edu> Date: Wed, 12 May 2021 17:04:26 +0200 Subject: [PATCH] deleting files --- .../server/localization/Visu.cpp | 170 ------------------ .../server/localization/Visu.h | 101 ----------- 2 files changed, 271 deletions(-) delete mode 100644 source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.cpp delete mode 100644 source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.h diff --git a/source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.cpp b/source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.cpp deleted file mode 100644 index d8ad38bbc..000000000 --- a/source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.cpp +++ /dev/null @@ -1,170 +0,0 @@ -#include "Visu.h" -#include "ArmarXCore/core/logging/Logging.h" -#include "ArmarXCore/core/time/CycleUtil.h" - -#include <algorithm> - -#include <SimoxUtility/math/pose.h> - -#include <ArmarXCore/core/time/TimeUtil.h> - -#include <RobotAPI/libraries/ArmarXObjects/ObjectFinder.h> - -#include "Segment.h" - -namespace armarx::armem::server::obj::articulated_object_instance -{ - - void Visu::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) - { - defs->optional(p.enabled, prefix + "enabled", - "Enable or disable visualization of objects."); - defs->optional(p.frequencyHz, prefix + "frequenzyHz", - "Frequency of visualization."); - } - - - viz::Layer Visu::visualizeProvider( - const std::string& providerName, - const armarx::armem::articulated_object::ArticulatedObjects& objects) const - { - viz::Layer layer = arviz.layer(providerName); - - visualizeRobots(layer, objects); - - return layer; - } - - - void Visu::visualizeR(viz::Layer& layer, const armarx::armem::articulated_object::ArticulatedObjects& objects) const - { - const auto visualizeObject = [&](const armarx::armem::articulated_object::ArticulatedObject & obj) - { - - const auto xmlPath = obj.description.xml.serialize(); - - // clang-format off - auto robot = viz::Robot(obj.description.name) - // .file(xmlPath.package, xmlPath.path) - .file("ArmarXObjects", "./data/ArmarXObjects/Environment/mobile-kitchen/dishwasher-only/dishwasher.xml") - .joints(obj.config.jointMap) - .pose(obj.config.globalPose); - - robot.useFullModel(); - // clang-format on - - layer.add(robot); - }; - - std::for_each(objects.begin(), objects.end(), visualizeObject); - - } - - void Visu::init() - { - updateTask = new SimpleRunningTask<>([this]() - { - this->visualizeRun(); - }); - updateTask->start(); - } - - - // void Visu::RemoteGui::setup(const Visu& visu) - // { - // using namespace armarx::RemoteGui::Client; - - // enabled.setValue(visu.enabled); - // inGlobalFrame.setValue(visu.inGlobalFrame); - // alpha.setRange(0, 1.0); - // alpha.setValue(visu.alpha); - // alphaByConfidence.setValue(visu.alphaByConfidence); - // oobbs.setValue(visu.oobbs); - // objectFrames.setValue(visu.objectFrames); - // { - // float max = 10000; - // objectFramesScale.setRange(0, max); - // objectFramesScale.setDecimals(2); - // objectFramesScale.setSteps(int(10 * max)); - // objectFramesScale.setValue(visu.objectFramesScale); - // } - - // GridLayout grid; - // int row = 0; - // grid.add(Label("Enabled"), {row, 0}).add(enabled, {row, 1}); - // row++; - // grid.add(Label("Global Frame"), {row, 0}).add(inGlobalFrame, {row, 1}); - // row++; - // grid.add(Label("Alpha"), {row, 0}).add(alpha, {row, 1}, {1, 3}); - // row++; - // grid.add(Label("Alpha by Confidence"), {row, 0}).add(alphaByConfidence, {row, 1}); - // row++; - // grid.add(Label("OOBB"), {row, 0}).add(oobbs, {row, 1}); - // row++; - // grid.add(Label("Object Frames"), {row, 0}).add(objectFrames, {row, 1}); - // grid.add(Label("Scale:"), {row, 2}).add(objectFramesScale, {row, 3}); - // row++; - - // group.setLabel("Visualization"); - // group.addChild(grid); - // } - - // void Visu::RemoteGui::update(Visu& visu) - // { - // visu.enabled = enabled.getValue(); - // visu.inGlobalFrame = inGlobalFrame.getValue(); - // visu.alpha = alpha.getValue(); - // visu.alphaByConfidence = alphaByConfidence.getValue(); - // visu.oobbs = oobbs.getValue(); - // visu.objectFrames = objectFrames.getValue(); - // visu.objectFramesScale = objectFramesScale.getValue(); - // } - - - void Visu::visualizeRun() - { - CycleUtil cycle(static_cast<int>(1000 / p.frequencyHz)); - while (updateTask && not updateTask->isStopped()) - { - { - // std::scoped_lock lock(visuMutex); - ARMARX_IMPORTANT << "Update task"; - - if (p.enabled) - { - // TIMING_START(Visu); - - const auto articulatedObjects = segment.getArticulatedObjects(); - - ARMARX_INFO << "Found " << articulatedObjects.size() << " articulated objects"; - - viz::Layer layer = arviz.layer("ArticulatedObjectInstances"); - - ARMARX_INFO << "visualizing objects"; - visualizeObjects(layer, articulatedObjects); - - ARMARX_INFO << "Committing objects"; - - arviz.commit({layer}); - - ARMARX_INFO << "Done committing"; - - - // TIMING_END_STREAM(Visu, ARMARX_VERBOSE); - - // if (debugObserver) - // { - // debugObserver->setDebugChannel(getName(), - // { - // { "t Visualize [ms]", new Variant(Visu.toMilliSecondsDouble()) }, - // }); - // } - } - } - cycle.waitForCycleDuration(); - } - } - - - -} // namespace armarx::armem::server::obj::articulated_object_instance diff --git a/source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.h b/source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.h deleted file mode 100644 index 54aea5e09..000000000 --- a/source/RobotAPI/libraries/armem_robot_state/server/localization/Visu.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @author Fabian Reister ( fabian dot reister at kit dot edu ) - * @date 2021 - * @copyright http://www.gnu.org/licenses/gpl-2.0.txt - * GNU General Public License - */ - -#pragma once - -#include <ArmarXCore/core/logging/Logging.h> -#include <ArmarXCore/core/services/tasks/TaskUtil.h> - -// #include <ArmarXGui/libraries/RemoteGui/Client/Widgets.h> - -#include <RobotAPI/components/ArViz/Client/Client.h> - -#include <RobotAPI/libraries/armem_objects/types.h> - - -namespace armarx -{ - class ObjectFinder; -} -namespace armarx::armem::server::obj::articulated_object_instance -{ - class Segment; - - /** - * @brief Models decay of object localizations by decreasing the confidence - * the longer the object was not localized. - */ - class Visu : public armarx::Logging - { - public: - - Visu(const viz::Client& arviz, const Segment& segment): arviz(arviz), segment(segment) {} - - void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix = "visu."); - - void init(); - - protected: - viz::Layer visualizeProvider( - const std::string& providerName, - const armarx::armem::articulated_object::ArticulatedObjects& objects - ) const; - - void visualizeObjects( - viz::Layer& layer, - const armarx::armem::articulated_object::ArticulatedObjects& objects - ) const; - - - private: - viz::Client arviz; - const Segment& segment; - - struct Properties - { - bool enabled = true; - float frequencyHz = 25; - } p; - - - SimpleRunningTask<>::pointer_type updateTask; - void visualizeRun(); - - // struct RemoteGui - // { - // armarx::RemoteGui::Client::GroupBox group; - - // armarx::RemoteGui::Client::CheckBox enabled; - - // armarx::RemoteGui::Client::CheckBox inGlobalFrame; - // armarx::RemoteGui::Client::FloatSlider alpha; - // armarx::RemoteGui::Client::CheckBox alphaByConfidence; - // armarx::RemoteGui::Client::CheckBox oobbs; - // armarx::RemoteGui::Client::CheckBox objectFrames; - // armarx::RemoteGui::Client::FloatSpinBox objectFramesScale; - - // // void setup(const Visu& visu); - // // void update(Visu& visu); - // }; - - }; - -} // namespace armarx::armem::server::obj::articulated_object_instance -- GitLab