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