diff --git a/data/RobotAPI/VariantInfo-RobotAPI.xml b/data/RobotAPI/VariantInfo-RobotAPI.xml index e09c9aa52c8ab75de5ca845a812fc6fd38aa4d4e..218aed8cfaedf754b40a52f68acd33da0b7ae69c 100644 --- a/data/RobotAPI/VariantInfo-RobotAPI.xml +++ b/data/RobotAPI/VariantInfo-RobotAPI.xml @@ -20,8 +20,8 @@ <Class typeName="NJointCartesianWaypointControllerConfig" include="RobotAPI/interface/units/RobotUnit/NJointCartesianWaypointController.h" /> <Class typeName="FramedPoseBase" include="RobotAPI/interface/core/FramedPoseBase.h" /> - <Class typeName="Vector3Base" include="RobotAPI/libraries/core/Pose.h" /> - <Class typeName="QuaternionBase" include="RobotAPI/libraries/core/Pose.h" /> + <Class typeName="Vector3Base" include="RobotAPI/interface/core/PoseBase.h" /> + <Class typeName="QuaternionBase" include="RobotAPI/interface/core/PoseBase.h" /> <Class typeName="armarx::viz::data::Element" include="RobotAPI/interface/ArViz/Elements.h" /> <Class typeName="armarx::viz::data::LayerUpdate" include="RobotAPI/interface/ArViz/Component.h" /> <Proxy include="RobotAPI/interface/units/KinematicUnitInterface.h" @@ -162,22 +162,6 @@ getterName="getRobotUnit" propertyName="RobotUnitName" propertyIsOptional="false" /> - <Proxy include="ArmarXCore/interface/observers/ObserverInterface.h" - humanName="Robot Unit Observer" - typeName="ObserverInterfacePrx" - memberName="robotUnitObserver" - getterName="getRobotUnitObserver" - propertyName="RobotUnitObserverName" - propertyIsOptional="true" - propertyDefaultValue="RobotUnitObserver" /> - <Proxy include="ArmarXCore/interface/observers/ObserverInterface.h" - humanName="Speech Observer" - typeName="ObserverInterfacePrx" - memberName="speechObserver" - getterName="getSpeechObserver" - propertyName="SpeechObserverName" - propertyIsOptional="true" - propertyDefaultValue="SpeechObserver" /> <Proxy include="RobotAPI/interface/units/CyberGloveObserverInterface.h" humanName="CyberGlove Observer" typeName="CyberGloveObserverInterfacePrx" diff --git a/scenarios/ArMemCore/config/ArVizStorage.cfg b/scenarios/ArMemCore/config/ArVizStorage.cfg index 5e8b630736a25dcd37ccfe9547d599b49a8dd6c6..302ac28c37dd28de3e68fb4fe4c2174faa4ec3bf 100644 --- a/scenarios/ArMemCore/config/ArVizStorage.cfg +++ b/scenarios/ArMemCore/config/ArVizStorage.cfg @@ -27,7 +27,7 @@ # ArmarX.ArVizStorage.EnableProfiling = false -# ArmarX.ArVizStorage.HistoryPath: Destination path where the history are serialized to +# ArmarX.ArVizStorage.HistoryPath: Destination path where the history is serialized to # Attributes: # - Default: RobotAPI/ArVizStorage # - Case sensitivity: yes @@ -68,7 +68,7 @@ # ArmarX.ArVizStorage.TopicName = ArVizTopic -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemCore/config/DebugObserver.cfg b/scenarios/ArMemCore/config/DebugObserver.cfg index 459d0d1a5bcd9ea89ef01e161eb903fc8a4bf1cb..8dc7ead26b3bd2f7678b3b3e7a1b00c01213225d 100644 --- a/scenarios/ArMemCore/config/DebugObserver.cfg +++ b/scenarios/ArMemCore/config/DebugObserver.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemCore/config/MemoryNameSystem.cfg b/scenarios/ArMemCore/config/MemoryNameSystem.cfg index dfe9b389392a186f5baef2403145e31d49646f58..b8bc70a66ca7f32a628886ad1bf13e373f9750d3 100644 --- a/scenarios/ArMemCore/config/MemoryNameSystem.cfg +++ b/scenarios/ArMemCore/config/MemoryNameSystem.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg b/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg index 4683563a9c97e6bb11805b8d903dbe2f705a3fd2..4b6abea40d72afd7d313ee47a9b191f3b26de30d 100644 --- a/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg +++ b/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/DebugObserver.cfg b/scenarios/ArMemExample/config/DebugObserver.cfg index 459d0d1a5bcd9ea89ef01e161eb903fc8a4bf1cb..8dc7ead26b3bd2f7678b3b3e7a1b00c01213225d 100644 --- a/scenarios/ArMemExample/config/DebugObserver.cfg +++ b/scenarios/ArMemExample/config/DebugObserver.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/ExampleMemory.cfg b/scenarios/ArMemExample/config/ExampleMemory.cfg index aac8c2e88be85372ac0296f79579f8d2c32665e4..e2e7bb719d4629ed88b2127cf7c97159bdb79341 100644 --- a/scenarios/ArMemExample/config/ExampleMemory.cfg +++ b/scenarios/ArMemExample/config/ExampleMemory.cfg @@ -26,7 +26,7 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes @@ -143,6 +143,23 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates # ArmarX.ExampleMemory.mem.MemoryName = Example +# ArmarX.ExampleMemory.mem.ltm..buffer.storeFreq: Frequency to store the buffer to the LTM in Hz. +# Attributes: +# - Default: 10 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm..buffer.storeFreq = 10 + + +# ArmarX.ExampleMemory.mem.ltm.depthImageExtractor.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.depthImageExtractor.Enabled = true + + # ArmarX.ExampleMemory.mem.ltm.enabled: # Attributes: # - Default: false @@ -152,12 +169,98 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates # ArmarX.ExampleMemory.mem.ltm.enabled = false -# ArmarX.ExampleMemory.mem.ltm.storagepath: The path to the memory storage. +# ArmarX.ExampleMemory.mem.ltm.exrConverter.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.exrConverter.Enabled = true + + +# ArmarX.ExampleMemory.mem.ltm.imageExtractor.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.imageExtractor.Enabled = true + + +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.Enabled: +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.Enabled = false + + +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.WaitingTime: Waiting time in MS after each LTM update. +# Attributes: +# - Default: -1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.WaitingTime = -1 + + +# ArmarX.ExampleMemory.mem.ltm.pngConverter.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.pngConverter.Enabled = true + + +# ArmarX.ExampleMemory.mem.ltm.sizeToCompressDataInMegaBytes: The size in MB to compress away the current export. Exports are numbered (lower number means newer). # Attributes: -# - Default: /tmp/MemoryExport/Example +# - Default: 1024 # - Case sensitivity: yes # - Required: no -# ArmarX.ExampleMemory.mem.ltm.storagepath = /tmp/MemoryExport/Example +# ArmarX.ExampleMemory.mem.ltm.sizeToCompressDataInMegaBytes = 1024 + + +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.Enabled: +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.Enabled = false + + +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.MaxWaitingTime: Max Waiting time in MS after each Entity update. +# Attributes: +# - Default: -1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.MaxWaitingTime = -1 + + +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.Enabled: +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.Enabled = false + + +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.WaitingTime: Waiting time in MS after each Entity update. +# Attributes: +# - Default: -1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.WaitingTime = -1 + + +# ArmarX.ExampleMemory.mem.ltm.storagepath: The path to the memory storage (the memory will be stored in a seperate subfolder). +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.storagepath = Default value not mapped. # ArmarX.ExampleMemory.mns.MemoryNameSystemEnabled: Whether to use (and depend on) the Memory Name System (MNS). @@ -178,6 +281,15 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates # ArmarX.ExampleMemory.mns.MemoryNameSystemName = MemoryNameSystem +# ArmarX.ExampleMemory.p.enableRemoteGui: If true, the memory cotent is shown in the remote gui.Can be very slow for high-frequency updates! +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.p.enableRemoteGui = false + + # ArmarX.ExampleMemory.tpc.pub.DebugObserver: Name of the `DebugObserver` topic to publish data to. # Attributes: # - Default: DebugObserver diff --git a/scenarios/ArMemExample/config/ExampleMemoryClient.cfg b/scenarios/ArMemExample/config/ExampleMemoryClient.cfg index df84ec74b9f589842815ba742960cbc360da01e4..9c012266f8691c27cfa40be3ad793c081877178e 100644 --- a/scenarios/ArMemExample/config/ExampleMemoryClient.cfg +++ b/scenarios/ArMemExample/config/ExampleMemoryClient.cfg @@ -26,7 +26,7 @@ ArmarX.ArMemExampleClient.tpc.sub.MemoryListener = MemoryUpdates -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/MemoryNameSystem.cfg b/scenarios/ArMemExample/config/MemoryNameSystem.cfg index dfe9b389392a186f5baef2403145e31d49646f58..b8bc70a66ca7f32a628886ad1bf13e373f9750d3 100644 --- a/scenarios/ArMemExample/config/MemoryNameSystem.cfg +++ b/scenarios/ArMemExample/config/MemoryNameSystem.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg b/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg index 4683563a9c97e6bb11805b8d903dbe2f705a3fd2..4b6abea40d72afd7d313ee47a9b191f3b26de30d 100644 --- a/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg +++ b/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.cpp b/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.cpp index 22ff30654400ffb349b013b3d58e69b007f8ed18..5227bee38e728999d4a0f7fed6809913144573b6 100644 --- a/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.cpp +++ b/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.cpp @@ -43,6 +43,7 @@ namespace armarx ARMARX_INFO << "oninit GamepadControlUnit end"; + } @@ -67,12 +68,42 @@ namespace armarx armarx::PropertyDefinitionsPtr GamepadControlUnit::createPropertyDefinitions() { - return armarx::PropertyDefinitionsPtr(new GamepadControlUnitPropertyDefinitions( + auto defs = armarx::PropertyDefinitionsPtr(new GamepadControlUnitPropertyDefinitions( getConfigIdentifier())); + defs->topic(robotHealthTopic); + defs->optional(enableHeartBeat, "EnableHeartBeat", "Flag to enable send a heart beat to the robot healh topic"); + return defs; } void GamepadControlUnit::reportGamepadState(const std::string& device, const std::string& name, const GamepadData& data, const TimestampBasePtr& timestamp, const Ice::Current& c) { + + + // struct GamepadData { + // float leftStickX; + // float leftStickY; + // float rightStickX; + // float rightStickY; + // float dPadX; + // float dPadY; + // float leftTrigger; + // float rightTrigger; + // + // bool leftButton; + // bool rightButton; + // bool backButton; + // bool startButton; + // bool xButton; + // bool yButton; + // bool aButton; + // bool bButton; + // bool theMiddleButton; + // bool leftStickButton; + // bool rightStickButton; + // + // }; + + if (data.leftTrigger > 0) { emergencyStop->setEmergencyStopState(EmergencyStopState::eEmergencyStopActive); @@ -91,6 +122,66 @@ namespace armarx { platformUnitPrx->move(0, 0, 0); } + + + if (data.leftButton) + { + + if(leftHandTime <= 0.0) + { + leftHandTime = IceUtil::Time::now().toMicroSeconds(); + } + else if ((IceUtil::Time::now().toMicroSeconds() - leftHandTime) > 1000* 1000) + { + + HandUnitInterfacePrx handUnit = getProxy<HandUnitInterfacePrx>("LeftHandUnit"); + if (handUnit) + { + std::string shapeName = (leftHandOpen) ? "Close" : "Open"; + handUnit->setShape(shapeName); + leftHandOpen = !leftHandOpen; + leftHandTime = 0.0; + } + } + } + else + { + leftHandTime = 0.0; + } + + if(data.rightButton) + { + + if(rightHandTime <= 0.0) + { + rightHandTime = IceUtil::Time::now().toMicroSeconds(); + } + else if ((IceUtil::Time::now().toMicroSeconds() - rightHandTime) > 1000* 1000) + { + HandUnitInterfacePrx handUnit = getProxy<HandUnitInterfacePrx>("RightHandUnit"); + if (handUnit) + { + std::string shapeName = (rightHandOpen) ? "Close" : "Open"; + handUnit->setShape(shapeName); + rightHandOpen = !rightHandOpen; + rightHandTime = 0.0; + } + } + } + else + { + rightHandTime = 0.0; + } + + + if(enableHeartBeat) + { + RobotHealthHeartbeatArgs args; + args.maximumCycleTimeErrorMS = 1000; + robotHealthTopic->heartbeat(getDefaultName(), args); + + } + //ARMARX_INFO << "sending targets" << data.leftStickX* scaleX << " " << data.leftStickY* scaleY << " " << data.rightStickX* scaleRotation; } } diff --git a/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.h b/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.h index abdf77a77d42aa73a48bce6c93a15416bb8c64bc..9b0bacd5092012472d3f975e1c6d40357ba6594c 100644 --- a/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.h +++ b/source/RobotAPI/components/GamepadControlUnit/GamepadControlUnit.h @@ -28,6 +28,10 @@ #include <RobotAPI/interface/units/GamepadUnit.h> +#include <RobotAPI/interface/units/HandUnitInterface.h> + +#include <RobotAPI/interface/components/RobotHealthInterface.h> + namespace armarx { /** @@ -103,11 +107,22 @@ namespace armarx private: PlatformUnitInterfacePrx platformUnitPrx; + + + + bool enableHeartBeat = false; + RobotHealthInterfacePrx robotHealthTopic; float scaleX; float scaleY; float scaleRotation; EmergencyStopMasterInterfacePrx emergencyStop; + bool leftHandOpen = true; + bool rightHandOpen = true; + + long leftHandTime = 0; + long rightHandTime = 0; + public: void reportGamepadState(const std::string& device, const std::string& name, const GamepadData& data, const TimestampBasePtr& timestamp, const Ice::Current& c) override; diff --git a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp index 7a7d65f0740024f7ef1d7b43c667c2971962429b..dc7309cf18c368d85994cc06a2944b856d9832f4 100644 --- a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp +++ b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp @@ -51,6 +51,9 @@ namespace armarx "If enabled, core segments are added when required by a new provider segment." "This will usually be off for most memory servers."); + defs->optional(p.enableRemoteGui, "p.enableRemoteGui", + "If true, the memory cotent is shown in the remote gui." + "Can be very slow for high-frequency updates!"); return defs; } @@ -60,6 +63,7 @@ namespace armarx return "ExampleMemory"; } + void ExampleMemory::onInitComponent() { // Usually, the memory server will specify a number of core segments with a specific aron type. @@ -80,8 +84,11 @@ namespace armarx void ExampleMemory::onConnectComponent() { - createRemoteGuiTab(); - RemoteGui_startRunningTask(); + if (p.enableRemoteGui) + { + createRemoteGuiTab(); + RemoteGui_startRunningTask(); + } } void ExampleMemory::onDisconnectComponent() diff --git a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h index 66a500eeb43043ceb660d9ad9c720d2dc946fb66..62ea177f496296082cac90aecc6e9e6f35d450a8 100644 --- a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h +++ b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h @@ -96,6 +96,8 @@ namespace armarx }; CoreSegments core; + + bool enableRemoteGui = false; }; Properties p; diff --git a/source/RobotAPI/interface/CMakeLists.txt b/source/RobotAPI/interface/CMakeLists.txt index 36442cf0bdaa4238a8a832fe39f6c244569fe830..be1193d665db683b844d28d60662e8e3088eec70 100644 --- a/source/RobotAPI/interface/CMakeLists.txt +++ b/source/RobotAPI/interface/CMakeLists.txt @@ -72,7 +72,6 @@ set(SLICE_FILES units/RobotUnit/NJointCartesianWaypointController.ice units/RobotUnit/NJointCartesianNaturalPositionController.ice units/RobotUnit/RobotUnitInterface.ice - units/RobotUnit/GazeController.ice units/RobotUnit/NJointBimanualForceController.ice units/RobotUnit/NJointBimanualObjLevelController.ice diff --git a/source/RobotAPI/interface/units/RobotUnit/GazeController.ice b/source/RobotAPI/interface/units/RobotUnit/GazeController.ice deleted file mode 100644 index 78f98701af3f230ce2cbbb6c1d97082fa342ec6e..0000000000000000000000000000000000000000 --- a/source/RobotAPI/interface/units/RobotUnit/GazeController.ice +++ /dev/null @@ -1,63 +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 ArmarX::RobotAPI -* @author Raphael Grimm -* @copyright 2019 Humanoids Group, H2T, KIT -* @license http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License -*/ - -#pragma once - -#include <RobotAPI/interface/core/FramedPoseBase.ice> -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> - -module armarx { module control { module gaze_controller { - - class GazeControllerConfig extends NJointControllerConfig - { - string cameraFrameName = "DepthCamera"; - string yawNodeName = "Neck_1_Yaw"; - string pitchNodeName = "Neck_2_Pitch"; - string cameraNodeName = "DepthCamera"; - string torsoNodeName = "TorsoJoint"; - - float Kp = 1.9f; - float Ki = 0.0f; - float Kd = 0.0f; - double maxControlValue = 1.0; - double maxDerivation = 0.5; - - float yawAngleTolerance = 0.005; - float pitchAngleTolerance = 0.005; - bool abortIfUnreachable = false; - }; - - interface GazeControllerInterface extends - NJointControllerInterface - { - void submitTarget(FramedPositionBase target, long requestTimestamp); - void removeTarget(); - void removeTargetAfter(long durationMilliSeconds); - }; - - interface GazeControllerListener - { - void reportGazeTarget(long requestTimestamp, long reachedTimestamp, long releasedTimestamp, long abortedTimestamp, FramedPositionBase target); - }; - -};};}; diff --git a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp index 0d89cd82cce205a1032dfe9d895bb4845f7bdc53..36b2e7036df83d0b99731d6773eb4465e7b75997 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp +++ b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp @@ -224,7 +224,7 @@ namespace armarx::armem::gui for (auto& [name, reader] : memoryReaders) { data::StoreInput input; - input.query = memoryGroup->queryWidget()->queryInput().toIce(); + input.query = memoryGroup->queryInput().toIce(); reader.readAndStore(input); } @@ -294,7 +294,7 @@ namespace armarx::armem::gui { std::string status; std::map<std::string, wm::Memory> data = - diskControl->loadFromDisk(directory, memoryGroup->queryWidget()->queryInput(), &status); + diskControl->loadFromDisk(directory, memoryGroup->queryInput(), &status); memoryWriters = mns.getAllWriters(true); for (auto& [name, memory] : data) @@ -361,7 +361,7 @@ namespace armarx::armem::gui std::map<std::string, std::future<armem::query::data::Result>>& queries, const std::map<std::string, armem::client::Reader>& readers) { - armem::client::QueryInput input = memoryGroup->queryWidget()->queryInput(); + armem::client::QueryInput input = memoryGroup->queryInput(); int recursionDepth = memoryGroup->queryWidget()->queryLinkRecursionDepth(); // Can't use a structured binding here because you can't capture those in a lambda diff --git a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp index 27af95f6223db049ff9f26fd41632ac2d7850173..8796557cdcfa2d8f337166cb6181bab6f92111c5 100644 --- a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp +++ b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp @@ -39,7 +39,13 @@ namespace armarx::armem::gui::memory _queryWidget = new armem::gui::QueryWidget(); _queryWidget->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Maximum); - _memoryTabWidget->addTab(_queryWidget, QString("Query")); + _memoryTabWidget->addTab(_queryWidget, QString("Query Settings")); + } + { + _snapshotSelectorWidget = new armem::gui::SnapshotSelectorWidget(); + _snapshotSelectorWidget->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Maximum); + + _memoryTabWidget->addTab(_snapshotSelectorWidget, QString("Snapshot Selection")); } { _commitWidget = new armem::gui::CommitWidget(); @@ -67,6 +73,11 @@ namespace armarx::armem::gui::memory return _memoryTabGroup; } + SnapshotSelectorWidget* GroupBox::snapshotSelectorWidget() const + { + return _snapshotSelectorWidget; + } + CommitWidget* GroupBox::commitWidget() const { return _commitWidget; @@ -77,4 +88,16 @@ namespace armarx::armem::gui::memory return _tree; } -} + armem::client::QueryInput GroupBox::queryInput() const + { + armem::client::query::Builder queryBuilder(_queryWidget->dataMode()); + queryBuilder.queryTargets(_snapshotSelectorWidget->queryTargets()) + .coreSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) + .providerSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) + .entities().all().queryTargets(_snapshotSelectorWidget->queryTargets()) + .snapshots(_snapshotSelectorWidget->selector()); + + return queryBuilder.buildQueryInput(); + } + +} // namespace armarx::armem::gui::memory diff --git a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h index 562432d11bb4db79873dd97d200950127bf2e1db..10cf3d5972cc607cfb89fb9b2b0e1962027c9a75 100644 --- a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h +++ b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h @@ -26,8 +26,11 @@ namespace armarx::armem::gui::memory TreeWidget* tree() const; QGroupBox* queryGroup() const; QueryWidget* queryWidget() const; + SnapshotSelectorWidget* snapshotSelectorWidget() const; CommitWidget* commitWidget() const; + armem::client::QueryInput queryInput() const; + public slots: @@ -45,6 +48,7 @@ namespace armarx::armem::gui::memory QTabWidget* _memoryTabWidget; QGroupBox* _memoryTabGroup; QueryWidget* _queryWidget; + SnapshotSelectorWidget* _snapshotSelectorWidget; CommitWidget* _commitWidget; }; diff --git a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp index 82a8cca0b365cbdb367d28cff620864c72c570f6..ad07dc5b0de991b1e3296a94c66418caa20bf011 100644 --- a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp +++ b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp @@ -1,5 +1,7 @@ #include "QueryWidget.h" +#include <limits> + #include <QCheckBox> #include <QGroupBox> #include <QHBoxLayout> @@ -18,36 +20,28 @@ namespace armarx::armem::gui QueryWidget::QueryWidget() { - QHBoxLayout* hlayout1 = new QHBoxLayout(); - QHBoxLayout* hlayout2 = new QHBoxLayout(); - QVBoxLayout* vlayout = new QVBoxLayout(); + auto* vlayout = new QVBoxLayout(); _dataCheckBox = new QCheckBox("Get Data"); _dataCheckBox->setChecked(true); + vlayout->addWidget(_dataCheckBox); + + auto* recDepthHLayout = new QHBoxLayout(); + vlayout->addLayout(recDepthHLayout); - _recursionDepthSpinner = new QSpinBox(); - _recursionDepthSpinner->setMinimum(-1); + _recursionDepthSpinner = new QSpinBox(); // NOLINT + _recursionDepthSpinner->setRange(-1, std::numeric_limits<int>::max()); _recursionDepthSpinner->setValue(0); _recursionDepthSpinner->setEnabled(_dataCheckBox->isChecked()); + _recursionDepthSpinner->setSpecialValueText(QString("Unlimited")); + recDepthHLayout->addWidget(_recursionDepthSpinner); _recursionDepthLabel = new QLabel("Link resolution depth"); + recDepthHLayout->addWidget(_recursionDepthLabel); + recDepthHLayout->addStretch(); _storeInLTMButton = new QPushButton("Store query result in LTM"); - - _snapshotSelectorWidget = new SnapshotSelectorWidget(); - - hlayout1->addWidget(_dataCheckBox); - hlayout1->addWidget(_recursionDepthSpinner); - hlayout1->addWidget(_recursionDepthLabel); - hlayout1->addWidget(_storeInLTMButton); - - hlayout2->addWidget(_snapshotSelectorWidget); - - const int margin = 0; - vlayout->setContentsMargins(margin, margin, margin, margin); - - vlayout->addLayout(hlayout1); - vlayout->addLayout(hlayout2); + vlayout->addWidget(_storeInLTMButton); // Public connections. connect(_storeInLTMButton, &QPushButton::pressed, this, &This::storeInLTM); @@ -72,18 +66,6 @@ namespace armarx::armem::gui return _recursionDepthSpinner->value(); } - armem::client::QueryInput QueryWidget::queryInput() - { - armem::client::query::Builder qb(dataMode()); - qb.queryTargets(_snapshotSelectorWidget->queryTargets()) - .coreSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) - .providerSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) - .entities().all().queryTargets(_snapshotSelectorWidget->queryTargets()) - .snapshots(_snapshotSelectorWidget->selector()); - - return qb.buildQueryInput(); - } - void QueryWidget::setRecursionDepthSpinnerEnabled(int state) { diff --git a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h index 3b950acf05899e1e187273d1a2d7da57def4de1e..e7a98a8026786a7c8e0c2acbfd8dc834cb72f16a 100644 --- a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h +++ b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h @@ -25,8 +25,6 @@ namespace armarx::armem::gui int queryLinkRecursionDepth() const; - armem::client::QueryInput queryInput(); - public slots: @@ -51,8 +49,6 @@ namespace armarx::armem::gui QSpinBox* _recursionDepthSpinner; QPushButton* _storeInLTMButton; - SnapshotSelectorWidget* _snapshotSelectorWidget; - }; } diff --git a/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.cpp b/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.cpp index 7a4305c6fe26ea6bf54aab17e9e87843688aa0a1..beebabd2977e8f7e46e976892ee4da3dc18f2bad 100644 --- a/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.cpp +++ b/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.cpp @@ -11,6 +11,8 @@ #include <ArmarXCore/core/logging/Logging.h> #include <ArmarXCore/core/time/Clock.h> +#include "RobotAPI/libraries/armem_robot_state/common/localization/types.h" +#include "RobotAPI/libraries/core/FramedPose.h" #include <RobotAPI/libraries/armem/client/query/Builder.h> #include <RobotAPI/libraries/armem/core/Time.h> #include <RobotAPI/libraries/armem/core/error.h> @@ -203,6 +205,31 @@ namespace armarx::armem::robot_state .timestamp = timestamp, .globalPose = *globalPose, .jointMap = *jointMap}; } + std::optional<robot::RobotState::Pose> + RobotReader::queryOdometryPose(const robot::RobotDescription& description, + const armem::Time& timestamp) const + { + + common::robot_state::localization::TransformQuery query + { + .header = { + .parentFrame = OdometryFrame, + .frame = "root", + .agent = description.name, + .timestamp = timestamp + } + }; + + const auto result = transformReader.lookupTransform(query); + if (not result) + { + return std::nullopt; + } + + return result.transform.transform; + } + + std::optional<robot::RobotState::JointMap> RobotReader::queryJointState(const robot::RobotDescription& description, const armem::Time& timestamp) const // Why timestamp?!?! diff --git a/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.h b/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.h index 6682fcd79130501530d54f770d342d02676fd069..e72b5fc64744a7ad3481990705568e92a8c56208 100644 --- a/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.h +++ b/source/RobotAPI/libraries/armem_robot_state/client/common/RobotReader.h @@ -24,9 +24,9 @@ #include <mutex> #include <optional> -#include <RobotAPI/libraries/armem/core/Time.h> #include <RobotAPI/libraries/armem/client/MemoryNameSystem.h> #include <RobotAPI/libraries/armem/client/Reader.h> +#include <RobotAPI/libraries/armem/core/Time.h> #include <RobotAPI/libraries/armem_robot/client/interfaces.h> #include <RobotAPI/libraries/armem_robot/types.h> #include <RobotAPI/libraries/armem_robot_state/client/localization/TransformReader.h> @@ -99,9 +99,22 @@ namespace armarx::armem::robot_state const armem::Time& start, const armem::Time& end) const; + /** + * @brief retrieve the robot's pose in the odometry frame. + * + * This pose is an integration of the robot's platform velocity and undergoes a significant drift. + * + * @param description + * @param timestamp + * @return std::optional<robot::RobotState::Pose> + */ + std::optional<robot::RobotState::Pose> + queryOdometryPose(const robot::RobotDescription& description, + const armem::Time& timestamp) const; + protected: // by default, no timeout mechanism - armem::Duration syncTimeout = armem::Duration::MicroSeconds(0); + armem::Duration syncTimeout = armem::Duration::MicroSeconds(0); armem::Duration sleepAfterFailure = armem::Duration::MicroSeconds(0); private: diff --git a/source/RobotAPI/libraries/aron/common/CMakeLists.txt b/source/RobotAPI/libraries/aron/common/CMakeLists.txt index 98cfb29ec529238b6e76c50c51e6563cb4fb4dcb..aa0a2ea82a6304a4afb3a5bc1b34c3f820b53577 100644 --- a/source/RobotAPI/libraries/aron/common/CMakeLists.txt +++ b/source/RobotAPI/libraries/aron/common/CMakeLists.txt @@ -13,19 +13,29 @@ armarx_add_library( HEADERS aron_conversions.h + forward_declarations.h + json_conversions.h + aron_conversions/core.h aron_conversions/armarx.h aron_conversions/simox.h aron_conversions/stl.h aron_conversions/eigen.h + + json_conversions/armarx.h + util/object_finders.h SOURCES + aron_conversions/core.cpp aron_conversions/armarx.cpp aron_conversions/simox.cpp aron_conversions/stl.cpp aron_conversions/eigen.cpp + + json_conversions/armarx.cpp + util/object_finders.cpp ) @@ -34,13 +44,15 @@ armarx_enable_aron_file_generation_for_target( TARGET_NAME "${LIB_NAME}" ARON_FILES - aron/trajectory.xml - aron/color.xml - aron/PackagePath.xml aron/AxisAlignedBoundingBox.xml + aron/color.xml + aron/Color.xml + aron/framed.xml + aron/Names.xml aron/OrientedBox.xml + aron/PackagePath.xml aron/time.xml - aron/framed.xml + aron/trajectory.xml ) add_library(aron::common ALIAS aroncommon) diff --git a/source/RobotAPI/libraries/aron/common/aron/Color.xml b/source/RobotAPI/libraries/aron/common/aron/Color.xml new file mode 100644 index 0000000000000000000000000000000000000000..180a9b372464de917400387032bdff9d4c086f79 --- /dev/null +++ b/source/RobotAPI/libraries/aron/common/aron/Color.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<AronTypeDefinition> + + <GenerateTypes> + + <Object name='simox::arondto::Color'> + <ObjectChild key='r'> + <int /> + </ObjectChild> + + <ObjectChild key='g'> + <int /> + </ObjectChild> + + <ObjectChild key='b'> + <int /> + </ObjectChild> + + <ObjectChild key='a'> + <int /> + </ObjectChild> + </Object> + + </GenerateTypes> + +</AronTypeDefinition> diff --git a/source/RobotAPI/libraries/aron/common/aron/Names.xml b/source/RobotAPI/libraries/aron/common/aron/Names.xml new file mode 100644 index 0000000000000000000000000000000000000000..4c57b39981e138cbf83143a06fa71d40019a9dbe --- /dev/null +++ b/source/RobotAPI/libraries/aron/common/aron/Names.xml @@ -0,0 +1,25 @@ +<!-- +Recognized and spoken names of a named entity. +--> +<?xml version="1.0" encoding="UTF-8" ?> +<AronTypeDefinition> + <GenerateTypes> + + <Object name="armarx::arondto::Names"> + + <ObjectChild key="recognized"> + <List> + <String/> + </List> + </ObjectChild> + + <ObjectChild key="spoken"> + <List> + <String/> + </List> + </ObjectChild> + + </Object> + + </GenerateTypes> +</AronTypeDefinition> diff --git a/source/RobotAPI/libraries/aron/common/aron_conversions/simox.cpp b/source/RobotAPI/libraries/aron/common/aron_conversions/simox.cpp index c87d13cdbd7e30aa5b7984cda69cb80261c378a7..f8629190d5f2dac1dd8189f4eb2be2425479464e 100644 --- a/source/RobotAPI/libraries/aron/common/aron_conversions/simox.cpp +++ b/source/RobotAPI/libraries/aron/common/aron_conversions/simox.cpp @@ -1,5 +1,8 @@ #include "simox.h" +#include <RobotAPI/libraries/aron/common/aron/AxisAlignedBoundingBox.aron.generated.h> +#include <RobotAPI/libraries/aron/common/aron/Color.aron.generated.h> +#include <RobotAPI/libraries/aron/common/aron/OrientedBox.aron.generated.h> void simox::fromAron(const arondto::AxisAlignedBoundingBox& dto, AxisAlignedBoundingBox& bo) @@ -15,7 +18,6 @@ void simox::toAron(arondto::AxisAlignedBoundingBox& dto, const AxisAlignedBoundi } - void simox::fromAron(const arondto::OrientedBox& dto, OrientedBoxf& bo) { bo = OrientedBoxf(dto.center, dto.orientation, dto.extents); @@ -28,3 +30,19 @@ void simox::toAron(arondto::OrientedBox& dto, const OrientedBoxf& bo) dto.extents = bo.dimensions(); } + +void simox::fromAron(const arondto::Color& dto, Color& bo) +{ + bo.r = dto.r; + bo.g = dto.g; + bo.b = dto.b; + bo.a = dto.a; +} + +void simox::toAron(arondto::Color& dto, const Color& bo) +{ + dto.r = bo.r; + dto.g = bo.g; + dto.b = bo.b; + dto.a = bo.a; +} diff --git a/source/RobotAPI/libraries/aron/common/aron_conversions/simox.h b/source/RobotAPI/libraries/aron/common/aron_conversions/simox.h index 64e847afbb06c5b58d92db3817c7adccf7e3b563..5440ac1c6e39134c0034ccb67a06c4fff94445fa 100644 --- a/source/RobotAPI/libraries/aron/common/aron_conversions/simox.h +++ b/source/RobotAPI/libraries/aron/common/aron_conversions/simox.h @@ -1,10 +1,10 @@ #pragma once +#include <SimoxUtility/color/Color.h> #include <SimoxUtility/shapes/AxisAlignedBoundingBox.h> -#include <RobotAPI/libraries/aron/common/aron/AxisAlignedBoundingBox.aron.generated.h> - #include <SimoxUtility/shapes/OrientedBox.h> -#include <RobotAPI/libraries/aron/common/aron/OrientedBox.aron.generated.h> + +#include <RobotAPI/libraries/aron/common/forward_declarations.h> namespace simox @@ -14,5 +14,8 @@ namespace simox void fromAron(const arondto::OrientedBox& dto, OrientedBoxf& bo); void toAron(arondto::OrientedBox& dto, const OrientedBoxf& bo); + + void fromAron(const arondto::Color& dto, Color& bo); + void toAron(arondto::Color& dto, const Color& bo); } diff --git a/source/RobotAPI/libraries/aron/common/forward_declarations.h b/source/RobotAPI/libraries/aron/common/forward_declarations.h new file mode 100644 index 0000000000000000000000000000000000000000..626147c3fc35e827a7b905c8a8b0e76babf3f25e --- /dev/null +++ b/source/RobotAPI/libraries/aron/common/forward_declarations.h @@ -0,0 +1,13 @@ +#pragma once + + +namespace simox::arondto +{ + class AxisAlignedBoundingBox; + class Color; + class OrientedBox; +} +namespace armarx::arondto +{ + class Names; +} diff --git a/source/RobotAPI/libraries/aron/common/json_conversions.h b/source/RobotAPI/libraries/aron/common/json_conversions.h new file mode 100644 index 0000000000000000000000000000000000000000..a56bd44287eb16161f84e5d1ef0f5496903e2669 --- /dev/null +++ b/source/RobotAPI/libraries/aron/common/json_conversions.h @@ -0,0 +1,3 @@ +#pragma once + +#include "json_conversions/armarx.h" diff --git a/source/RobotAPI/libraries/aron/common/json_conversions/armarx.cpp b/source/RobotAPI/libraries/aron/common/json_conversions/armarx.cpp new file mode 100644 index 0000000000000000000000000000000000000000..96a26aa0fbe0930037534dbce431fc715669c299 --- /dev/null +++ b/source/RobotAPI/libraries/aron/common/json_conversions/armarx.cpp @@ -0,0 +1,16 @@ +#include "armarx.h" + +#include <RobotAPI/libraries/aron/common/aron/Names.aron.generated.h> + + +void armarx::arondto::to_json(nlohmann::json& j, const Names& bo) +{ + j["recognized"] = bo.recognized; + j["spoken"] = bo.spoken; +} + +void armarx::arondto::from_json(const nlohmann::json& j, Names& bo) +{ + j.at("recognized").get_to(bo.recognized); + j.at("spoken").get_to(bo.spoken); +} diff --git a/source/RobotAPI/libraries/aron/common/json_conversions/armarx.h b/source/RobotAPI/libraries/aron/common/json_conversions/armarx.h new file mode 100644 index 0000000000000000000000000000000000000000..4da7677a12e5537ae2d41b0cb67362cc112d49c6 --- /dev/null +++ b/source/RobotAPI/libraries/aron/common/json_conversions/armarx.h @@ -0,0 +1,14 @@ +#pragma once + +#include <SimoxUtility/json/json.h> + +#include <RobotAPI/libraries/aron/common/forward_declarations.h> + + +namespace armarx::arondto +{ + + void to_json(nlohmann::json& j, const Names& bo); + void from_json(const nlohmann::json& j, Names& bo); + +} diff --git a/source/RobotAPI/libraries/aron/converter/opencv/CMakeLists.txt b/source/RobotAPI/libraries/aron/converter/opencv/CMakeLists.txt index 9fa96dc6af108cc089da8774d7fd59d28291c428..4a3eadd0caaec648db2a175f7a103b33b7a3acad 100644 --- a/source/RobotAPI/libraries/aron/converter/opencv/CMakeLists.txt +++ b/source/RobotAPI/libraries/aron/converter/opencv/CMakeLists.txt @@ -7,7 +7,9 @@ armarx_build_if(OpenCV_FOUND "OpenCV not available") set(LIBS aron - ${OpenCV_LIBRARIES} + opencv_core + opencv_imgcodecs + opencv_imgproc ) set(LIB_FILES diff --git a/source/RobotAPI/statecharts/SpeechObserverTestGroup/SpeechObserverTestGroup.scgxml b/source/RobotAPI/statecharts/SpeechObserverTestGroup/SpeechObserverTestGroup.scgxml index 31abf88dfe93cad5399c7da4ece19e38c9dad1b9..e04b89d7414961aba30f7d9119fa8dda09477b29 100644 --- a/source/RobotAPI/statecharts/SpeechObserverTestGroup/SpeechObserverTestGroup.scgxml +++ b/source/RobotAPI/statecharts/SpeechObserverTestGroup/SpeechObserverTestGroup.scgxml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <StatechartGroup name="SpeechObserverTestGroup" package="RobotAPI" generateContext="true"> <Proxies> - <Proxy value="RobotAPIInterfaces.speechObserver"/> + <Proxy value="ArmarXCoreInterfaces.speechObserver"/> <Proxy value="RobotAPIInterfaces.textToSpeech"/> </Proxies> <State filename="TestTextToSpeech.xml" visibility="public"/>