orca-robotics


INTRODUCTION
Overview
Download and Install
Documentation

REPOSITORY
Interfaces
Drivers
Libraries
Utilities
Software Map

DEVELOPER
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

costcalculator.h

00001 #ifndef COSTCALCULATOR_H
00002 #define COSTCALCULATOR_H
00003 
00004 #include <hydroogmap/ograytracer.h>
00005 #include <hydropathplan/util.h>
00006 
00007 namespace hydropathplan {
00008 
00009 //
00010 // @author Alex Brooks
00011 //
00012 class CostAccumulator {
00013 public:
00014     CostAccumulator( const FloatMap &costMap )
00015         : costMap_(costMap),
00016           costSoFar_(0)
00017         {}
00018 
00019     inline bool traceCell( int x, int y )
00020         {
00021             costSoFar_ += element( costMap_, x, y );
00022 
00023             // keep tracing.
00024             return true;
00025         }
00026 
00027     inline void traceSucceeded( int x, int y ) {}
00028 
00029     double totalCost() const { return costSoFar_; }
00030 
00031 private:
00032     const FloatMap &costMap_;
00033     double costSoFar_;
00034 };
00035 
00036 typedef hydroogmap::OgRayTracer<CostAccumulator> CostCalculator;
00037 
00038 }
00039 
00040 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5