ObjectPoseProviderExample.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package RobotAPI::ArmarXObjects::ObjectPoseProviderExample
17 * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18 * @date 2020
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <mutex>
26
29#include <ArmarXCore/interface/observers/ObserverInterface.h>
30// #include <RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.h>
31
32// Include the ProviderPlugin
36
37namespace armarx
38{
39
40 /**
41 * @defgroup Component-ObjectPoseProviderExample ObjectPoseProviderExample
42 * @ingroup RobotAPI-Components
43 * A description of the component ObjectPoseProviderExample.
44 *
45 * @class ObjectPoseProviderExample
46 * @ingroup Component-ObjectPoseProviderExample
47 * @brief Brief description of class ObjectPoseProviderExample.
48 *
49 * Detailed description of class ObjectPoseProviderExample.
50 */
52 virtual public armarx::Component
53 // Derive from the provider plugin.
54 ,
56 {
57 public:
58 /// @see armarx::ManagedIceObject::getDefaultName()
59 std::string getDefaultName() const override;
60
61
62 // Implement the ObjectPoseProvider interface
63 public:
64 objpose::ProviderInfo getProviderInfo(const Ice::Current& = Ice::emptyCurrent) override;
65 objpose::provider::RequestObjectsOutput
66 requestObjects(const objpose::provider::RequestObjectsInput& input,
67 const Ice::Current&) override;
68
69
70 protected:
71 /// @see PropertyUser::createPropertyDefinitions()
73
74 /// @see armarx::ManagedIceObject::onInitComponent()
75 void onInitComponent() override;
76
77 /// @see armarx::ManagedIceObject::onConnectComponent()
78 void onConnectComponent() override;
79
80 /// @see armarx::ManagedIceObject::onDisconnectComponent()
81 void onDisconnectComponent() override;
82
83 /// @see armarx::ManagedIceObject::onExitComponent()
84 void onExitComponent() override;
85
86
87 private:
88 void poseEstimationTaskRun();
89
90
91 private:
92 // To be moved to plugin
93 std::mutex requestedObjectsMutex;
94 objpose::RequestedObjects requestedObjects;
95
96
97 objpose::ProviderInfo providerInfo;
98
99 armarx::ObjectFinder objectFinder;
100 std::vector<std::string> initialObjectIDs = {"KIT/Amicelli", "KIT/YellowSaltCylinder"};
101 bool singleShot = false;
102
103
105
106 /// Debug observer. Used to visualize e.g. time series.
108 };
109} // namespace armarx
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
Used to find objects in the ArmarX objects repository [1] (formerly [2]).
Brief description of class ObjectPoseProviderExample.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
objpose::provider::RequestObjectsOutput requestObjects(const objpose::provider::RequestObjectsInput &input, const Ice::Current &) override
std::string getDefaultName() const override
objpose::ProviderInfo getProviderInfo(const Ice::Current &=Ice::emptyCurrent) override
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
Handles requests for object pose estimation from the ObjectPoseProviderInterface.
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.