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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

clock.h

00001 /*
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 ORCA_LOCALNAV_CLOCK_H
00012 #define ORCA_LOCALNAV_CLOCK_H
00013 
00014 #include <gbxsickacfr/gbxiceutilacfr/store.h>
00015 #include <orca/orca.h>
00016 
00017 namespace localnav {
00018 
00019 //
00020 // A thread-safe clock.
00021 // This is used instead of the processor's clock because we might be running in simulation.
00022 // So we read time of our incoming data rather than any global reference.
00023 //
00024 // @author Alex Brooks
00025 //
00026 class Clock
00027 {
00028 
00029 public: 
00030 
00031     Clock( const orca::Time &initialTime )
00032         { setTime( initialTime ); }
00033 
00034     void setTime( const orca::Time &time )
00035         {
00036             timeStore_.set( time );
00037         }
00038     orca::Time time() const
00039         {
00040             orca::Time t;
00041             timeStore_.get( t );
00042             return t;
00043         }
00044 
00045 private: 
00046 
00047     mutable gbxsickacfr::gbxiceutilacfr::Store<orca::Time> timeStore_;
00048 
00049 };
00050 
00051 }
00052 
00053 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5