ObjectPoseClient.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <optional>
4 
5 #include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.h>
9 
10 
11 namespace armarx::objpose
12 {
13 
14  /**
15  * @brief Provides access to the `armarx::objpose::ObjectPoseStorageInterface`
16  * (aka the object memory).
17  */
19  {
20  public:
21 
22  /// Construct a disconnected client.
24  /// Construct a client and connect it to the object pose storage.
27  const ObjectFinder& finder = {}
28  );
29 
30  /**
31  * @brief Connect to the given object pose storage.
32  *
33  * This function can be used after default-constructing the client.
34  *
35  * @param objectPoseStorage The object pose storage.
36  */
37  void
39 
40  /**
41  * @brief Indicate whether this client is connected to an object pose
42  * storage.
43  *
44  * That is, whether its proxy has been set via the constructor or
45  * `connect()`.
46  *
47  * If false, all `fetch*()` functions will return empty results.
48  *
49  * @return True if connected
50  */
51  bool
52  isConnected() const;
53 
54 
55  /**
56  * @brief Fetch all known object poses.
57  * @return The known object poses.
58  */
60  fetchObjectPoses() const;
61 
62  /**
63  * @brief Fetch all known object poses.
64  * @return The known object poses, with object ID as key.
65  */
67  fetchObjectPosesAsMap() const;
68 
69  /**
70  * @brief Fetch the pose of a single object.
71  *
72  * This is a network call. If you need multiple object poses, use
73  * `fetchObjectPoses()` instead.
74  *
75  * @param objectID The object's ID.
76  * @return The object's pose, if known.
77  */
78  std::optional<ObjectPose>
79  fetchObjectPose(const ObjectID& objectID) const;
80 
81  /**
82  * @brief Fetch the pose of a single object and a single provider.
83  *
84  * This is a network call. If you need multiple object poses, use
85  * `fetchObjectPoses()` instead.
86  *
87  * @param objectID The object's ID.
88  * @return The object's pose, if known.
89  */
90  std::optional<ObjectPose>
91  fetchObjectPoseFromProvider(const ObjectID& objectID, const std::string& providerName) const;
92 
93  /**
94  * @brief Fetch object poses from a specific provider.
95  * @param providerName The provider's name.
96  * @return The object poses from that provider.
97  */
99  fetchObjectPosesFromProvider(const std::string& providerName) const;
100 
101 
102  /**
103  * @brief Get the object pose storage's proxy.
104  */
106  getObjectPoseStorage() const;
107 
108  /**
109  * @brief Get the internal object finder.
110  */
111  const ObjectFinder&
112  getObjectFinder() const;
113 
114 
115  public:
116 
118 
120 
121  };
122 
123 }
armarx::objpose::ObjectPoseClient::fetchObjectPoses
ObjectPoseSeq fetchObjectPoses() const
Fetch all known object poses.
Definition: ObjectPoseClient.cpp:39
armarx::ObjectID
A known object ID of the form "Dataset/ClassName" or "Dataset/ClassName/InstanceName".
Definition: ObjectID.h:11
armarx::objpose::ObjectPoseSeq
std::vector< ObjectPose > ObjectPoseSeq
Definition: forward_declarations.h:20
armarx::objpose::ObjectPoseClient::objectFinder
ObjectFinder objectFinder
Definition: ObjectPoseClient.h:119
armarx::objpose::ObjectPoseClient::fetchObjectPose
std::optional< ObjectPose > fetchObjectPose(const ObjectID &objectID) const
Fetch the pose of a single object.
Definition: ObjectPoseClient.cpp:63
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:18
armarx::objpose::ObjectPoseClient::getObjectFinder
const ObjectFinder & getObjectFinder() const
Get the internal object finder.
Definition: ObjectPoseClient.cpp:111
armarx::objpose::ObjectPoseClient::objectPoseStorage
ObjectPoseStorageInterfacePrx objectPoseStorage
Definition: ObjectPoseClient.h:117
armarx::ObjectFinder
Used to find objects in the ArmarX objects repository [1] (formerly [2]).
Definition: ObjectFinder.h:23
armarx::objpose::ObjectPoseClient::fetchObjectPosesAsMap
ObjectPoseMap fetchObjectPosesAsMap() const
Fetch all known object poses.
Definition: ObjectPoseClient.cpp:51
armarx::objpose::ObjectPoseClient::getObjectPoseStorage
const ObjectPoseStorageInterfacePrx & getObjectPoseStorage() const
Get the object pose storage's proxy.
Definition: ObjectPoseClient.cpp:104
armarx::objpose
This file is part of ArmarX.
Definition: objpose.h:7
ObjectID.h
ObjectPose.h
IceInternal::ProxyHandle<::IceProxy::armarx::objpose::ObjectPoseStorageInterface >
armarx::objpose::ObjectPoseClient::ObjectPoseClient
ObjectPoseClient()
Construct a disconnected client.
Definition: ObjectPoseClient.cpp:9
armarx::objpose::ObjectPoseClient::fetchObjectPoseFromProvider
std::optional< ObjectPose > fetchObjectPoseFromProvider(const ObjectID &objectID, const std::string &providerName) const
Fetch the pose of a single object and a single provider.
Definition: ObjectPoseClient.cpp:77
armarx::objpose::ObjectPoseClient::isConnected
bool isConnected() const
Indicate whether this client is connected to an object pose storage.
Definition: ObjectPoseClient.cpp:32
armarx::objpose::ObjectPoseClient::connect
void connect(const ObjectPoseStorageInterfacePrx &objectPoseStorage)
Connect to the given object pose storage.
Definition: ObjectPoseClient.cpp:24
ObjectFinder.h
armarx::objpose::ObjectPoseClient::fetchObjectPosesFromProvider
ObjectPoseSeq fetchObjectPosesFromProvider(const std::string &providerName) const
Fetch object poses from a specific provider.
Definition: ObjectPoseClient.cpp:92
armarx::objpose::ObjectPoseMap
std::map< ObjectID, ObjectPose > ObjectPoseMap
Definition: forward_declarations.h:21