diff --git a/source/RobotAPI/interface/CMakeLists.txt b/source/RobotAPI/interface/CMakeLists.txt index 37c7f9315ebf9de3967d0716c886ab3a70cf794d..e72461ff8ebe4b7ca106dd59e7dfa8a71258fcbd 100644 --- a/source/RobotAPI/interface/CMakeLists.txt +++ b/source/RobotAPI/interface/CMakeLists.txt @@ -31,6 +31,9 @@ set(SLICE_FILES observers/SpeechObserverInterface.ice observers/GraspCandidateObserverInterface.ice + objectpose/ObjectPoseObserver.ice + objectpose/ObjectPoseProvider.ice + units/MultiHandUnitInterface.ice units/ForceTorqueUnit.ice units/InertialMeasurementUnit.ice diff --git a/source/RobotAPI/interface/objectpose/ObjectPoseObserver.ice b/source/RobotAPI/interface/objectpose/ObjectPoseObserver.ice new file mode 100644 index 0000000000000000000000000000000000000000..66e9e5401d861636ee2beeb4e6aa484692a25667 --- /dev/null +++ b/source/RobotAPI/interface/objectpose/ObjectPoseObserver.ice @@ -0,0 +1,54 @@ +/** +* 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 as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* 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 Lesser 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 +* @author Rainer Kartmann +* @copyright 2020 Humanoids Group, H2T, KIT +* @license http://www.gnu.org/licenses/gpl-2.0.txt +* GNU General Public License +*/ + +#pragma once + + +#include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <RobotAPI/interface/objectpose/ObjectPoseProvider.ice> + + +module armarx +{ + module objpose + { + interface ObjectPoseObserverInterface extends ObserverInterface, ObjectPoseTopic + { + InfoMap getAvailableProvidersWithInfo(); + Ice::StringSeq getAvailableProviderNames(); + ProviderInfo getProviderInfo(string providerName); + bool hasProvider(string providerName); + + ObjectPoseSeq getObjectPoses(); + ObjectPoseSeq getObjectPosesByProvider(string providerName); + + int getUpdateCounterByProvider(string providerName); + StringIntDictionary getAllUpdateCounters(); + + bool setProviderConfig(string providerName, StringVariantBaseMap config); + }; + }; + +}; + diff --git a/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice b/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice new file mode 100644 index 0000000000000000000000000000000000000000..98aed5955c0d6ef7e0473e26405df617b999156c --- /dev/null +++ b/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice @@ -0,0 +1,88 @@ +/** +* 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 as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* 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 Lesser 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 +* @author Rainer Kartmann +* @copyright 2020 Humanoids Group, H2T, KIT +* @license http://www.gnu.org/licenses/gpl-2.0.txt +* GNU General Public License +*/ + +#pragma once + +#include <ArmarXCore/interface/core/BasicTypes.ice> +#include <RobotAPI/interface/core/FramedPoseBase.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/observers/RequestableService.ice> + + +module armarx +{ + // A struct's name cannot cannot differ only in capitalization from its immediately enclosing module name. + module objpose + { + enum ObjectTypeEnum + { + AnyObject, KnownObject, UnknownObject + }; + + struct ObjectID + { + string project; ///< e.g. "KIT", "YCB", "SecondHands", ... + string name; ///< e.g. "Amicelli", "001_chips_can", ... + }; + + struct ObjectPose + { + ObjectTypeEnum objectType = AnyObject; + ObjectID objectID; + + PoseBase objectPose; ///< In robot frame. + PoseBase robotPose; ///< In global frame. + + /// Confidence in [0, 1] (1 = full, 0 = none). + float confidence = 0; + /// Source timestamp. + long timestampMicroSeconds = -1; + + string providerName; + }; + + sequence<ObjectPose> ObjectPoseSeq; + + + struct ProviderInfo + { + ObjectTypeEnum objectType = AnyObject; + StringVariantBaseMap currentConfig; + }; + + dictionary<string, ProviderInfo> InfoMap; + + + interface ObjectPoseTopic + { + void reportProviderInfo(string providerName, ProviderInfo info); + void reportObjectPoses(string providerName, ObjectPoseSeq candidates); + }; + + interface ObjectPoseProviderInterface extends RequestableServiceListenerInterface + { + }; + }; + +}; +