From 3018bc30045e6195f490ba26b49a471c14b2e250 Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Thu, 23 Apr 2020 10:57:30 +0200 Subject: [PATCH] Add component DebugDrawerToArViz --- source/RobotAPI/applications/CMakeLists.txt | 2 +- source/RobotAPI/components/CMakeLists.txt | 1 + .../DebugDrawerToArViz/CMakeLists.txt | 38 +++++ .../DebugDrawerToArViz/DebugDrawerToArViz.cpp | 36 ++++ .../DebugDrawerToArViz/DebugDrawerToArViz.h | 154 ++++++++++++++++++ .../DebugDrawerToArVizComponent.cpp | 69 ++++++++ .../DebugDrawerToArVizComponent.h | 89 ++++++++++ .../components/DebugDrawerToArViz/main.cpp | 32 ++++ .../DebugDrawerToArViz/test/CMakeLists.txt | 5 + .../test/DebugDrawerToArVizTest.cpp | 37 +++++ 10 files changed, 462 insertions(+), 1 deletion(-) create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/CMakeLists.txt create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.cpp create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.h create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.cpp create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.h create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/main.cpp create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/test/CMakeLists.txt create mode 100644 source/RobotAPI/components/DebugDrawerToArViz/test/DebugDrawerToArVizTest.cpp diff --git a/source/RobotAPI/applications/CMakeLists.txt b/source/RobotAPI/applications/CMakeLists.txt index b8d05894a..8af364a4a 100644 --- a/source/RobotAPI/applications/CMakeLists.txt +++ b/source/RobotAPI/applications/CMakeLists.txt @@ -52,4 +52,4 @@ add_subdirectory(MultiHandUnit) add_subdirectory(StatechartExecutorExample) -add_subdirectory(NaturalIKTest) \ No newline at end of file +add_subdirectory(NaturalIKTest) diff --git a/source/RobotAPI/components/CMakeLists.txt b/source/RobotAPI/components/CMakeLists.txt index 34bc50559..72d06605c 100644 --- a/source/RobotAPI/components/CMakeLists.txt +++ b/source/RobotAPI/components/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(units) add_subdirectory(ArViz) add_subdirectory(CyberGloveObserver) add_subdirectory(DebugDrawer) +add_subdirectory(DebugDrawerToArViz) add_subdirectory(DummyTextToSpeech) add_subdirectory(EarlyVisionGraph) add_subdirectory(FrameTracking) diff --git a/source/RobotAPI/components/DebugDrawerToArViz/CMakeLists.txt b/source/RobotAPI/components/DebugDrawerToArViz/CMakeLists.txt new file mode 100644 index 000000000..916f4381d --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/CMakeLists.txt @@ -0,0 +1,38 @@ +armarx_component_set_name("DebugDrawerToArViz") + + +set(COMPONENT_LIBS + ArmarXCore + + ${PROJECT_NAME}Interfaces + RobotAPIComponentPlugins +) + +set(SOURCES + DebugDrawerToArViz.cpp + DebugDrawerToArVizComponent.cpp +) +set(HEADERS + DebugDrawerToArViz.h + DebugDrawerToArVizComponent.h +) + + +armarx_add_component("${SOURCES}" "${HEADERS}") + +#find_package(MyLib QUIET) +#armarx_build_if(MyLib_FOUND "MyLib not available") +# all target_include_directories must be guarded by if(Xyz_FOUND) +# for multiple libraries write: if(X_FOUND AND Y_FOUND).... +#if(MyLib_FOUND) +# target_include_directories(DebugDrawerToArViz PUBLIC ${MyLib_INCLUDE_DIRS}) +#endif() + +# add unit tests +add_subdirectory(test) + + +armarx_component_set_name("DebugDrawerToArVizApp") +set(COMPONENT_LIBS DebugDrawerToArViz) +armarx_add_component_executable(main.cpp) + diff --git a/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.cpp b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.cpp new file mode 100644 index 000000000..602a4917e --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.cpp @@ -0,0 +1,36 @@ +/* + * 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/>. + * + * @package RobotAPI::ArmarXObjects::DebugDrawerToArViz + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2020 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "DebugDrawerToArViz.h" + + +namespace armarx +{ + + void DebugDrawerToArViz::setArViz(viz::Client arviz) + { + this->arviz = arviz; + } + + + +} diff --git a/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.h b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.h new file mode 100644 index 000000000..b243d6f23 --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArViz.h @@ -0,0 +1,154 @@ +/* + * 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/>. + * + * @package RobotAPI::ArmarXObjects::DebugDrawerToArViz + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2020 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#pragma once + + +#include <RobotAPI/interface/visualization/DebugDrawerInterface.h> +#include <RobotAPI/components/ArViz/Client/Client.h> + + +namespace armarx +{ + + /** + * @brief Passes updates to DebugDrawerInterface to ArViz. + */ + class DebugDrawerToArViz : + virtual public armarx::DebugDrawerInterface + { + public: + + void setArViz(viz::Client arviz) + { + this->arviz = arviz; + } + + + + // DebugDrawerInterface interface + public: + + void exportScene(const std::string& filename, const Ice::Current& = Ice::emptyCurrent) override; + void exportLayer(const std::string& filename, const std::string& layerName, const Ice::Current& = Ice::emptyCurrent) override; + + void setPoseVisu(const std::string& layer, const std::string& name, const PoseBasePtr& globalPose, const Ice::Current& = Ice::emptyCurrent) override; + void setScaledPoseVisu(const std::string& layer, const std::string& name, const PoseBasePtr& globalPose, Ice::Float scale, const Ice::Current& = Ice::emptyCurrent) override; + void setLineVisu(const std::string& layer, const std::string& name, const Vector3BasePtr& globalPosition1, const Vector3BasePtr& globalPosition2, Ice::Float lineWidth, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void setLineSetVisu(const std::string& layer, const std::string& name, const DebugDrawerLineSet& lineSet, const Ice::Current& = Ice::emptyCurrent) override; + void setBoxVisu(const std::string& layer, const std::string& name, const PoseBasePtr& globalPose, const Vector3BasePtr& dimensions, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void setTextVisu(const std::string& layer, const std::string& name, const std::string& text, const Vector3BasePtr& globalPosition, const DrawColor& color, Ice::Int size, const Ice::Current& = Ice::emptyCurrent) override; + void setSphereVisu(const std::string& layer, const std::string& name, const Vector3BasePtr& globalPosition, const DrawColor& color, Ice::Float radius, const Ice::Current& = Ice::emptyCurrent) override; + void setPointCloudVisu(const std::string& layer, const std::string& name, const DebugDrawerPointCloud& pointCloud, const Ice::Current& = Ice::emptyCurrent) override; + void setColoredPointCloudVisu(const std::string& layer, const std::string& name, const DebugDrawerColoredPointCloud& pointCloud, const Ice::Current& = Ice::emptyCurrent) override; + void set24BitColoredPointCloudVisu(const std::string& layer, const std::string& name, const DebugDrawer24BitColoredPointCloud& pointCloud, const Ice::Current& = Ice::emptyCurrent) override; + void setPolygonVisu(const std::string& layer, const std::string& name, const PolygonPointList& polygonPoints, const DrawColor& colorInner, const DrawColor& colorBorder, Ice::Float lineWidth, const Ice::Current& = Ice::emptyCurrent) override; + void setTriMeshVisu(const std::string& layer, const std::string& name, const DebugDrawerTriMesh& triMesh, const Ice::Current& = Ice::emptyCurrent) override; + void setArrowVisu(const std::string& layer, const std::string& name, const Vector3BasePtr& position, const Vector3BasePtr& direction, const DrawColor& color, Ice::Float length, Ice::Float width, const Ice::Current& = Ice::emptyCurrent) override; + void setCylinderVisu(const std::string& layer, const std::string& name, const Vector3BasePtr& globalPosition, const Vector3BasePtr& direction, Ice::Float length, Ice::Float radius, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void setCircleArrowVisu(const std::string& layer, const std::string& name, const Vector3BasePtr& globalPosition, const Vector3BasePtr& directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + + void setRobotVisu(const std::string& layer, const std::string& name, const std::string&, const std::string&, DrawStyle, const Ice::Current& = Ice::emptyCurrent) override; + void updateRobotPose(const std::string& layer, const std::string& name, const PoseBasePtr&, const Ice::Current& = Ice::emptyCurrent) override; + void updateRobotConfig(const std::string& layer, const std::string& name, const NameValueMap&, const Ice::Current& = Ice::emptyCurrent) override; + void updateRobotColor(const std::string& layer, const std::string& name, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void updateRobotNodeColor(const std::string& layer, const std::string& name, const std::string&, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void removeRobotVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + + void setPoseDebugLayerVisu(const std::string& name, const PoseBasePtr& globalPose, const Ice::Current& = Ice::emptyCurrent) override; + void setScaledPoseDebugLayerVisu(const std::string& name, const PoseBasePtr& globalPose, Ice::Float scale, const Ice::Current& = Ice::emptyCurrent) override; + void setLineDebugLayerVisu(const std::string& name, const Vector3BasePtr& globalPosition1, const Vector3BasePtr& globalPosition2, Ice::Float lineWidth, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void setLineSetDebugLayerVisu(const std::string& name, const DebugDrawerLineSet& lineSet, const Ice::Current& = Ice::emptyCurrent) override; + void setBoxDebugLayerVisu(const std::string& name, const PoseBasePtr& globalPose, const Vector3BasePtr& dimensions, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void setTextDebugLayerVisu(const std::string& name, const std::string& text, const Vector3BasePtr& globalPosition, const DrawColor& color, Ice::Int size, const Ice::Current& = Ice::emptyCurrent) override; + void setSphereDebugLayerVisu(const std::string& name, const Vector3BasePtr& globalPosition, const DrawColor& color, Ice::Float radius, const Ice::Current& = Ice::emptyCurrent) override; + void setPointCloudDebugLayerVisu(const std::string& name, const DebugDrawerPointCloud& pointCloud, const Ice::Current& = Ice::emptyCurrent) override; + void set24BitColoredPointCloudDebugLayerVisu(const std::string& name, const DebugDrawer24BitColoredPointCloud& pointCloud, const Ice::Current& = Ice::emptyCurrent) override; + void setPolygonDebugLayerVisu(const std::string& name, const PolygonPointList& polygonPoints, const DrawColor& colorInner, const DrawColor& colorBorder, Ice::Float lineWidth, const Ice::Current& = Ice::emptyCurrent) override; + void setTriMeshDebugLayerVisu(const std::string& name, const DebugDrawerTriMesh& triMesh, const Ice::Current& = Ice::emptyCurrent) override; + void setArrowDebugLayerVisu(const std::string& name, const Vector3BasePtr& position, const Vector3BasePtr& direction, const DrawColor& color, Ice::Float length, Ice::Float width, const Ice::Current& = Ice::emptyCurrent) override; + void setCylinderDebugLayerVisu(const std::string& name, const Vector3BasePtr& globalPosition, const Vector3BasePtr& direction, Ice::Float length, Ice::Float radius, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + void setCircleDebugLayerVisu(const std::string& name, const Vector3BasePtr& globalPosition, const Vector3BasePtr& directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor& color, const Ice::Current& = Ice::emptyCurrent) override; + + void removePoseVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeLineVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeLineSetVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeBoxVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeTextVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeSphereVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removePointCloudVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeColoredPointCloudVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void remove24BitColoredPointCloudVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removePolygonVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeTriMeshVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeArrowVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeCylinderVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeCircleVisu(const std::string& layer, const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + + void removePoseDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeLineDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeLineSetDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeBoxDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeTextDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeSphereDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removePointCloudDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeColoredPointCloudDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void remove24BitColoredPointCloudDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removePolygonDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeTriMeshDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeArrowDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeCylinderDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + void removeCircleDebugLayerVisu(const std::string& name, const Ice::Current& = Ice::emptyCurrent) override; + + void clearAll(const Ice::Current& = Ice::emptyCurrent) override; + void clearLayer(const std::string& layer, const Ice::Current& = Ice::emptyCurrent) override; + void clearDebugLayer(const Ice::Current& = Ice::emptyCurrent) override; + + void enableLayerVisu(const std::string& layer, bool visible, const Ice::Current& = Ice::emptyCurrent) override; + void enableDebugLayerVisu(bool visible, const Ice::Current& = Ice::emptyCurrent) override; + + Ice::StringSeq layerNames(const Ice::Current& = Ice::emptyCurrent) override; + LayerInformationSequence layerInformation(const Ice::Current& = Ice::emptyCurrent) override; + + bool hasLayer(const std::string&, const Ice::Current& = Ice::emptyCurrent) override; + void removeLayer(const std::string&, const Ice::Current& = Ice::emptyCurrent) override; + + void disableAllLayers(const Ice::Current& = Ice::emptyCurrent) override; + void enableAllLayers(const Ice::Current& = Ice::emptyCurrent) override; + + void enableSelections(const std::string&, const Ice::Current& = Ice::emptyCurrent) override; + void disableSelections(const std::string&, const Ice::Current& = Ice::emptyCurrent) override; + void clearSelections(const std::string&, const Ice::Current& = Ice::emptyCurrent) override; + + void select(const std::string& layer, const std::string& elementName, const Ice::Current& = Ice::emptyCurrent) override; + void deselect(const std::string& layer, const std::string& elementName, const Ice::Current& = Ice::emptyCurrent) override; + + DebugDrawerSelectionList getSelections(const Ice::Current& = Ice::emptyCurrent) override; + + + private: + + viz::Client arviz; + + + }; +} diff --git a/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.cpp b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.cpp new file mode 100644 index 000000000..9dd044100 --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.cpp @@ -0,0 +1,69 @@ +/* + * 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/>. + * + * @package RobotAPI::ArmarXObjects::DebugDrawerToArViz + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2020 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "DebugDrawerToArVizComponent.h" + + +namespace armarx +{ + DebugDrawerToArVizPropertyDefinitions::DebugDrawerToArVizPropertyDefinitions(std::string prefix) : + armarx::ComponentPropertyDefinitions(prefix) + { + defineOptionalProperty<std::string>("DebugDrawerTopicName", "DebugDrawerUpdates", + "Name of the topic the DebugDrawer listens to."); + } + + + std::string DebugDrawerToArVizComponent::getDefaultName() const + { + return "DebugDrawerToArViz"; + } + + + void DebugDrawerToArVizComponent::onInitComponent() + { + usingTopicFromProperty("DebugDrawerTopicName"); + } + + + void DebugDrawerToArVizComponent::onConnectComponent() + { + DebugDrawerToArViz::setArViz(ArVizComponentPluginUser::arviz); + } + + + void DebugDrawerToArVizComponent::onDisconnectComponent() + { + } + + + void DebugDrawerToArVizComponent::onExitComponent() + { + } + + + armarx::PropertyDefinitionsPtr DebugDrawerToArVizComponent::createPropertyDefinitions() + { + return armarx::PropertyDefinitionsPtr(new DebugDrawerToArVizPropertyDefinitions( + getConfigIdentifier())); + } +} diff --git a/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.h b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.h new file mode 100644 index 000000000..b7af1a027 --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.h @@ -0,0 +1,89 @@ +/* + * 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/>. + * + * @package RobotAPI::ArmarXObjects::DebugDrawerToArViz + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2020 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#pragma once + + +#include <ArmarXCore/core/Component.h> + +#include <RobotAPI/interface/visualization/DebugDrawerInterface.h> + +#include <RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.h> + +#include "DebugDrawerToArViz.h" + + +namespace armarx +{ + /** + * @class DebugDrawerToArVizPropertyDefinitions + * @brief Property definitions of `DebugDrawerToArViz`. + */ + class DebugDrawerToArVizPropertyDefinitions : + public armarx::ComponentPropertyDefinitions + { + public: + DebugDrawerToArVizPropertyDefinitions(std::string prefix); + }; + + + /** + * @defgroup Component-DebugDrawerToArViz DebugDrawerToArViz + * @ingroup RobotAPI-Components + * A description of the component DebugDrawerToArViz. + * + * @class DebugDrawerToArViz + * @ingroup Component-DebugDrawerToArViz + * @brief Brief description of class DebugDrawerToArViz. + * + * Detailed description of class DebugDrawerToArViz. + */ + class DebugDrawerToArVizComponent : + virtual public armarx::Component, + virtual public armarx::ArVizComponentPluginUser, + virtual public armarx::DebugDrawerToArViz // Implements armarx::DebugDrawerInterface + { + public: + + /// @see armarx::ManagedIceObject::getDefaultName() + std::string getDefaultName() const override; + + + protected: + + /// @see armarx::ManagedIceObject::onInitComponent() + void onInitComponent() override; + + /// @see armarx::ManagedIceObject::onConnectComponent() + void onConnectComponent() override; + + /// @see armarx::ManagedIceObject::onDisconnectComponent() + void onDisconnectComponent() override; + + /// @see armarx::ManagedIceObject::onExitComponent() + void onExitComponent() override; + + /// @see PropertyUser::createPropertyDefinitions() + armarx::PropertyDefinitionsPtr createPropertyDefinitions() override; + + }; +} diff --git a/source/RobotAPI/components/DebugDrawerToArViz/main.cpp b/source/RobotAPI/components/DebugDrawerToArViz/main.cpp new file mode 100644 index 000000000..a498c8dc5 --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/main.cpp @@ -0,0 +1,32 @@ +/* + * 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/>. + * + * @package RobotAPI::application::DebugDrawerToArViz + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2020 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include <RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.h> + +#include <ArmarXCore/core/application/Application.h> +#include <ArmarXCore/core/Component.h> +#include <ArmarXCore/core/logging/Logging.h> + +int main(int argc, char* argv[]) +{ + return armarx::runSimpleComponentApp < armarx::DebugDrawerToArVizComponent > (argc, argv, "DebugDrawerToArViz"); +} diff --git a/source/RobotAPI/components/DebugDrawerToArViz/test/CMakeLists.txt b/source/RobotAPI/components/DebugDrawerToArViz/test/CMakeLists.txt new file mode 100644 index 000000000..9fc18bead --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/test/CMakeLists.txt @@ -0,0 +1,5 @@ + +# Libs required for the tests +SET(LIBS ${LIBS} ArmarXCore DebugDrawerToArViz) + +armarx_add_test(DebugDrawerToArVizTest DebugDrawerToArVizTest.cpp "${LIBS}") diff --git a/source/RobotAPI/components/DebugDrawerToArViz/test/DebugDrawerToArVizTest.cpp b/source/RobotAPI/components/DebugDrawerToArViz/test/DebugDrawerToArVizTest.cpp new file mode 100644 index 000000000..42047e6b0 --- /dev/null +++ b/source/RobotAPI/components/DebugDrawerToArViz/test/DebugDrawerToArVizTest.cpp @@ -0,0 +1,37 @@ +/* + * 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/>. + * + * @package RobotAPI::ArmarXObjects::DebugDrawerToArViz + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2020 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#define BOOST_TEST_MODULE RobotAPI::ArmarXObjects::DebugDrawerToArViz + +#define ARMARX_BOOST_TEST + +#include <RobotAPI/Test.h> +#include <RobotAPI/components/DebugDrawerToArViz/DebugDrawerToArVizComponent.h> + +#include <iostream> + +BOOST_AUTO_TEST_CASE(testExample) +{ + armarx::DebugDrawerToArVizComponent instance; + + BOOST_CHECK_EQUAL(true, true); +} -- GitLab