Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Tools/PotentialFields/FutureWorldModelGenerator.h

Go to the documentation of this file.

    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 PotentialFieldsObject;
    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<PotentialFieldsObject*>& worldStateNow,
    00060                            std::vector<PotentialFieldsObject*>& worldStateThen,
    00061                            std::vector<PotentialFieldsObject*>& 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<PotentialFieldsObject*>& dynamicWorldState,
    00076                                    std::vector<PotentialFieldsObject*>& 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<PotentialFieldsObject*>& otherObjects,
    00089                                     std::vector<PotentialFieldsObject*>& 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<PotentialFieldsObject*>& otherObjects,
    00105                                  std::vector<PotentialFieldsObject*>& otherStaticObjects,
    00106                                  int excludedObject = -1);
    00107 };
    00108
    00109
    00110 #endif //FUTUREWORLDMODELGENERATOR_H_