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
#define ICE_CURRENT_ARG
Base Class for all Logging classes.
Definition Logging.h:240
Helps connecting a Memory server to the Ice interface.
void reportFamiliarObjectPoses(const std::string &providerName, const ::armarx::objpose::ProvidedFamiliarObjectPoseSeq &data, ICE_CURRENT_ARG) override
static const std::vector< PredictionEngine > predictionEngines
void connect(std::experimental::observer_ptr< robot_state::VirtualRobotReader > virtualRobotReader, viz::Client arviz, DebugObserverInterfacePrx debugObserver)
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="")
Models decay of object localizations by decreasing the confidence the longer the object was not local...
Definition Visu.h:28
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.