INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

localnav/stats.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2009 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 LOCALNAV_STATS_H
00012 #define LOCALNAV_STATS_H
00013 
00014 #include <hydronavutil/pose.h>
00015 #include <hydronavutil/velocity.h>
00016 
00017 namespace localnav {
00018 
00019 
00020 /*
00021 Not thread safe.
00022 
00023 Unlike the motion stats for a robotic platform e.g. Segway, we 
00024 assume here that the pose is provided by the localiser which does
00025 not have an infinite slow drift overtime. Therefore all reported 
00026 motion is integrated into total distance travelled.
00027 
00028 Attempts to discount large localization corrections.
00029 */
00030 class Stats
00031 {
00032 
00033 public: 
00034     Stats();
00035 
00036     void addData( int seconds, int useconds,
00037                   const hydronavutil::Pose& pose, 
00038                   const hydronavutil::Velocity& vel,
00039                   bool isEnabled );
00040 
00041     // total distance travelled [m]
00042     double distance() const { return distance_; };
00043     // total time while in motion [m/s]
00044     double timeInMotion() const { return timeInMotion_; };
00045     // maximum (forward) speed [m/s]
00046     double maxSpeed() const { return maxSpeed_; };
00047 
00048 private: 
00049 
00050     int lastSeconds_;
00051     int lastUseconds_;
00052     hydronavutil::Pose lastPose_;
00053     bool lastIsEnabled_;
00054     bool haveData_;
00055     
00056     double distance_;
00057     double timeInMotion_;
00058     double maxSpeed_;
00059 };
00060 
00061 } // namespace
00062 
00063 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5