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 object poses from a specific provider.
83  * @param providerName The provider's name.
84  * @return The object poses from that provider.
85  */
87  fetchObjectPosesFromProvider(const std::string& providerName) const;
88 
89 
90  /**
91  * @brief Get the object pose storage's proxy.
92  */
94  getObjectPoseStorage() const;
95 
96  /**
97  * @brief Get the internal object finder.
98  */
99  const ObjectFinder&
100  getObjectFinder() const;
101 
102 
103  public:
104 
106 
108 
109  };
110 
111 }
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:107
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:97
armarx::objpose::ObjectPoseClient::objectPoseStorage
ObjectPoseStorageInterfacePrx objectPoseStorage
Definition: ObjectPoseClient.h:105
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:90
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::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:78
armarx::objpose::ObjectPoseMap
std::map< ObjectID, ObjectPose > ObjectPoseMap
Definition: forward_declarations.h:21