KnownGraspCandidateReader.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <mutex>
25 #include <optional>
26 
28 
31 #include <RobotAPI/libraries/armem_grasping/aron/KnownGraspCandidate.aron.generated.h>
32 
34 {
35  class Reader
36  {
37  public:
38  Reader() = default;
39  virtual ~Reader() = default;
40 
42  void connect(armem::client::MemoryNameSystem& memoryNameSystem);
43 
44  std::optional<armem::grasping::arondto::KnownGraspInfo>
45  queryKnownGraspInfoByEntityName(const std::string&, const armem::Time&);
46  std::optional<armem::grasping::arondto::KnownGraspInfo>
48 
49  private:
50  struct Properties
51  {
52  std::string memoryName = "Grasp";
53  std::string coreSegmentName = "KnownGraspCandidate";
54  } properties;
55 
56  const std::string propertyPrefix = "mem.grasping.knowngrasps.";
57 
58  armem::client::Reader memoryReader;
59  };
60 
61 
62 } // namespace armarx::armem::grasping::known_grasps
armarx::armem::client::Reader
Reads data from a memory server.
Definition: Reader.h:24
armarx::armem::grasping::known_grasps::Reader::queryKnownGraspInfoByEntityName
std::optional< armem::grasping::arondto::KnownGraspInfo > queryKnownGraspInfoByEntityName(const std::string &, const armem::Time &)
Definition: KnownGraspCandidateReader.cpp:73
Reader.h
armarx::armem::grasping::known_grasps::Reader::queryKnownGraspInfo
std::optional< armem::grasping::arondto::KnownGraspInfo > queryKnownGraspInfo(const armem::wm::Memory &memory, const armem::Time &)
Definition: KnownGraspCandidateReader.cpp:55
armarx::memory
Brief description of class memory.
Definition: memory.h:39
armarx::armem::grasping::known_grasps::Reader::Reader
Reader()=default
armarx::armem::grasping::known_grasps::Reader
Definition: KnownGraspCandidateReader.h:35
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
armarx::armem::grasping::known_grasps::Reader::registerPropertyDefinitions
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
Definition: KnownGraspCandidateReader.cpp:24
armarx::armem::grasping::known_grasps::Reader::~Reader
virtual ~Reader()=default
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
PropertyDefinitionContainer.h
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition: constants.h:28
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:69
armarx::armem::grasping::known_grasps
Definition: KnownGraspCandidateReader.cpp:21
armarx::armem::grasping::known_grasps::Reader::connect
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
Definition: KnownGraspCandidateReader.cpp:38
MemoryNameSystem.h