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