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
34namespace 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:
81
82 struct Properties
83 {
84 int predictionsPerObject = 5; // NOLINT
85 int millisecondPredictionIncrement = 200; // NOLINT
86 };
87
88 Properties p;
89 };
90} // namespace armarx
Provides a ready-to-use ArViz client arviz as member variable.
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
Brief description of class ObjectPoseClientExample.
void onInitComponent() override
Pure virtual hook for the subclass.
void onDisconnectComponent() override
Hook for subclass.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onConnectComponent() override
Pure virtual hook for the subclass.
void onExitComponent() override
Hook for subclass.
std::string getDefaultName() const override
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
std::vector< ObjectPose > ObjectPoseSeq
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.