OpenPoseSimulation.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 VisionX::ArmarXObjects::OpenPoseEstimation
17 * @author Stefan Reither ( stef dot reither at web dot de )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22#pragma once
23
24#include <SimoxUtility/threads/CountingSemaphore.h>
25#include <VirtualRobot/Robot.h>
26
29
32
33#include <VisionX/interface/components/OpenPoseEstimationInterface.h>
34
35namespace armarx
36{
37
38 /**
39 * @class OpenPoseEstimationPropertyDefinitions
40 * @brief
41 */
47
48 /**
49 * @defgroup Component-OpenPoseEstimation OpenPoseEstimation
50 * @ingroup VisionX-Components
51 * A description of the component OpenPoseEstimation.
52 *
53 * @class OpenPoseEstimation
54 * @ingroup Component-OpenPoseEstimation
55 * @brief Brief description of class OpenPoseEstimation.
56 *
57 * Detailed description of class OpenPoseEstimation.
58 */
60 public armarx::Component,
61 public OpenPoseEstimationInterface,
63 {
64 public:
65 /**
66 * @see armarx::ManagedIceObject::getDefaultName()
67 */
68 std::string
69 getDefaultName() const override
70 {
71 return "OpenPoseSimulation";
72 }
73
74 void start(const Ice::Current& = Ice::emptyCurrent) override;
75 void stop(const Ice::Current& = Ice::emptyCurrent) override;
76 void start3DPoseEstimation(const Ice::Current& = Ice::emptyCurrent) override;
77 void stop3DPoseEstimation(const Ice::Current& = Ice::emptyCurrent) override;
78
79 /**
80 * @see PropertyUser::createPropertyDefinitions()
81 */
83
84 protected:
85 /**
86 * @see armarx::ManagedIceObject::onInitComponent()
87 */
88 void onInitComponent() override;
89
90 /**
91 * @see armarx::ManagedIceObject::onConnectComponent()
92 */
93 void onConnectComponent() override;
94
95 /**
96 * @see armarx::ManagedIceObject::onDisconnectComponent()
97 */
98 void onDisconnectComponent() override;
99
100 /**
101 * @see armarx::ManagedIceObject::onExitComponent()
102 */
103 void onExitComponent() override;
104
105
106 //
107 void reportImageAvailable(const ::std::string&,
108 const ::Ice::Current& = ::Ice::emptyCurrent) override{};
109
110 protected:
111 //Texting interface
112 void onMessage(const Texting::TextMessage& text,
113 const Ice::Current& = Ice::emptyCurrent) override;
114
115 private:
117 std::atomic<bool> running2D;
118 std::atomic<bool> running3D;
119 void run();
120
121 // Topics
122 OpenPose2DListenerPrx listener2DPrx;
123 OpenPose3DListenerPrx listener3DPrx;
124
125 // Robot
126 RobotStateComponentInterfacePrx robotStateInterface;
127 VirtualRobot::RobotPtr localRobot;
128
129 std::string layerName = "OpenPoseSimulation";
130 };
131} // namespace armarx
Provides a ready-to-use ArViz client arviz as member variable.
Default component property definition container.
Definition Component.h:70
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
void start3DPoseEstimation(const Ice::Current &=Ice::emptyCurrent) override
void stop(const Ice::Current &=Ice::emptyCurrent) override
void reportImageAvailable(const ::std::string &, const ::Ice::Current &=::Ice::emptyCurrent) override
void start(const Ice::Current &=Ice::emptyCurrent) override
void stop3DPoseEstimation(const Ice::Current &=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onMessage(const Texting::TextMessage &text, const Ice::Current &=Ice::emptyCurrent) override
std::string getDefaultName() const override
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx