diff --git a/source/RobotAPI/components/armem/client/CMakeLists.txt b/source/RobotAPI/components/armem/client/CMakeLists.txt index 160f90fffe1b32b2d68bce5076024397b0b81a00..284ce7a27afd70e99981da558c6c1e0c6be234c3 100644 --- a/source/RobotAPI/components/armem/client/CMakeLists.txt +++ b/source/RobotAPI/components/armem/client/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(ExampleMemoryClient) add_subdirectory(GraspProviderExample) -add_subdirectory(MemoryPlotter) +add_subdirectory(MemoryToDebugObserver) add_subdirectory(ObjectInstanceToIndex) add_subdirectory(RobotStatePredictionClientExample) add_subdirectory(SimpleVirtualRobot) diff --git a/source/RobotAPI/components/armem/client/MemoryPlotter/CMakeLists.txt b/source/RobotAPI/components/armem/client/MemoryPlotter/CMakeLists.txt deleted file mode 100644 index 401035be3d6e23d6b173d3211af36b6c60df1e51..0000000000000000000000000000000000000000 --- a/source/RobotAPI/components/armem/client/MemoryPlotter/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -armarx_component_set_name(MemoryPlotter) - -set(COMPONENT_LIBS - ArmarXCore - ArmarXCoreComponentPlugins - ArmarXGuiComponentPlugins - RobotAPICore RobotAPIInterfaces - armem -) - -set(SOURCES - MemoryPlotter.cpp -) - -set(HEADERS - MemoryPlotter.h -) - -armarx_add_component("${SOURCES}" "${HEADERS}") - -armarx_generate_and_add_component_executable() diff --git a/source/RobotAPI/components/armem/client/MemoryToDebugObserver/CMakeLists.txt b/source/RobotAPI/components/armem/client/MemoryToDebugObserver/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..77aeec9934ddfd5a85a6caba2544971d7272706f --- /dev/null +++ b/source/RobotAPI/components/armem/client/MemoryToDebugObserver/CMakeLists.txt @@ -0,0 +1,28 @@ +armarx_component_set_name(MemoryToDebugObserver) + +set(COMPONENT_LIBS + ArmarXCore + ArmarXCoreComponentPlugins + ArmarXGuiComponentPlugins + RobotAPICore RobotAPIInterfaces + armem +) + +set(SOURCES + Component.cpp +) + +set(HEADERS + Component.h +) + +armarx_add_component("${SOURCES}" "${HEADERS}") + +set(COMPONENT_INCLUDE RobotAPI/components/armem/client/MemoryToDebugObserver/Component.h) + +armarx_generate_and_add_component_executable( + COMPONENT_INCLUDE + "${CMAKE_CURRENT_LIST_DIR}/Component.h" + COMPONENT_CLASS_NAME + Component +) diff --git a/source/RobotAPI/components/armem/client/MemoryPlotter/MemoryPlotter.cpp b/source/RobotAPI/components/armem/client/MemoryToDebugObserver/Component.cpp similarity index 91% rename from source/RobotAPI/components/armem/client/MemoryPlotter/MemoryPlotter.cpp rename to source/RobotAPI/components/armem/client/MemoryToDebugObserver/Component.cpp index d292688d7c5dd2719759391c3d006424ec035c8a..6f7e64012f659eed95c363ebe14e070f78565c72 100644 --- a/source/RobotAPI/components/armem/client/MemoryPlotter/MemoryPlotter.cpp +++ b/source/RobotAPI/components/armem/client/MemoryToDebugObserver/Component.cpp @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @package RobotAPI::ArmarXObjects::MemoryPlotter + * @package RobotAPI::ArmarXObjects::MemoryToDebugObserver * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) * @date 2023 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt * GNU General Public License */ -#include "MemoryPlotter.h" +#include "Component.h" #include <ArmarXCore/core/time/Frequency.h> #include <ArmarXCore/core/time/Metronome.h> @@ -33,9 +33,8 @@ namespace armarx { - armarx::PropertyDefinitionsPtr - MemoryPlotter::createPropertyDefinitions() + Component::createPropertyDefinitions() { armarx::PropertyDefinitionsPtr defs = new ComponentPropertyDefinitions(getConfigIdentifier()); @@ -44,18 +43,18 @@ namespace armarx return defs; } - MemoryPlotter::MemoryPlotter() + Component::Component() { } std::string - MemoryPlotter::getDefaultName() const + Component::getDefaultName() const { - return "MemoryPlotter"; + return "MemoryToDebugObserver"; } void - MemoryPlotter::onInitComponent() + Component::onInitComponent() { DebugObserverComponentPluginUser::setDebugObserverBatchModeEnabled(true); @@ -84,28 +83,28 @@ namespace armarx } void - MemoryPlotter::onConnectComponent() + Component::onConnectComponent() { createRemoteGuiTab(); RemoteGui_startRunningTask(); - task = new RunningTask<MemoryPlotter>(this, &MemoryPlotter::runLoop); + task = new RunningTask<Component>(this, &Component::runLoop); task->start(); } void - MemoryPlotter::onDisconnectComponent() + Component::onDisconnectComponent() { task->stop(); } void - MemoryPlotter::onExitComponent() + Component::onExitComponent() { } void - MemoryPlotter::runLoop() + Component::runLoop() { Frequency frequency = Frequency::Hertz(30); Metronome metronome(frequency); @@ -179,7 +178,7 @@ namespace armarx }; void - MemoryPlotter::loopOnce() + Component::loopOnce() { Visitor visitor(getDebugObserverComponentPlugin()); @@ -240,7 +239,7 @@ namespace armarx } armem::client::Reader* - MemoryPlotter::getReader(const armem::MemoryID& memoryID, std::stringstream& log) + Component::getReader(const armem::MemoryID& memoryID, std::stringstream& log) { armem::MemoryID key = memoryID.getProviderSegmentID(); @@ -268,7 +267,7 @@ namespace armarx } void - MemoryPlotter::createRemoteGuiTab() + Component::createRemoteGuiTab() { using namespace armarx::RemoteGui::Client; @@ -281,7 +280,7 @@ namespace armarx } void - MemoryPlotter::RemoteGui_update() + Component::RemoteGui_update() { if (tab.rebuild.exchange(false)) { diff --git a/source/RobotAPI/components/armem/client/MemoryPlotter/MemoryPlotter.h b/source/RobotAPI/components/armem/client/MemoryToDebugObserver/Component.h similarity index 88% rename from source/RobotAPI/components/armem/client/MemoryPlotter/MemoryPlotter.h rename to source/RobotAPI/components/armem/client/MemoryToDebugObserver/Component.h index e60c3dae4e1404e63981aa41b64245f9c3e6edec..dc22c02dadf641e5fae6f00e91541f04a1c60c1d 100644 --- a/source/RobotAPI/components/armem/client/MemoryPlotter/MemoryPlotter.h +++ b/source/RobotAPI/components/armem/client/MemoryToDebugObserver/Component.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @package RobotAPI::ArmarXObjects::MemoryPlotter + * @package RobotAPI::ArmarXObjects::MemoryToDebugObserver * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) * @date 2023 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt @@ -22,7 +22,6 @@ #pragma once - #include <ArmarXCore/core/Component.h> #include <ArmarXCore/interface/observers/ObserverInterface.h> #include <ArmarXCore/libraries/ArmarXCoreComponentPlugins/DebugObserverComponentPlugin.h> @@ -45,25 +44,29 @@ namespace armarx aron::Path aronPath; }; + class MemoryToDebugObserver + { + }; + /** - * @defgroup Component-MemoryPlotter MemoryPlotter + * @defgroup Component-MemoryToDebugObserver MemoryToDebugObserver * @ingroup RobotAPI-Components * * Transfers data from the memory system to the DebugObserver, allowing to visualize them in * the LivePlotter. * - * @class MemoryPlotter - * @ingroup Component-MemoryPlotter - * @brief Implementation of \ref Component-MemoryPlotter. + * @class Component + * @ingroup Component-MemoryToDebugObserver + * @brief Implementation of \ref Component-MemoryToDebugObserver. */ - class MemoryPlotter : + class Component : virtual public armarx::Component, virtual public armarx::armem::ClientPluginUser, virtual public armarx::DebugObserverComponentPluginUser, virtual public armarx::LightweightRemoteGuiComponentPluginUser { public: - MemoryPlotter(); + Component(); /// @see armarx::ManagedIceObject::getDefaultName() std::string getDefaultName() const override; @@ -98,7 +101,7 @@ namespace armarx std::map<armem::MemoryID, armem::client::Reader> memoryReaders; - armarx::RunningTask<MemoryPlotter>::pointer_type task; + armarx::RunningTask<Component>::pointer_type task; struct RemoteGuiTab : RemoteGui::Client::Tab {