Skip to content
Snippets Groups Projects
Commit da3d9847 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add documentation and include

parent 62942f3d
No related branches found
No related tags found
1 merge request!225Feature/object pose client extension
#pragma once #pragma once
#include "RobotAPI/libraries/ArmarXObjects/ObjectID.h" #include <optional>
#include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.h> #include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.h>
#include <RobotAPI/libraries/ArmarXObjects/ObjectID.h>
#include <RobotAPI/libraries/ArmarXObjects/ObjectFinder.h> #include <RobotAPI/libraries/ArmarXObjects/ObjectFinder.h>
#include <RobotAPI/libraries/ArmarXObjects/ObjectPose.h> #include <RobotAPI/libraries/ArmarXObjects/ObjectPose.h>
...@@ -17,30 +19,81 @@ namespace armarx::objpose ...@@ -17,30 +19,81 @@ namespace armarx::objpose
{ {
public: public:
/// Construct a disconnected client.
ObjectPoseClient(); ObjectPoseClient();
ObjectPoseClient(const ObjectPoseStorageInterfacePrx& objectPoseStorage, /// Construct a client and connect it to the object pose storage.
const ObjectFinder& finder = {}); ObjectPoseClient(
const ObjectPoseStorageInterfacePrx& objectPoseStorage,
const ObjectFinder& finder = {}
);
/**
* @brief Connect to the given object pose storage.
*
* This function can be used after default-constructing the client.
*
* @param objectPoseStorage The object pose storage.
*/
void connect(const ObjectPoseStorageInterfacePrx& objectPoseStorage); void connect(const ObjectPoseStorageInterfacePrx& objectPoseStorage);
/**
* @brief Indicate whether this client is connected to an object pose
* storage.
*
* That is, whether its proxy has been set via the constructor or
* `connect()`.
*
* If false, all `fetch*()` functions will return empty results.
*
* @return True if connected
*/
bool isConnected() const; bool isConnected() const;
/**
* @brief Fetch all known object poses.
* @return The known object poses.
*/
ObjectPoseSeq ObjectPoseSeq
fetchObjectPoses(); fetchObjectPoses();
/**
* @brief Fetch all known object poses.
* @return The known object poses, with object ID as key.
*/
ObjectPoseMap ObjectPoseMap
fetchObjectPosesAsMap(); fetchObjectPosesAsMap();
/**
* @brief Fetch the pose of a single object.
*
* This is a network call. If you need multiple object poses, use
* `fetchObjectPoses()` instead.
*
* @param objectID The object's ID.
* @return The object's pose, if known.
*/
std::optional<ObjectPose> std::optional<ObjectPose>
fetchObjectPose(const ObjectID& objectID); fetchObjectPose(const ObjectID& objectID);
/**
* @brief Fetch object poses from a specific provider.
* @param providerName The provider's name.
* @return The object poses from that provider.
*/
ObjectPoseSeq ObjectPoseSeq
fetchObjectPosesFromProvider(const std::string& providerName); fetchObjectPosesFromProvider(const std::string& providerName);
/**
* @brief Get the object pose storage's proxy.
*/
const ObjectPoseStorageInterfacePrx& const ObjectPoseStorageInterfacePrx&
getObjectPoseStorage() const; getObjectPoseStorage() const;
/**
* @brief Get the internal object finder.
*/
const ObjectFinder& const ObjectFinder&
getObjectFinder() const; getObjectFinder() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment