RobotHealthDummy.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::RobotHealthDummy
17  * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
29 
30 #include <RobotAPI/interface/components/RobotHealthInterface.h>
31 
32 namespace armarx
33 {
34  /**
35  * @class RobotHealthDummyPropertyDefinitions
36  * @brief
37  */
39  {
40  public:
43  {
44  defineOptionalProperty<std::string>(
45  "RobotHealthTopicName", "RobotHealthTopic", "Name of the RobotHealth topic");
46  defineOptionalProperty<std::string>(
47  "SleepMode",
48  "nanosleep",
49  "Which sleep function to use: nanosleep, sleepwait, yieldwait, busywait");
50 
51  //defineRequiredProperty<std::string>("PropertyName", "Description");
52  //defineOptionalProperty<std::string>("PropertyName", "DefaultValue", "Description");
53  }
54  };
55 
56  /**
57  * @defgroup Component-RobotHealthDummy RobotHealthDummy
58  * @ingroup RobotAPI-Components
59  * A description of the component RobotHealthDummy.
60  *
61  * @class RobotHealthDummy
62  * @ingroup Component-RobotHealthDummy
63  * @brief Brief description of class RobotHealthDummy.
64  *
65  * Detailed description of class RobotHealthDummy.
66  */
67  class RobotHealthDummy : virtual public armarx::Component
68  {
69  public:
70  /**
71  * @see armarx::ManagedIceObject::getDefaultName()
72  */
73  std::string
74  getDefaultName() const override
75  {
76  return "RobotHealthDummy";
77  }
78 
79  int NanoSleep(long nanosec);
80  void yieldwait(long microseconds);
81  void busywait(long microseconds);
82  void sleepwait(long microseconds);
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  * @see PropertyUser::createPropertyDefinitions()
107  */
109 
110  void runTask();
111 
112  RobotHealthInterfacePrx robotHealthTopicPrx;
114 
115  std::string sleepmode;
116  };
117 } // namespace armarx
armarx::RobotHealthDummy::busywait
void busywait(long microseconds)
Definition: RobotHealthDummy.cpp:83
armarx::RobotHealthDummy::dummyTask
RunningTask< RobotHealthDummy >::pointer_type dummyTask
Definition: RobotHealthDummy.h:113
armarx::RobotHealthDummy::runTask
void runTask()
Definition: RobotHealthDummy.cpp:94
armarx::RobotHealthDummy::onConnectComponent
void onConnectComponent() override
Definition: RobotHealthDummy.cpp:42
armarx::RobotHealthDummy::sleepmode
std::string sleepmode
Definition: RobotHealthDummy.h:115
armarx::RobotHealthDummyPropertyDefinitions::RobotHealthDummyPropertyDefinitions
RobotHealthDummyPropertyDefinitions(std::string prefix)
Definition: RobotHealthDummy.h:41
armarx::RobotHealthDummy::sleepwait
void sleepwait(long microseconds)
Definition: RobotHealthDummy.cpp:61
armarx::RobotHealthDummy::onInitComponent
void onInitComponent() override
Definition: RobotHealthDummy.cpp:35
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
RunningTask.h
armarx::RobotHealthDummy::onDisconnectComponent
void onDisconnectComponent() override
Definition: RobotHealthDummy.cpp:155
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::RobotHealthDummy
Brief description of class RobotHealthDummy.
Definition: RobotHealthDummy.h:67
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
TimeUtil.h
armarx::RobotHealthDummy::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: RobotHealthDummy.cpp:169
armarx::RobotHealthDummyPropertyDefinitions
Definition: RobotHealthDummy.h:38
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::RobotHealthDummy::onExitComponent
void onExitComponent() override
Definition: RobotHealthDummy.cpp:162
armarx::RobotHealthDummy::NanoSleep
int NanoSleep(long nanosec)
Definition: RobotHealthDummy.cpp:52
armarx::RobotHealthDummy::robotHealthTopicPrx
RobotHealthInterfacePrx robotHealthTopicPrx
Definition: RobotHealthDummy.h:112
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::RobotHealthDummy::getDefaultName
std::string getDefaultName() const override
Definition: RobotHealthDummy.h:74
armarx::RobotHealthDummy::yieldwait
void yieldwait(long microseconds)
Definition: RobotHealthDummy.cpp:72