00001 /** 00002 * @file FutureWorldModelGenerator.h 00003 * 00004 * Definition of class FutureWorldModelGenerator 00005 * 00006 * @author <a href="mailto:timlaue@informatik.uni-bremen.de">Tim Laue</a> 00007 */ 00008 00009 #ifndef FUTUREWORLDMODELGENERATOR_H_ 00010 #define FUTUREWORLDMODELGENERATOR_H_ 00011 00012 00013 #include <string> 00014 #include <vector> 00015 00016 class Potentialfield; 00017 class Actionfield; 00018 class PotentialfieldTransformation; 00019 class Rotation; 00020 class Action; 00021 class Object; 00022 class PfPose; 00023 class Polygon; 00024 class PfVec; 00025 00026 00027 /** 00028 * @class FutureWorldModelGenerator 00029 * 00030 * A class for computing a world model after excuting a specific action. 00031 */ 00032 class FutureWorldModelGenerator 00033 { 00034 private: 00035 /** Constructor */ 00036 FutureWorldModelGenerator() {}; 00037 00038 public: 00039 /** Returns a pointer to the class (which is a singleton) 00040 * @return The pointer 00041 */ 00042 static FutureWorldModelGenerator* getFutureWorldModelGenerator() 00043 { 00044 static FutureWorldModelGenerator instance; 00045 return &instance; 00046 } 00047 00048 /** Transforms the world state by applying an action 00049 * @param poseNow The original pose 00050 * @param poseThen The pose after the action 00051 * @param action The action 00052 * @param callingField The potential field calling this function 00053 * @param worldStateNow The state of all objects before the action 00054 * @param worldStateThen The state of all objects after the action 00055 * @param worldStateStatic All static objects (never move, cannot be moved) 00056 */ 00057 void transformWorldState(const PfPose& poseNow, PfPose& poseThen, 00058 Action& action, Actionfield* callingField, 00059 std::vector<Object*>& worldStateNow, 00060 std::vector<Object*>& worldStateThen, 00061 std::vector<Object*>& worldStateStatic); 00062 00063 private: 00064 /** Executes a transformation 00065 * @param pose The robot pose (may be changed by this function) 00066 * @param action The action to which the transformation is assigned 00067 * @param transformation The transformation to be executed 00068 * @param callingField The potential field using this class 00069 * @param dynamicWorldState All dynamic objects (may be changed by this function) 00070 * @param staticWorldState All static objects 00071 */ 00072 void executeSingleTransformation(PfPose& pose, Action& action, 00073 PotentialfieldTransformation* transformation, 00074 Actionfield* callingField, 00075 std::vector<Object*>& dynamicWorldState, 00076 std::vector<Object*>& staticWorldState); 00077 00078 /** Checks a planned transformation for collisions 00079 * @param objectPose The pose of the object to be transformed 00080 * @param translation The planned translation 00081 * @param otherObjects All dynamic objects 00082 * @param otherStaticObjects All static objects 00083 * @param excludedObject The index (in otherObjects) of the object to be checked 00084 * @return A value [0.0 .. 1.0] indicated "how much" of the translation may be executed 00085 */ 00086 double getMaxTranslationForObject(const PfPose& objectPose, 00087 const PfVec& translation, 00088 std::vector<Object*>& otherObjects, 00089 std::vector<Object*>& otherStaticObjects, 00090 int excludedObject = -1); 00091 00092 /** Checks a planned rotation for collisions 00093 * @param objectPose The pose of the object to be transformed 00094 * @param rotationPose The position to rotate around also including the current rotation 00095 * @param rotation The planned rotation 00096 * @param otherObjects All dynamic objects 00097 * @param otherStaticObjects All static objects 00098 * @param excludedObject The index (in otherObjects) of the object to be checked 00099 * @return A value [0.0 .. 1.0] indicated "how much" of the translation may be executed 00100 */ 00101 double getMaxRotationForObject(const PfPose& objectPose, 00102 const PfPose& rotationPose, 00103 double rotation, 00104 std::vector<Object*>& otherObjects, 00105 std::vector<Object*>& otherStaticObjects, 00106 int excludedObject = -1); 00107 }; 00108 00109 00110 #endif //FUTUREWORLDMODELGENERATOR_H_ 00111 00112 00113 00114 /* 00115 * $Log: FutureWorldModelGenerator.h,v $ 00116 * Revision 1.1.1.1 2004/05/22 17:37:27 cvsadm 00117 * created new repository GT2004_WM 00118 * 00119 * Revision 1.3 2004/03/05 17:59:34 tim 00120 * corrected doxygen comments 00121 * 00122 * Revision 1.2 2004/01/28 08:27:16 dueffert 00123 * doxygen bugs fixed 00124 * 00125 * Revision 1.1 2004/01/20 15:42:19 tim 00126 * Added potential fields implementation 00127 * 00128 * Revision 1.7 2003/05/22 14:23:47 tim 00129 * Changed representation of transformations 00130 * 00131 * Revision 1.6 2003/05/12 00:03:29 dueffert 00132 * doxygen bugs fixed 00133 * 00134 * Revision 1.5 2003/05/08 15:26:06 tim 00135 * no message 00136 * 00137 * Revision 1.4 2003/04/22 14:35:17 tim 00138 * Merged changes from GO 00139 * 00140 * Revision 1.4 2003/04/09 19:03:06 tim 00141 * Last commit before GermanOpen 00142 * 00143 * Revision 1.3 2003/04/04 14:50:53 tim 00144 * Fixed bugs, added minor features 00145 * 00146 * Revision 1.2 2003/03/23 20:32:37 loetzsch 00147 * removed green compiler warning: no newline at end of file 00148 * 00149 * Revision 1.1 2003/03/23 17:51:27 tim 00150 * Added potentialfields 00151 * 00152 */