SegmentAdapter.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  * @package RobotAPI::armem_objects::Adapter
17  * @author Fabian Reister ( fabian dot reister at kit dot edu )
18  * @date 2024
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
26 #include <experimental/memory>
27 #include <mutex>
28 
29 #include <VirtualRobot/VirtualRobot.h>
30 
32 
35 #include <RobotAPI/interface/armem/server/ObjectMemoryInterface.h>
36 #include <RobotAPI/interface/core/RobotState.h>
41 
42 
43 #define ICE_CURRENT_ARG const Ice::Current& = Ice::emptyCurrent
44 
46 {
47 
48  /**
49  * @brief Helps implementing the `armarx::armem::server::ObjectInstanceSegmentInterface`.
50  */
52  virtual public armarx::Logging,
53  virtual public armarx::armem::server::FamiliarObjectInstanceSegmentInterface
54  {
55  public:
57 
58  std::string getName() const;
59  void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix = "");
60 
61  void init();
62  void
64  // KinematicUnitObserverInterfacePrx kinematicUnitObserver,
65  viz::Client arviz,
66  DebugObserverInterfacePrx debugObserver);
67 
68 
69  // ObjectPoseTopic interface
70  public:
71  // void reportProviderAvailable(const std::string& providerName,
72  // const objpose::ProviderInfo& info,
73  // ICE_CURRENT_ARG) override;
74  void reportFamiliarObjectPoses(const std::string& providerName,
75  const ::armarx::objpose::ProvidedFamiliarObjectPoseSeq& data,
76  ICE_CURRENT_ARG) override;
77 
78  // ObjectInstanceSegmentInterface interface
79 
80 
81  private:
82  void updateProviderInfo(const std::string& providerName, const objpose::ProviderInfo& info);
83 
84  void updateObjectPoses(const std::string& providerName,
85  const objpose::data::ProvidedObjectPoseSeq& providedPoses);
86  void handleProviderUpdate(const std::string& providerName);
87 
88 
89  // Visualization
90 
91  void visualizeRun();
92 
93 
94  public:
95  static const std::string linearPredictionEngineID;
96  static const std::vector<PredictionEngine> predictionEngines;
97 
98 
99  private:
100  viz::Client arviz;
101  DebugObserverInterfacePrx debugObserver;
102 
104 
105 
107  std::mutex visuMutex;
108  };
109 
110 } // namespace armarx::armem::server::obj::familiar_object_instance
111 
112 #undef ICE_CURRENT_ARG
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::connect
void connect(std::experimental::observer_ptr< robot_state::VirtualRobotReader > virtualRobotReader, viz::Client arviz, DebugObserverInterfacePrx debugObserver)
Definition: SegmentAdapter.cpp:87
Client.h
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::getName
std::string getName() const
Definition: SegmentAdapter.cpp:63
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter
Helps implementing the armarx::armem::server::ObjectInstanceSegmentInterface.
Definition: SegmentAdapter.h:51
Segment.h
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::predictionEngines
static const std::vector< PredictionEngine > predictionEngines
Definition: SegmentAdapter.h:96
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::reportFamiliarObjectPoses
void reportFamiliarObjectPoses(const std::string &providerName, const ::armarx::objpose::ProvidedFamiliarObjectPoseSeq &data, ICE_CURRENT_ARG) override
Definition: SegmentAdapter.cpp:111
std::experimental::fundamentals_v2::observer_ptr
Definition: ManagedIceObject.h:53
Decay.h
armarx::armem::server::obj::familiar_object_instance::Visu
Models decay of object localizations by decreasing the confidence the longer the object was not local...
Definition: Visu.h:27
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::init
void init()
Definition: SegmentAdapter.cpp:76
VirtualRobotReader.h
armarx::armem::server::obj::familiar_object_instance::Segment
Definition: Segment.h:35
MemoryToIceAdapter.h
armarx::objpose::ProvidedObjectPoseSeq
std::vector< ProvidedObjectPose > ProvidedObjectPoseSeq
Definition: forward_declarations.h:25
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::SegmentAdapter
SegmentAdapter(MemoryToIceAdapter &iceMemory)
Definition: SegmentAdapter.cpp:58
armarx::Logging
Base Class for all Logging classes.
Definition: Logging.h:239
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::linearPredictionEngineID
static const std::string linearPredictionEngineID
Definition: SegmentAdapter.h:95
Widgets.h
armarx::armem::server::obj::familiar_object_instance
Definition: Decay.cpp:8
armarx::viz::Client
Definition: Client.h:117
armarx::armem::server::obj::familiar_object_instance::SegmentAdapter::defineProperties
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="")
Definition: SegmentAdapter.cpp:69
Visu.h
ICE_CURRENT_ARG
#define ICE_CURRENT_ARG
Definition: SegmentAdapter.h:43