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

 

         

sparseskeletonpathplanner.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 #ifndef SPARSESKELETONPATHPLANNER_H
00011 #define SPARSESKELETONPATHPLANNER_H
00012 
00013 #include <hydropathplan/ipathplanner2d.h>
00014 #include <hydropathplan/util.h>
00015 #include <hydroogmap/hydroogmap.h>
00016 
00017 namespace hydropathplan {
00018 
00019 // fwd decl
00020 namespace sparseskel {
00021     class SparseSkel;
00022     class ContiguousSparseSkel;
00023     class SparseSkelNode;
00024 }
00025 
00037 class SparseSkeletonPathPlanner : public IPathPlanner2d
00038 {
00039 
00040 public: 
00041 
00045     SparseSkeletonPathPlanner( const  hydroogmap::OgMap &ogMap,
00046                                double robotDiameterMetres,
00047                                double traversabilityThreshhold,
00048                                bool   doPathOptimization,
00049                                bool   addExtraNodes,
00050                                double extraNodeResolution,
00051                                bool   jiggleBadWaypoints,
00052                                const  CostEvaluator &costEvaluator=DefaultCostEvaluator() );
00053 
00054     ~SparseSkeletonPathPlanner();
00055 
00062     void computePath( int           startX,
00063                       int           startY,
00064                       int           endX,
00065                       int           endY,
00066                       Cell2DVector &path ) const;
00067 
00068     // Allow access for debugging/displaying
00069     const Cell2DVector &denseSkel() const  { return skel_; }
00070     const sparseskel::SparseSkel   &sparseSkel() const { return *sparseSkel_; }
00071 
00072 private: 
00073 
00074     // May modify the inputs if jiggleBadWaypoints is set.
00075     void checkAndFixInputs( int           &startX,
00076                             int           &startY,
00077                             int           &endX,
00078                             int           &endY,
00079                             bool          jiggleBadWaypoints ) const;
00080 
00081     void findClosestNode( const Cell2D                                    &cell,
00082                           sparseskel::ContiguousSparseSkel               *&cSkel,
00083                           sparseskel::SparseSkelNode                     *&closestNode,
00084                           const std::vector<sparseskel::SparseSkelNode*>  &nodesToExclude ) const;
00085 
00086     void connectCell2SparseSkel( const Cell2D                      &cellOnDenseSkel,
00087                                  sparseskel::ContiguousSparseSkel *&contiguousSparseSkel,
00088                                  sparseskel::SparseSkelNode       *&node ) const;
00089 
00090     void planAlongSparseSkel( const sparseskel::ContiguousSparseSkel         &contiguousSparseSkel,
00091                               const sparseskel::SparseSkelNode               &startNode, 
00092                               const sparseskel::SparseSkelNode               &goalNode,
00093                               std::vector<const sparseskel::SparseSkelNode*> &nodePath ) const;
00094 
00095     //
00096     // Takes: a set of start/goal cells off the sparse skel, and a set of nodes,
00097     //        and makes a single complete path.
00098     //
00099     void convertToCellVector( const std::vector<Cell2D>                      &startCells,
00100                               const std::vector<Cell2D>                      &goalCells,
00101                               std::vector<const sparseskel::SparseSkelNode*> &nodePath,
00102                               Cell2DVector                                   &path ) const;
00103 
00104     void optimisePath( Cell2DVector &path ) const;
00105 
00106     const hydroogmap::OgMap &ogMap_;
00107 
00108     // OgMap with obstacles grown
00109     hydroogmap::OgMap        grownOgMap_;
00110 
00111     // (a pointer:) The map that the sparse planner uses
00112     const hydroogmap::OgMap *planOgMap_;
00113 
00114     Cell2DVector            skel_;
00115     sparseskel::SparseSkel *sparseSkel_;
00116     FloatMap                costMap_;
00117 
00118     const double robotDiameterMetres_;
00119     const double traversabilityThreshhold_;
00120     const bool   doPathOptimization_;
00121 
00122     const bool jiggleBadWaypoints_;
00123 };
00124 
00125 }
00126 
00127 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5