GraspCandidateWriter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <mutex>
4 
6 
7 #include <RobotAPI/interface/units/GraspCandidateProviderInterface.h>
10 
11 namespace armarx::armem
12 {
14  {
15  public:
16  GraspCandidateWriter() = default;
17 
18  void connect(armem::client::MemoryNameSystem& memoryNameSystem);
19 
21 
22  bool commitGraspCandidate(const armarx::grasping::GraspCandidate& candidate,
23  const armem::Time& timestamp,
24  const std::string& provider);
25  bool commitBimanualGraspCandidate(const armarx::grasping::BimanualGraspCandidate& candidate,
26  const armem::Time& timestamp,
27  const std::string& provider);
28 
29  bool commitGraspCandidateSeq(const armarx::grasping::GraspCandidateSeq& candidates,
30  const armem::Time& timestamp,
31  const std::string& provider);
33  const armarx::grasping::BimanualGraspCandidateSeq& candidates,
34  const armem::Time& timestamp,
35  const std::string& provider);
36 
37 
38  private:
39  bool commitToMemory(const std::vector<armarx::aron::data::DictPtr>& instances,
40  const std::string& providerName,
41  const std::string& entityName,
42  const armem::Time& timestamp,
43  const std::string& coreMemoryName);
44 
45  armem::client::Writer memoryWriter;
46 
47  struct Properties
48  {
49  std::string memoryName = "Grasp";
50  std::string graspMemoryName = "GraspCandidate";
51  std::string bimanualGraspMemoryName = "BimanualGraspCandidate";
52  } properties;
53 
54  std::mutex memoryWriterMutex;
55 
56  const std::string propertyPrefix = "mem.grasping.";
57  };
58 
59 
60 } // namespace armarx::armem
Writer.h
client.h
armarx::armem::GraspCandidateWriter::registerPropertyDefinitions
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
Definition: GraspCandidateWriter.cpp:32
armarx::armem::GraspCandidateWriter
Definition: GraspCandidateWriter.h:13
armarx::armem
Definition: LegacyRobotStateMemoryAdapter.cpp:31
armarx::armem::client::Writer
Helps a memory client sending data to a memory.
Definition: Writer.h:22
armarx::armem::GraspCandidateWriter::commitBimanualGraspCandidate
bool commitBimanualGraspCandidate(const armarx::grasping::BimanualGraspCandidate &candidate, const armem::Time &timestamp, const std::string &provider)
Definition: GraspCandidateWriter.cpp:68
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition: constants.h:28
IceUtil::Handle< class PropertyDefinitionContainer >
forward_declarations.h
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:69
armarx::armem::GraspCandidateWriter::commitBimanualGraspCandidateSeq
bool commitBimanualGraspCandidateSeq(const armarx::grasping::BimanualGraspCandidateSeq &candidates, const armem::Time &timestamp, const std::string &provider)
Definition: GraspCandidateWriter.cpp:125
armarx::armem::GraspCandidateWriter::commitGraspCandidateSeq
bool commitGraspCandidateSeq(const armarx::grasping::GraspCandidateSeq &candidates, const armem::Time &timestamp, const std::string &provider)
Definition: GraspCandidateWriter.cpp:90
armarx::armem::GraspCandidateWriter::GraspCandidateWriter
GraspCandidateWriter()=default
armarx::armem::GraspCandidateWriter::commitGraspCandidate
bool commitGraspCandidate(const armarx::grasping::GraspCandidate &candidate, const armem::Time &timestamp, const std::string &provider)
Definition: GraspCandidateWriter.cpp:49
armarx::armem::GraspCandidateWriter::connect
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
Definition: GraspCandidateWriter.cpp:13