orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
ipathplanner2d.h00001 /* 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 #ifndef IPATHPLANNER2D_H 00011 #define IPATHPLANNER2D_H 00012 00013 #include <hydropathplan/util.h> 00014 00015 namespace hydropathplan { 00016 00023 class Exception : public std::exception 00024 { 00025 public: 00026 00027 Exception(const char *message) 00028 : message_(message) 00029 {} 00030 Exception(const std::string &message) 00031 : message_(message) 00032 {} 00033 00034 virtual ~Exception() throw() {} 00035 virtual const char* what() const throw() { return message_.c_str(); } 00036 00037 void prependMsg( const char *msg ) 00038 { message_ = msg + message_; } 00039 00040 void prependMsg( const std::string &msg ) 00041 { message_ = msg + message_; } 00042 00043 protected: 00044 00045 std::string message_; 00046 }; 00047 00048 class PathStartNotValidException : public Exception 00049 { 00050 public: 00051 PathStartNotValidException(const char *message) 00052 : Exception( std::string("PathStartNotValid: ")+message ) 00053 {} 00054 }; 00055 00056 class PathDestinationNotValidException : public Exception 00057 { 00058 public: 00059 PathDestinationNotValidException(const char *message) 00060 : Exception( std::string("PathDestinationNotValid: ")+message ) 00061 {} 00062 }; 00063 00064 class PathDestinationUnreachableException : public Exception 00065 { 00066 public: 00067 PathDestinationUnreachableException(const char *message) 00068 : Exception( std::string("PathDestinationUnreachable: ")+message ) 00069 {} 00070 }; 00071 00072 00073 00074 00080 class IPathPlanner2d 00081 { 00082 00083 public: 00084 00085 virtual ~IPathPlanner2d() {}; 00086 00087 // 00088 // Compute the path from 'start' to 'end'. 00089 // NOTE: Everything is done in cells (not world-coordinates). 00090 // 00091 // The computed path is not necessarily a set of contiguous cells. 00092 // 00093 // Warning: may throw 'hydropathplan::Exception's 00094 // 00095 virtual void computePath( int startX, 00096 int startY, 00097 int endX, 00098 int endY, 00099 Cell2DVector &path ) const = 0; 00100 00101 private: 00102 00103 }; 00104 00105 } 00106 00107 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)