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 namespace armarx
35 {
36 
37  /**
38  * @defgroup Component-ObjectPoseClientExample ObjectPoseClientExample
39  * @ingroup RobotAPI-Components
40  *
41  * An example showing how to get object poses from the ObjectPoseStorage.
42  *
43  * @class ObjectPoseClientExample
44  * @ingroup Component-ObjectPoseClientExample
45  * @brief Brief description of class ObjectPoseClientExample.
46  *
47  * Gets and visualizes object poses from the ObjectPoseStorage.
48  */
50  virtual public armarx::Component,
53  // Derive from the client plugin.
54  ,
56 
57  {
58  public:
59  /// @see armarx::ManagedIceObject::getDefaultName()
60  std::string getDefaultName() const override;
61 
62 
63  protected:
65 
66  void onInitComponent() override;
67  void onConnectComponent() override;
68  void onDisconnectComponent() override;
69  void onExitComponent() override;
70 
71 
72  private:
73  void objectProcessingTaskRun();
74 
75  viz::Layer visualizePredictions(const objpose::ObjectPoseClient& client,
76  const objpose::ObjectPoseSeq& objectPoses);
77 
78 
79  private:
80  armarx::SimpleRunningTask<>::pointer_type objectProcessingTask;
81 
82  struct Properties
83  {
84  int predictionsPerObject = 5; // NOLINT
85  int millisecondPredictionIncrement = 200; // NOLINT
86  };
87 
88  Properties p;
89  };
90 } // namespace armarx
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:54
ObjectPoseClientPlugin.h
armarx::ObjectPoseClientPluginUser
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
Definition: ObjectPoseClientPlugin.h:64
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:17
armarx::ObjectPoseClientExample::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ObjectPoseClientExample.cpp:37
armarx::ObjectPoseClientExample::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: ObjectPoseClientExample.cpp:80
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:35
armarx::ObjectPoseClientExample::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: ObjectPoseClientExample.cpp:65
armarx::ObjectPoseClientExample::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: ObjectPoseClientExample.cpp:60
DebugObserverComponentPlugin.h
TaskUtil.h
armarx::ObjectPoseClientExample
Brief description of class ObjectPoseClientExample.
Definition: ObjectPoseClientExample.h:49
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:91
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::DebugObserverComponentPluginUser
Definition: DebugObserverComponentPlugin.h:73
armarx::ObjectPoseClientExample::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: ObjectPoseClientExample.cpp:75
armarx::viz::Layer
Definition: Layer.h:12
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27