27 #include <RobotAPI/interface/observers/GraspCandidateObserverInterface.h>
46 defineOptionalProperty<std::string>(
"GraspCandidatesTopicName",
"GraspCandidatesTopic",
"Name of the Grasp Candidate Topic");
47 defineOptionalProperty<std::string>(
"ConfigTopicName",
"GraspCandidateProviderConfigTopic",
"Name of the Grasp Candidate Provider Config Topic");
58 virtual public grasping::GraspCandidateObserverInterface
66 return "GraspCandidateObserver";
77 static bool FilterMatches(
const grasping::CandidateFilterConditionPtr& filter,
const std::string& providerName,
const grasping::GraspCandidatePtr& candidate);
82 void reportProviderInfo(
const std::string& providerName,
const grasping::ProviderInfoPtr& info, const ::Ice::Current& = Ice::emptyCurrent)
override;
83 void reportGraspCandidates(
const std::string& providerName,
const grasping::GraspCandidateSeq& candidates, const ::Ice::Current& = Ice::emptyCurrent)
override;
84 void reportBimanualGraspCandidates(
const std::string& providerName,
const grasping::BimanualGraspCandidateSeq& candidates, const ::Ice::Current& = Ice::emptyCurrent)
override;
89 grasping::StringSeq getAvailableProviderNames(const ::Ice::Current&)
override;
90 grasping::ProviderInfoPtr
getProviderInfo(
const std::string& providerName, const ::Ice::Current& = Ice::emptyCurrent)
override;
91 bool hasProvider(
const std::string& providerName,
const Ice::Current&
c)
override;
92 grasping::GraspCandidateSeq
getAllCandidates(const ::Ice::Current& = Ice::emptyCurrent)
override;
93 grasping::GraspCandidateSeq
getCandidatesByProvider(
const std::string& providerName,
const Ice::Current&
c = Ice::emptyCurrent)
override;
94 grasping::GraspCandidateSeq
getCandidatesByProviders(
const Ice::StringSeq& providerNames,
const Ice::Current&
c = Ice::emptyCurrent)
override;
95 grasping::GraspCandidateSeq
getCandidatesByFilter(
const grasping::CandidateFilterConditionPtr& filter, const ::Ice::Current& = Ice::emptyCurrent)
override;
100 void setSelectedCandidates(
const grasping::GraspCandidateSeq& candidates, const ::Ice::Current& = Ice::emptyCurrent)
override;
101 grasping::GraspCandidateSeq
getSelectedCandidates(const ::Ice::Current& = Ice::emptyCurrent)
override;
108 void setSelectedBimanualCandidates(
const grasping::BimanualGraspCandidateSeq& candidates, const ::Ice::Current& = Ice::emptyCurrent)
override;
116 void checkHasProvider(
const std::string& providerName);
117 grasping::StringSeq getAvailableProviderNames();
118 std::mutex dataMutex;
119 std::map<std::string, grasping::GraspCandidateSeq> candidates;
120 std::map<std::string, grasping::BimanualGraspCandidateSeq> bimanualCandidates;
121 grasping::InfoMap providers;
122 std::map<std::string, int> updateCounters;
124 grasping::GraspCandidateProviderInterfacePrx configTopic;
126 std::mutex selectedCandidatesMutex;
127 grasping::GraspCandidateSeq selectedCandidates;
129 grasping::BimanualGraspCandidateSeq selectedBimanualCandidates;
132 void handleProviderUpdate(
const std::string& providerName,
int candidateCount);