diff --git a/source/RobotAPI/components/ArViz/Client/Elements.h b/source/RobotAPI/components/ArViz/Client/Elements.h index e9157a24d9f60b9ba71d70cccd2141b0258665c3..e540d18c0e2927ab5b5008abe3f92105aaf04211 100644 --- a/source/RobotAPI/components/ArViz/Client/Elements.h +++ b/source/RobotAPI/components/ArViz/Client/Elements.h @@ -1,19 +1,9 @@ #pragma once -#include <RobotAPI/interface/ArViz/Elements.h> -#include <SimoxUtility/EigenStdVector.h> -#include <SimoxUtility/math/normal/normal_to_mat4.h> -#include <SimoxUtility/math/convert/rpy_to_mat3f.h> -#include <SimoxUtility/math/pose/transform.h> -#include <SimoxUtility/shapes/OrientedBoxBase.h> -#include <Eigen/Core> -#include <Eigen/Geometry> -#include <string> -#include <ArmarXCore/core/exceptions/local/ExpressionException.h> #include "Color.h" #include "elements/ElementOps.h" @@ -22,6 +12,22 @@ #include "elements/Robot.h" //#include "elements/RobotHand.h" // Not included by default (exposes additional headers). +#include <RobotAPI/interface/ArViz/Elements.h> + +#include <ArmarXCore/core/exceptions/local/ExpressionException.h> + +#include <SimoxUtility/EigenStdVector.h> +#include <SimoxUtility/math/normal/normal_to_mat4.h> +#include <SimoxUtility/math/convert/rpy_to_mat3f.h> +#include <SimoxUtility/math/pose/transform.h> +#include <SimoxUtility/shapes/OrientedBoxBase.h> + +#include <Eigen/Geometry> +#include <Eigen/Core> + +#include <ctime> +#include <string> + // The has_member macro causes compile errors if *any* other header uses // the identifier has_member. Boost.Thread does, so this causes compile // errors down the line. @@ -118,7 +124,7 @@ namespace armarx::viz template<class T> Box( const simox::OrientedBoxBase<T>& b, - const std::string& name = std::to_string(std::chrono::high_resolution_clock::now().time_since_epoch().count()) + const std::string& name = std::to_string(std::time(0)) ) : Box(name, b) {} diff --git a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp index 778c2db5fd47742488efb3ee0f8ce6aaae4fe0e3..e25405e6ad5168eadd59650471b5e5b2a9e6c610 100644 --- a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp +++ b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp @@ -119,12 +119,15 @@ namespace armarx::viz return; } + state = CoinVisualizerState::STOPPED; + /* state = CoinVisualizerState::STOPPING; while (state != CoinVisualizerState::STOPPED) { QCoreApplication::processEvents(); usleep(1000); } + */ } CoinVisualizer_ApplyTiming CoinVisualizer::apply(data::LayerUpdate const& update) diff --git a/source/RobotAPI/components/units/relays/CMakeLists.txt b/source/RobotAPI/components/units/relays/CMakeLists.txt index 26d539f34c8e5624a614fa891b8f7a19a04f01fd..4c651ad32bb9612e8295a3c58b6a14e98a948b2d 100644 --- a/source/RobotAPI/components/units/relays/CMakeLists.txt +++ b/source/RobotAPI/components/units/relays/CMakeLists.txt @@ -1,16 +1,16 @@ -set(LIB_NAME RobotAPIUnitListenerRelays) -armarx_set_target("RobotAPI Unit Listener Relays Library: ${LIB_NAME}") +#set(LIB_NAME RobotAPIUnitListenerRelays) +#armarx_set_target("RobotAPI Unit Listener Relays Library: ${LIB_NAME}") -set(LIBS ArmarXCore RobotAPIInterfaces) +#set(LIBS ArmarXCore RobotAPIInterfaces) -set(LIB_HEADERS - KinematicUnitListenerRelay.h - InertialMeasurementUnitListenerRelay.h - ForceTorqueUnitListenerRelay.h - RobotStateListenerRelay.h -) +#set(LIB_HEADERS +# KinematicUnitListenerRelay.h +# InertialMeasurementUnitListenerRelay.h +# ForceTorqueUnitListenerRelay.h +# RobotStateListenerRelay.h +#) -set(LIB_FILES syntaxcheck.cpp) +#set(LIB_FILES syntaxcheck.cpp) -armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}") +#armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}") diff --git a/source/RobotAPI/components/units/relays/ForceTorqueUnitListenerRelay.h b/source/RobotAPI/components/units/relays/ForceTorqueUnitListenerRelay.h deleted file mode 100644 index 22497a7116897b4e6ee50e814edad776d29b9861..0000000000000000000000000000000000000000 --- a/source/RobotAPI/components/units/relays/ForceTorqueUnitListenerRelay.h +++ /dev/null @@ -1,56 +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/>. - * - * @package VisionX::ArmarXObjects::ForceTorqueUnitListenerRelay - * @author Raphael Grimm ( raphael dot grimm at kit dot edu ) - * @date 2016 - * @copyright http://www.gnu.org/licenses/gpl-2.0.txt - * GNU General Public License - */ -#include <ArmarXCore/core/ManagedIceObject.h> -#include <ArmarXCore/core/util/noop.h> -#include <RobotAPI/interface/units/ForceTorqueUnit.h> - -namespace armarx -{ - class ForceTorqueUnitListenerRelay : - virtual public ManagedIceObject, - virtual public ForceTorqueUnitListener - { - public: - using CallbackFunctionSensorValues = std::function<void(const std::string&, const FramedDirectionBasePtr&, const FramedDirectionBasePtr&)>; - - // ForceTorqueUnitListener interface - void reportSensorValues(const std::string& sensorNodeName, const FramedDirectionBasePtr& forces, const FramedDirectionBasePtr& torques, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportSensorValues(sensorNodeName, forces, torques); - } - protected: - // ManagedIceObject interface - void onInitComponent() override - { - usingTopic(topicName); - } - void onConnectComponent() override {} - std::string getDefaultName() const override - { - return "ForceTorqueUnitListenerRelay"; - } - public: - std::string topicName; - CallbackFunctionSensorValues callbackReportSensorValues {noop<const std::string&, const FramedDirectionBasePtr&, const FramedDirectionBasePtr&>}; - }; - using ForceTorqueUnitListenerRelayPtr = IceInternal::Handle<ForceTorqueUnitListenerRelay>; -} diff --git a/source/RobotAPI/components/units/relays/InertialMeasurementUnitListenerRelay.h b/source/RobotAPI/components/units/relays/InertialMeasurementUnitListenerRelay.h deleted file mode 100644 index 8a305eb62f96a8fec2162bb54784ef48b682ed9a..0000000000000000000000000000000000000000 --- a/source/RobotAPI/components/units/relays/InertialMeasurementUnitListenerRelay.h +++ /dev/null @@ -1,56 +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/>. - * - * @package VisionX::ArmarXObjects::InertialMeasurementUnitListenerRelay - * @author Raphael Grimm ( raphael dot grimm at kit dot edu ) - * @date 2016 - * @copyright http://www.gnu.org/licenses/gpl-2.0.txt - * GNU General Public License - */ -#include <ArmarXCore/core/ManagedIceObject.h> -#include <ArmarXCore/core/util/noop.h> -#include <RobotAPI/interface/units/InertialMeasurementUnit.h> - -namespace armarx -{ - class InertialMeasurementUnitListenerRelay : - virtual public ManagedIceObject, - virtual public InertialMeasurementUnitListener - { - public: - using CallbackFunctionSensorValues = std::function<void(const std::string&, const std::string&, const IMUData&, const TimestampBasePtr&)>; - - // InertialMeasurementUnitListener interface - void reportSensorValues(const std::string& device, const std::string& name, const IMUData& values, const TimestampBasePtr& timestamp, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportSensorValues(device, name, values, timestamp); - } - protected: - // ManagedIceObject interface - void onInitComponent() override - { - usingTopic(topicName); - } - void onConnectComponent() override {} - std::string getDefaultName() const override - { - return "InertialMeasurementUnitListenerRelay"; - } - public: - std::string topicName; - CallbackFunctionSensorValues callbackReportSensorValues {noop<const std::string&, const std::string&, const IMUData&, const TimestampBasePtr&>}; - }; - using InertialMeasurementUnitListenerRelayPtr = IceInternal::Handle<InertialMeasurementUnitListenerRelay>; -} diff --git a/source/RobotAPI/components/units/relays/KinematicUnitListenerRelay.h b/source/RobotAPI/components/units/relays/KinematicUnitListenerRelay.h deleted file mode 100644 index c653ba682b2e7b4586336abae7cff92a84b54c2a..0000000000000000000000000000000000000000 --- a/source/RobotAPI/components/units/relays/KinematicUnitListenerRelay.h +++ /dev/null @@ -1,94 +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/>. - * - * @package VisionX::ArmarXObjects::KinematicUnitListenerRelay - * @author Raphael Grimm ( raphael dot grimm at kit dot edu ) - * @date 2016 - * @copyright http://www.gnu.org/licenses/gpl-2.0.txt - * GNU General Public License - */ -#include <ArmarXCore/core/ManagedIceObject.h> -#include <ArmarXCore/core/util/noop.h> -#include <RobotAPI/interface/units/KinematicUnitInterface.h> - -namespace armarx -{ - class KinematicUnitListenerRelay : - virtual public ManagedIceObject, - virtual public KinematicUnitListener - { - public: - using CallbackFunctionModes = std::function<void(const NameControlModeMap&, Ice::Long, bool)>; - using CallbackFunctionState = std::function<void(const NameStatusMap&, Ice::Long, bool)>; - using CallbackFunctionValue = std::function<void(const NameValueMap&, Ice::Long, bool)>; - - // KinematicUnitListener interface - void reportControlModeChanged(const NameControlModeMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportControlModeChanged(map, time, changes); - } - void reportJointAngles(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportJointAngles(map, time, changes); - } - void reportJointVelocities(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportJointVelocities(map, time, changes); - } - void reportJointTorques(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportJointTorques(map, time, changes); - } - void reportJointAccelerations(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportJointAccelerations(map, time, changes); - } - void reportJointCurrents(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportJointCurrents(map, time, changes); - } - void reportJointMotorTemperatures(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportJointMotorTemperatures(map, time, changes); - } - void reportJointStatuses(const NameStatusMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override - { - callbackReportJointStatuses(map, time, changes); - } - - protected: - // ManagedIceObject interface - void onInitComponent() override - { - usingTopic(topicName); - } - void onConnectComponent() override {} - std::string getDefaultName() const override - { - return "KinematicUnitListenerRelay"; - } - public: - std::string topicName; - CallbackFunctionModes callbackReportControlModeChanged {noop<const NameControlModeMap&, Ice::Long, bool>}; - CallbackFunctionValue callbackReportJointAngles {noop<const NameValueMap&, Ice::Long, bool>}; - CallbackFunctionValue callbackReportJointVelocities {noop<const NameValueMap&, Ice::Long, bool>}; - CallbackFunctionValue callbackReportJointTorques {noop<const NameValueMap&, Ice::Long, bool>}; - CallbackFunctionValue callbackReportJointAccelerations {noop<const NameValueMap&, Ice::Long, bool>}; - CallbackFunctionValue callbackReportJointCurrents {noop<const NameValueMap&, Ice::Long, bool>}; - CallbackFunctionValue callbackReportJointMotorTemperatures {noop<const NameValueMap&, Ice::Long, bool>}; - CallbackFunctionState callbackReportJointStatuses {noop<const NameStatusMap&, Ice::Long, bool>}; - }; - using KinematicUnitListenerRelayPtr = IceInternal::Handle<KinematicUnitListenerRelay>; -} diff --git a/source/RobotAPI/components/units/relays/RobotStateListenerRelay.h b/source/RobotAPI/components/units/relays/RobotStateListenerRelay.h deleted file mode 100644 index ab4bf2ac5addfddc1d84662b02bfbe73adf9c6a4..0000000000000000000000000000000000000000 --- a/source/RobotAPI/components/units/relays/RobotStateListenerRelay.h +++ /dev/null @@ -1,61 +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/>. - * - * @package VisionX::ArmarXObjects::KinematicUnitListenerRelay - * @author Raphael Grimm ( raphael dot grimm at kit dot edu ) - * @date 2016 - * @copyright http://www.gnu.org/licenses/gpl-2.0.txt - * GNU General Public License - */ -#include <ArmarXCore/core/ManagedIceObject.h> -#include <ArmarXCore/core/util/noop.h> -#include <RobotAPI/interface/core/RobotState.h> - -namespace armarx -{ - class RobotStateListenerRelay : - virtual public ManagedIceObject, - virtual public RobotStateListenerInterface - { - public: - using CallbackFunctionValue = std::function<void(const NameValueMap&, Ice::Long, bool)>; - using CallbackFunctionPose = std::function<void(const FramedPoseBasePtr&, Ice::Long, bool)>; - - virtual void reportJointValues(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) - { - callbackReportJointValues(map, time, changes); - } - void reportGlobalRobotRootPose(const FramedPoseBasePtr& pose, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) - { - callbackReportGlobalRobotRootPose(pose, time, changes); - } - protected: - // ManagedIceObject interface - virtual void onInitComponent() - { - usingTopic(topicName); - } - virtual void onConnectComponent() {} - virtual std::string getDefaultName() const - { - return "RobotStateListener"; - } - public: - std::string topicName; - CallbackFunctionValue callbackReportJointValues {noop<const NameValueMap&, Ice::Long, bool>}; - CallbackFunctionPose callbackReportGlobalRobotRootPose {noop<const FramedPoseBasePtr&, Ice::Long, bool>}; - }; - using RobotStateListenerRelayPtr = IceInternal::Handle<RobotStateListenerRelay>; -} diff --git a/source/RobotAPI/components/units/relays/syntaxcheck.cpp b/source/RobotAPI/components/units/relays/syntaxcheck.cpp deleted file mode 100644 index 82b6a31b758ca9668e4219e346f9ae3be5e4a477..0000000000000000000000000000000000000000 --- a/source/RobotAPI/components/units/relays/syntaxcheck.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "KinematicUnitListenerRelay.h" -#include "InertialMeasurementUnitListenerRelay.h" -#include "ForceTorqueUnitListenerRelay.h" diff --git a/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp b/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp index e210b778f25dd9ce8f83bfd299ff3ec4c75497e2..c379eed20745f6f77472c2faf6b943aba23464cd 100644 --- a/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp +++ b/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp @@ -176,8 +176,6 @@ namespace armarx void ArVizWidgetController::onDisconnectComponent() { - visualizer.stop(); - // Changes to UI elements are only allowed in the GUI thread emit disconnectGui(); } @@ -195,6 +193,7 @@ namespace armarx void ArVizWidgetController::onDisconnectGui() { timingObserverTimer->stop(); + visualizer.stop(); changeMode(ArVizWidgetMode::NotConnected); } diff --git a/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllerClassesWidget.cpp b/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllerClassesWidget.cpp index 27cf1dca60f0d527637c9c3901998caf4324eb54..4a752e88e1b5962479617584c0fb1870a8a25484 100644 --- a/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllerClassesWidget.cpp +++ b/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllerClassesWidget.cpp @@ -25,6 +25,7 @@ #include "NJointControllerClassesWidget.h" #include <ArmarXCore/core/system/cmake/CMakePackageFinder.h> #include <ArmarXCore/core/util/StringHelpers.h> +#include <ArmarXCore/core/logging/Logging.h> #include <QGridLayout> #include <QDir> diff --git a/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllersWidget.cpp b/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllersWidget.cpp index ab2c8e69926f1adc22e1be4aaee3174106a10dda..b5160a688306a3fec1eadada0567cc14e66e552d 100644 --- a/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllersWidget.cpp +++ b/source/RobotAPI/gui-plugins/RobotUnitPlugin/QWidgets/NJointControllersWidget.cpp @@ -22,6 +22,8 @@ #include "NJointControllersWidget.h" #include "StyleSheets.h" +#include <ArmarXCore/core/logging/Logging.h> + namespace armarx { NJointControllersWidget::NJointControllersWidget(QWidget* parent) : diff --git a/source/RobotAPI/libraries/ArmarXEtherCAT/SlaveIdentifier.cpp b/source/RobotAPI/libraries/ArmarXEtherCAT/SlaveIdentifier.cpp index f295d0ffd6bddd4c05c0d63d4a47d2ff970157b1..8dca1b8e84979538be9fead1a60af32ee7bb0a22 100644 --- a/source/RobotAPI/libraries/ArmarXEtherCAT/SlaveIdentifier.cpp +++ b/source/RobotAPI/libraries/ArmarXEtherCAT/SlaveIdentifier.cpp @@ -23,6 +23,8 @@ #include "SlaveIdentifier.h" +#include <ArmarXCore/core/logging/Logging.h> + using namespace armarx; SlaveIdentifier::SlaveIdentifier(const RapidXmlReaderNode& node) diff --git a/source/RobotAPI/libraries/ArmarXObjects/ObjectInfo.cpp b/source/RobotAPI/libraries/ArmarXObjects/ObjectInfo.cpp index 47728cbd7249f4983717f9a1dbb079e79215fadc..93bdb0286401d7a47a153cf3da6eda1e16dae93a 100644 --- a/source/RobotAPI/libraries/ArmarXObjects/ObjectInfo.cpp +++ b/source/RobotAPI/libraries/ArmarXObjects/ObjectInfo.cpp @@ -6,6 +6,7 @@ #include <SimoxUtility/shapes/OrientedBox.h> #include <ArmarXCore/core/exceptions/local/ExpressionException.h> +#include <ArmarXCore/core/logging/Logging.h> namespace armarx diff --git a/source/RobotAPI/libraries/armem_objects/client/articulated_object/utils.cpp b/source/RobotAPI/libraries/armem_objects/client/articulated_object/utils.cpp index c6da5e109ff356ecbe4a4f2b569c332a5e34cfcb..7d311d3f237d8e9480fc3020f3b4d2c2c16f1a88 100644 --- a/source/RobotAPI/libraries/armem_objects/client/articulated_object/utils.cpp +++ b/source/RobotAPI/libraries/armem_objects/client/articulated_object/utils.cpp @@ -2,6 +2,8 @@ #include <RobotAPI/libraries/armem_robot/aron_conversions.h> +#include <ArmarXCore/core/logging/Logging.h> + namespace armarx::armem::articulated_object { std::optional<robot::RobotDescription> @@ -31,4 +33,4 @@ namespace armarx::armem::articulated_object return robotDescription; } -} // namespace armarx::armem::articulated_object \ No newline at end of file +} // namespace armarx::armem::articulated_object diff --git a/source/RobotAPI/libraries/armem_robot/robot_conversions.cpp b/source/RobotAPI/libraries/armem_robot/robot_conversions.cpp index 6ba61bba4b70f7a4cbbdf8cb2d18b11e4b50bbd6..8b7829a2f0c3f6dadd54bf2ce624c9fcbe793efd 100644 --- a/source/RobotAPI/libraries/armem_robot/robot_conversions.cpp +++ b/source/RobotAPI/libraries/armem_robot/robot_conversions.cpp @@ -10,6 +10,8 @@ #include <RobotAPI/libraries/armem_robot/aron/RobotDescription.aron.generated.h> #include <RobotAPI/libraries/armem_robot/aron_conversions.h> +#include <ArmarXCore/core/logging/Logging.h> + namespace fs = ::std::filesystem;