iCub-main
Loading...
Searching...
No Matches
icub-main
src
libraries
icubmod
embObjLib
ethMonitorPresence.h
Go to the documentation of this file.
1
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3
/*
4
* Copyright (C) 2017 iCub Facility - Istituto Italiano di Tecnologia
5
* Author: Marco Accame
6
* email: marco.accame@iit.it
7
* website: www.robotcub.org
8
* Permission is granted to copy, distribute, and/or modify this program
9
* under the terms of the GNU General Public License, version 2 or any
10
* later version published by the Free Software Foundation.
11
*
12
* A copy of the license can be found at
13
* http://www.robotcub.org/icub/license/gpl.txt
14
*
15
* This program is distributed in the hope that it will be useful, but
16
* WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18
* Public License for more details
19
*/
20
21
// - include guard ----------------------------------------------------------------------------------------------------
22
23
#ifndef _ETHMONITORPRESENCE_H_
24
#define _ETHMONITORPRESENCE_H_
25
26
27
#include <string>
28
29
30
namespace
eth
{
31
32
class
EthMonitorPresence
33
{
34
public
:
35
36
struct
Config
37
{
38
bool
enabled
;
39
double
timeout
;
// in seconds
40
double
periodmissingreport
;
// in seconds
41
std::string
name
;
42
Config
() :
enabled
(true),
timeout
(0.020),
periodmissingreport
(30.0),
name
(
"generic"
) {}
43
Config
(
bool
en,
double
t,
double
p
,
const
std::string& na) :
enabled
(en),
timeout
(t),
periodmissingreport
(
p
),
name
(na) {}
44
};
45
46
EthMonitorPresence
();
47
~EthMonitorPresence
();
48
49
void
config
(
const
Config &cfg);
50
void
enable
(
bool
en);
51
bool
isenabled
();
52
53
void
tick
();
54
bool
check
();
// returns true if ok, false if missing
55
56
private
:
57
58
Config configuration;
59
60
double
lastTickTime;
61
double
lastMissingReportTime;
62
double
lastHeardTime;
63
bool
reportedMissing;
64
};
65
66
67
}
// namespace eth
68
69
70
#endif
// include-guard
71
72
73
// - end-of-file (leave a blank line after)----------------------------------------------------------------------------
74
75
76
77
78
79
80
eth::EthMonitorPresence
Definition
ethMonitorPresence.h:33
eth::EthMonitorPresence::config
void config(const Config &cfg)
Definition
ethMonitorPresence.cpp:70
eth::EthMonitorPresence::~EthMonitorPresence
~EthMonitorPresence()
Definition
ethMonitorPresence.cpp:64
eth::EthMonitorPresence::tick
void tick()
Definition
ethMonitorPresence.cpp:97
eth::EthMonitorPresence::check
bool check()
Definition
ethMonitorPresence.cpp:103
eth::EthMonitorPresence::isenabled
bool isenabled()
Definition
ethMonitorPresence.cpp:91
eth::EthMonitorPresence::enable
void enable(bool en)
Definition
ethMonitorPresence.cpp:85
eth::EthMonitorPresence::EthMonitorPresence
EthMonitorPresence()
Definition
ethMonitorPresence.cpp:55
eth
Definition
abstractEthResource.h:38
p
p
Definition
show_eyes_axes.m:23
eth::EthMonitorPresence::Config
Definition
ethMonitorPresence.h:37
eth::EthMonitorPresence::Config::name
std::string name
Definition
ethMonitorPresence.h:41
eth::EthMonitorPresence::Config::periodmissingreport
double periodmissingreport
Definition
ethMonitorPresence.h:40
eth::EthMonitorPresence::Config::timeout
double timeout
Definition
ethMonitorPresence.h:39
eth::EthMonitorPresence::Config::enabled
bool enabled
Definition
ethMonitorPresence.h:38
eth::EthMonitorPresence::Config::Config
Config(bool en, double t, double p, const std::string &na)
Definition
ethMonitorPresence.h:43
eth::EthMonitorPresence::Config::Config
Config()
Definition
ethMonitorPresence.h:42
Generated on Wed Dec 18 2024 16:34:46 for iCub-main by
1.9.8