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

 

         

scanutil.h

00001 #ifndef SCANUTIL_H
00002 #define SCANUTIL_H
00003 
00004 #include <string>
00005 
00006 namespace hydroscanutil {
00007 
00008 struct ScannerConfig {
00009     ScannerConfig() {}
00010     ScannerConfig( double scannerMaxRange,
00011                    double scannerStartAngle,
00012                    double scannerAngleIncrement,
00013                    int    scannerNumReturns )
00014         : maxRange(scannerMaxRange),
00015           startAngle(scannerStartAngle),
00016           angleIncrement(scannerAngleIncrement),
00017           numReturns(scannerNumReturns)
00018         {}
00019     double maxRange;
00020     double startAngle;
00021     double angleIncrement;
00022     int    numReturns;
00023 
00024     bool isSane() const;
00025 };
00026 std::string toString( const ScannerConfig &c );
00027 inline std::ostream &operator<<( std::ostream &s, const ScannerConfig &c )
00028 { return s << toString(c); }
00029 
00030 inline double calcAngleIncrement( double fieldOfView,
00031                                   int    numReturns )
00032 { return fieldOfView / double(numReturns-1); }
00033 
00034 inline double scanBearing( double startAngle,
00035                            double angleIncrement,
00036                            int i )
00037 { return (startAngle + angleIncrement*i); }
00038 
00039 inline double scanBearing( const ScannerConfig &cfg,
00040                            int i )
00041 { return scanBearing( cfg.startAngle, cfg.angleIncrement, i ); }
00042 
00043 inline bool isValidRange( double range,
00044                           const ScannerConfig &cfg )
00045 {
00046     const double EPS = 1e-9;
00047     return ( range > 0.0 && range < cfg.maxRange-EPS );
00048 }
00049 
00050 }
00051 
00052 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5