ObjectPoseClientPlugin.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.h>
9 
10 
11 namespace armarx::plugins
12 {
14  {
15  public:
16 
17  using ComponentPlugin::ComponentPlugin;
18 
21 
22  template<class...Ts>
23  std::optional<ObjectInfo> findObject(Ts&& ...ts) const
24  {
25  return _finder.findObject(std::forward<Ts>(ts)...);
26  }
27 
28  template<class...Ts>
29  VirtualRobot::ManipulationObjectPtr
30  findAndLoadObject(Ts&& ...ts) const
31  {
32  return findAndLoadObject(findObject(std::forward<Ts>(ts)...));
33  }
34  VirtualRobot::ManipulationObjectPtr
35  findAndLoadObject(const std::optional<ObjectInfo>& ts) const
36  {
37  return _finder.loadManipulationObject(ts);
38  }
39 
40  const ObjectFinder& setObjectFinderPath(const std::string& path);
41  const ObjectFinder& getObjectFinder() const;
42 
43 
44  private:
45 
46  void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
47 
48  void preOnInitComponent() override;
49  void preOnConnectComponent() override;
50 
51  static constexpr const char* PROPERTY_NAME = "ObjectMemoryName";
52 
53  ObjectFinder _finder;
54  objpose::ObjectPoseStorageInterfacePrx _objectPoseStorage;
55 
56  };
57 }
58 
59 
61 
62 namespace armarx
63 {
64  /**
65  * @brief Provides an `objpose::ObjectPoseTopicPrx objectPoseTopic` as member variable.
66  */
68  virtual public ManagedIceObject
69  {
70  public:
71 
72  /// Allow usage like: ObjectPoseClient::getObjects()
74 
76 
79 
81  objpose::ObjectPoseSeq getObjectPosesByProvider(const std::string& providerName);
82 
83 
86 
87  const ObjectFinder& getObjectFinder() const;
88 
89 
90  private:
91 
93 
94  };
95 }
armarx::ObjectPoseStorageInterfacePrx
::IceInternal::ProxyHandle<::IceProxy::armarx::objpose::ObjectPoseStorageInterface > ObjectPoseStorageInterfacePrx
Definition: ObjectPoseClientWidget.h:51
armarx::objpose::ObjectPoseSeq
std::vector< ObjectPose > ObjectPoseSeq
Definition: forward_declarations.h:20
armarx::plugins::ObjectPoseClientPlugin::getObjectFinder
const ObjectFinder & getObjectFinder() const
Definition: ObjectPoseClientPlugin.cpp:45
armarx::plugins::ObjectPoseClientPlugin::createObjectPoseStorage
objpose::ObjectPoseStorageInterfacePrx createObjectPoseStorage()
Definition: ObjectPoseClientPlugin.cpp:29
armarx::ObjectPoseClientPluginUser
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
Definition: ObjectPoseClientPlugin.h:67
armarx::plugins::ObjectPoseClientPlugin::findObject
std::optional< ObjectInfo > findObject(Ts &&...ts) const
Definition: ObjectPoseClientPlugin.h:23
armarx::ObjectFinder::loadManipulationObject
static VirtualRobot::ManipulationObjectPtr loadManipulationObject(const std::optional< ObjectInfo > &ts)
Definition: ObjectFinder.cpp:300
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:18
armarx::ObjectFinder
Used to find objects in the ArmarX objects repository [1] (formerly [2]).
Definition: ObjectFinder.h:23
ManagedIceObject.h
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
armarx::ComponentPlugin
Definition: ComponentPlugin.h:38
armarx::ObjectPoseClientPluginUser::createObjectPoseStorage
objpose::ObjectPoseStorageInterfacePrx createObjectPoseStorage()
Definition: ObjectPoseClientPlugin.cpp:58
ObjectPoseClient.h
armarx::plugins::ObjectPoseClientPlugin::createClient
objpose::ObjectPoseClient createClient()
Definition: ObjectPoseClientPlugin.cpp:34
ObjectPose.h
armarx::ObjectPoseClientPluginUser::getObjectFinder
const ObjectFinder & getObjectFinder() const
Definition: ObjectPoseClientPlugin.cpp:90
armarx::ObjectPoseClientPluginUser::ObjectPoseClientPluginUser
ObjectPoseClientPluginUser()
Definition: ObjectPoseClientPlugin.cpp:53
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:163
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::plugins::ObjectPoseClientPlugin::findAndLoadObject
VirtualRobot::ManipulationObjectPtr findAndLoadObject(const std::optional< ObjectInfo > &ts) const
Definition: ObjectPoseClientPlugin.h:35
armarx::plugins::ObjectPoseClientPlugin
Definition: ObjectPoseClientPlugin.h:13
armarx::ObjectFinder::findObject
std::optional< ObjectInfo > findObject(const std::string &dataset, const std::string &name) const
Definition: ObjectFinder.cpp:65
armarx::plugins::ObjectPoseClientPlugin::setObjectFinderPath
const ObjectFinder & setObjectFinderPath(const std::string &path)
Definition: ObjectPoseClientPlugin.cpp:39
ComponentPlugin.h
armarx::ObjectPoseClientPluginUser::getObjectPoseClientPlugin
plugins::ObjectPoseClientPlugin & getObjectPoseClientPlugin()
Definition: ObjectPoseClientPlugin.cpp:81
armarx::ObjectPoseClientPluginUser::getClient
objpose::ObjectPoseClient getClient() const
Definition: ObjectPoseClientPlugin.cpp:64
armarx::plugins::ObjectPoseClientPlugin::findAndLoadObject
VirtualRobot::ManipulationObjectPtr findAndLoadObject(Ts &&...ts) const
Definition: ObjectPoseClientPlugin.h:30
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::ObjectPoseClientPluginUser::getObjectPoses
objpose::ObjectPoseSeq getObjectPoses()
Definition: ObjectPoseClientPlugin.cpp:70
ObjectFinder.h
armarx::ObjectPoseClientPluginUser::getObjectPosesByProvider
objpose::ObjectPoseSeq getObjectPosesByProvider(const std::string &providerName)
Definition: ObjectPoseClientPlugin.cpp:75