Skip to content
Snippets Groups Projects
Commit 9368239e authored by Christoph Pohl's avatar Christoph Pohl
Browse files

Added new Memory to GraspCandidateObserver

parent f662d6a9
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ set(LIBS ...@@ -6,6 +6,7 @@ set(LIBS
RobotAPICore RobotAPICore
ArmarXCoreObservers ArmarXCoreObservers
ArmarXCoreEigen3Variants ArmarXCoreEigen3Variants
GraspingUtility
) )
set(LIB_HEADERS set(LIB_HEADERS
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
using namespace armarx; using namespace armarx;
using namespace armarx::grasping; using namespace armarx::grasping;
GraspCandidateObserver::GraspCandidateObserver() GraspCandidateObserver::GraspCandidateObserver() : graspCandidateWriter(memoryNameSystem())
{ {
} }
...@@ -53,6 +53,7 @@ void GraspCandidateObserver::onInitObserver() ...@@ -53,6 +53,7 @@ void GraspCandidateObserver::onInitObserver()
void GraspCandidateObserver::onConnectObserver() void GraspCandidateObserver::onConnectObserver()
{ {
configTopic = getTopic<GraspCandidateProviderInterfacePrx>(getProperty<std::string>("ConfigTopicName").getValue()); configTopic = getTopic<GraspCandidateProviderInterfacePrx>(getProperty<std::string>("ConfigTopicName").getValue());
graspCandidateWriter.connect();
} }
PropertyDefinitionsPtr GraspCandidateObserver::createPropertyDefinitions() PropertyDefinitionsPtr GraspCandidateObserver::createPropertyDefinitions()
...@@ -125,6 +126,7 @@ void GraspCandidateObserver::reportGraspCandidates(const std::string& providerNa ...@@ -125,6 +126,7 @@ void GraspCandidateObserver::reportGraspCandidates(const std::string& providerNa
{ {
std::unique_lock lock(dataMutex); std::unique_lock lock(dataMutex);
this->candidates[providerName] = candidates; this->candidates[providerName] = candidates;
graspCandidateWriter.commitGraspCandidateSeq(candidates, armarx::armem::Time::now(), providerName);
handleProviderUpdate(providerName, candidates.size()); handleProviderUpdate(providerName, candidates.size());
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <ArmarXCore/observers/Observer.h> #include <ArmarXCore/observers/Observer.h>
#include <RobotAPI/interface/observers/GraspCandidateObserverInterface.h> #include <RobotAPI/interface/observers/GraspCandidateObserverInterface.h>
#include <RobotAPI/libraries/armem/client/plugins/PluginUser.h>
#include <RobotAPI/libraries/GraspingUtility/GraspCandidateWriter.h>
#include <mutex> #include <mutex>
...@@ -52,6 +54,7 @@ namespace armarx ...@@ -52,6 +54,7 @@ namespace armarx
*/ */
class GraspCandidateObserver : class GraspCandidateObserver :
virtual public Observer, virtual public Observer,
virtual public armarx::armem::ClientPluginUser,
virtual public grasping::GraspCandidateObserverInterface virtual public grasping::GraspCandidateObserverInterface
{ {
public: public:
...@@ -124,7 +127,7 @@ namespace armarx ...@@ -124,7 +127,7 @@ namespace armarx
grasping::GraspCandidateSeq selectedCandidates; grasping::GraspCandidateSeq selectedCandidates;
grasping::BimanualGraspCandidateSeq selectedBimanualCandidates; grasping::BimanualGraspCandidateSeq selectedBimanualCandidates;
armarx::armem::GraspCandidateWriter graspCandidateWriter;
void handleProviderUpdate(const std::string& providerName, int candidateCount); void handleProviderUpdate(const std::string& providerName, int candidateCount);
}; };
......
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