ObjectPoseClientExample.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::ArmarXObjects::ObjectPoseClientExample
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
28 
30 
31 // Include the ClientPlugin
33 
34 
35 namespace armarx
36 {
37 
38  /**
39  * @defgroup Component-ObjectPoseClientExample ObjectPoseClientExample
40  * @ingroup RobotAPI-Components
41  *
42  * An example showing how to get object poses from the ObjectPoseStorage.
43  *
44  * @class ObjectPoseClientExample
45  * @ingroup Component-ObjectPoseClientExample
46  * @brief Brief description of class ObjectPoseClientExample.
47  *
48  * Gets and visualizes object poses from the ObjectPoseStorage.
49  */
51  virtual public armarx::Component
53  , virtual public armarx::ArVizComponentPluginUser
54  // Derive from the client plugin.
55  , virtual public armarx::ObjectPoseClientPluginUser
56 
57  {
58  public:
59 
60  /// @see armarx::ManagedIceObject::getDefaultName()
61  std::string getDefaultName() const override;
62 
63 
64  protected:
65 
67 
68  void onInitComponent() override;
69  void onConnectComponent() override;
70  void onDisconnectComponent() override;
71  void onExitComponent() override;
72 
73 
74  private:
75 
76  void objectProcessingTaskRun();
77 
78  viz::Layer visualizePredictions(const objpose::ObjectPoseClient& client,
79  const objpose::ObjectPoseSeq& objectPoses);
80 
81 
82  private:
83 
84  armarx::SimpleRunningTask<>::pointer_type objectProcessingTask;
85 
86  struct Properties
87  {
88  int predictionsPerObject = 5; // NOLINT
89  int millisecondPredictionIncrement = 200; // NOLINT
90  };
91  Properties p;
92 
93  };
94 }
ArVizComponentPlugin.h
armarx::objpose::ObjectPoseSeq
std::vector< ObjectPose > ObjectPoseSeq
Definition: forward_declarations.h:20
armarx::ObjectPoseClientExample::getDefaultName
std::string getDefaultName() const override
Definition: ObjectPoseClientExample.cpp:50
ObjectPoseClientPlugin.h
armarx::ObjectPoseClientPluginUser
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
Definition: ObjectPoseClientPlugin.h:67
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:18
armarx::ObjectPoseClientExample::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ObjectPoseClientExample.cpp:37
armarx::ObjectPoseClientExample::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: ObjectPoseClientExample.cpp:74
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
armarx::ObjectPoseClientExample::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: ObjectPoseClientExample.cpp:59
armarx::ObjectPoseClientExample::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: ObjectPoseClientExample.cpp:55
DebugObserverComponentPlugin.h
TaskUtil.h
armarx::ObjectPoseClientExample
Brief description of class ObjectPoseClientExample.
Definition: ObjectPoseClientExample.h:50
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::DebugObserverComponentPluginUser
Definition: DebugObserverComponentPlugin.h:82
armarx::ObjectPoseClientExample::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: ObjectPoseClientExample.cpp:70
armarx::viz::Layer
Definition: Layer.h:12
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28