orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
heartbeater.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCAICE_HEARTBEATER_H 00012 #define ORCAICE_HEARTBEATER_H 00013 00014 #include <orcaice/context.h> 00015 #include <gbxsickacfr/gbxiceutilacfr/timer.h> 00016 #include <string> 00017 00018 namespace orcaice { 00019 00025 class Heartbeater 00026 { 00027 00028 public: 00029 // we only need Tracer here, not the whole context 00030 Heartbeater( const orcaice::Context & context, double secBetweenHeartbeats = 10.0, double urgencyDivider=4.0 ); 00031 00033 bool isHeartbeatTime(); 00034 00036 bool isHeartbeatTimeUrgent(); 00037 00039 void beat( const std::string &heartbeatMessage ); 00040 00041 private: 00042 00043 // orca::Time lastHeartbeatTime_; 00044 gbxsickacfr::gbxiceutilacfr::Timer timer_; 00045 00046 double secBetweenHeartbeats_; 00047 double urgencyDivider_; 00048 00049 gbxsickacfr::gbxutilacfr::Tracer& tracer_; 00050 }; 00051 00052 } 00053 00054 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)