diff --git a/source/RobotAPI/components/ObjectPoseObserver/CMakeLists.txt b/source/RobotAPI/components/ObjectPoseObserver/CMakeLists.txt index 9397d1bb222a8b93d17425e2ac9135b904fb811e..d5760158331a6f3dc664f3116a9f571e6830d37d 100644 --- a/source/RobotAPI/components/ObjectPoseObserver/CMakeLists.txt +++ b/source/RobotAPI/components/ObjectPoseObserver/CMakeLists.txt @@ -14,12 +14,14 @@ set(SOURCES ObjectPoseProviderPlugin.cpp ObjectFinder.cpp + ice_conversions.cpp ) set(HEADERS ObjectPoseObserver.h ObjectPoseProviderPlugin.h ObjectFinder.h + ice_conversions.h ) diff --git a/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.cpp b/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.cpp index ced81f772c2f435687712d76de30620a84ec9bc5..b969a58931b1d3242a0ebbbf5176c1ccc413810e 100644 --- a/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.cpp +++ b/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.cpp @@ -32,13 +32,6 @@ #include <RobotAPI/libraries/core/FramedPose.h> -std::ostream& armarx::objpose::operator<<(std::ostream& os, const ObjectID& id) -{ - return os << "'" << id.dataset << "/" << id.name << "'"; -} - - - namespace armarx { diff --git a/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.h b/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.h index 0bb447d0530bcd56052ac7c3a98dae468d6cb777..d06d2e2915b1e959dce91b727b498ba1140bf059 100644 --- a/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.h +++ b/source/RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.h @@ -33,15 +33,11 @@ #include <RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.h> #include "ObjectFinder.h" +#include "ice_conversions.h" #define ICE_CURRENT_ARG const Ice::Current& = Ice::emptyCurrent -namespace armarx::objpose -{ - std::ostream& operator<<(std::ostream& os, const ObjectID& id); -} - namespace armarx { diff --git a/source/RobotAPI/components/ObjectPoseObserver/ice_conversions.cpp b/source/RobotAPI/components/ObjectPoseObserver/ice_conversions.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0502b05d46ce9747707522052a40c1a69df0048c --- /dev/null +++ b/source/RobotAPI/components/ObjectPoseObserver/ice_conversions.cpp @@ -0,0 +1,13 @@ +#include "ice_conversions.h" + + +namespace armarx +{ + + std::ostream& objpose::operator<<(std::ostream& os, const ObjectID& id) + { + return os << "'" << id.dataset << "/" << id.name << "'"; + } + +} + diff --git a/source/RobotAPI/components/ObjectPoseObserver/ice_conversions.h b/source/RobotAPI/components/ObjectPoseObserver/ice_conversions.h new file mode 100644 index 0000000000000000000000000000000000000000..fc73211f96f470557795667cbc62e8405f33bdd6 --- /dev/null +++ b/source/RobotAPI/components/ObjectPoseObserver/ice_conversions.h @@ -0,0 +1,13 @@ +#pragma once + +#include <RobotAPI/interface/objectpose/types.h> +#include <RobotAPI/interface/objectpose/ObjectPoseProvider.h> + + +namespace armarx::objpose +{ + + std::ostream& operator<<(std::ostream& os, const ObjectID& id); + + +} diff --git a/source/RobotAPI/interface/CMakeLists.txt b/source/RobotAPI/interface/CMakeLists.txt index e72461ff8ebe4b7ca106dd59e7dfa8a71258fcbd..6ca8b8ee106668475988c67a2b26db34f895b640 100644 --- a/source/RobotAPI/interface/CMakeLists.txt +++ b/source/RobotAPI/interface/CMakeLists.txt @@ -31,6 +31,7 @@ set(SLICE_FILES observers/SpeechObserverInterface.ice observers/GraspCandidateObserverInterface.ice + objectpose/types.ice objectpose/ObjectPoseObserver.ice objectpose/ObjectPoseProvider.ice diff --git a/source/RobotAPI/interface/objectpose/ObjectPoseObserver.ice b/source/RobotAPI/interface/objectpose/ObjectPoseObserver.ice index 920395731ad73633b7d82d6a0a99ded551a3c5fe..3eddae79a480fa3aee046da4572e552e052fba50 100644 --- a/source/RobotAPI/interface/objectpose/ObjectPoseObserver.ice +++ b/source/RobotAPI/interface/objectpose/ObjectPoseObserver.ice @@ -26,6 +26,8 @@ #include <ArmarXCore/interface/core/BasicTypes.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> + +#include <RobotAPI/interface/objectpose/types.ice> #include <RobotAPI/interface/objectpose/ObjectPoseProvider.ice> @@ -36,7 +38,12 @@ module armarx struct ObjectPose { + /// Name of the providing component. + string providerName; + /// Known or unknown object. ObjectTypeEnum objectType = AnyObject; + + /// The object ID, i.e. dataset and name. ObjectID objectID; PoseBase objectPoseRobot; @@ -52,7 +59,8 @@ module armarx /// Source timestamp. long timestampMicroSeconds = -1; - string providerName; + /// Object bounding box in object's local coordinate frame. + Box localOOBB; }; sequence<ObjectPose> ObjectPoseSeq; diff --git a/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice b/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice index a58a76d5cd724a7905bd9f35d2305a25788b3d6f..61f9a99fb6872ba20a9cd47dd8976130914c257b 100644 --- a/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice +++ b/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice @@ -24,9 +24,8 @@ #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> + +#include <RobotAPI/interface/objectpose/types.ice> module armarx @@ -34,21 +33,14 @@ 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 dataset; ///< e.g. "KIT", "YCB", "SecondHands", ... - string name; ///< e.g. "Amicelli", "001_chips_can", ... - }; - sequence<ObjectID> ObjectIDSeq; - struct ProvidedObjectPose { + /// Name of the providing component. + string providerName; + /// Known or unknown object. ObjectTypeEnum objectType = AnyObject; + + /// The object ID, i.e. dataset and name. ObjectID objectID; /// Pose in `objectPoseFrame`. @@ -60,7 +52,8 @@ module armarx /// Source timestamp. long timestampMicroSeconds = -1; - string providerName; + /// Object bounding box in object's local coordinate frame. + Box localOOBB; }; sequence<ProvidedObjectPose> ProvidedObjectPoseSeq; diff --git a/source/RobotAPI/interface/objectpose/types.ice b/source/RobotAPI/interface/objectpose/types.ice new file mode 100644 index 0000000000000000000000000000000000000000..e91ac3fcf82b7a3548e44ecdc3ce6a43572f1bc9 --- /dev/null +++ b/source/RobotAPI/interface/objectpose/types.ice @@ -0,0 +1,62 @@ +/** +* 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 <RobotAPI/interface/core/PoseBase.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 dataset; ///< e.g. "KIT", "YCB", "SecondHands", ... + string name; ///< e.g. "Amicelli", "001_chips_can", ... + }; + sequence<ObjectID> ObjectIDSeq; + + + struct AABB + { + Vector3Base center; + Vector3Base extents; + }; + + struct Box + { + Vector3Base position; + QuaternionBase orientation; + Vector3Base extents; + }; + + }; +}; +