Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef TIDYUP_PLANNING_SCENE_UPDATER_H_
00009 #define TIDYUP_PLANNING_SCENE_UPDATER_H_
00010
00011 #include "tfd_modules/module_api/pddlModuleTypes.h"
00012 #include <map>
00013 #include <set>
00014 #include <geometry_msgs/Pose.h>
00015
00016 using namespace modules;
00017
00018 class TidyupPlanningSceneUpdater
00019 {
00020 public:
00021 virtual ~TidyupPlanningSceneUpdater();
00022
00023 static bool readState(
00024 const string& robotLocation,
00025 predicateCallbackType predicateCallback,
00026 numericalFluentCallbackType numericalFluentCallback,
00027 geometry_msgs::Pose& robotPose,
00028 std::map<std::string, geometry_msgs::Pose>& movableObjects,
00029 std::map<std::string, std::string>& graspedObjects,
00030 std::map<std::string, std::string>& objectsOnStatic,
00031 std::set<std::string>& openDoors);
00032
00033 static bool update(const geometry_msgs::Pose& robotPose,
00034 const std::map<std::string, geometry_msgs::Pose>& movableObjects,
00035 const std::map<std::string, std::string>& graspedObjects,
00036 const std::set<std::string>& openDoors);
00037
00038 private:
00039 TidyupPlanningSceneUpdater();
00040 bool readState_(
00041 const string& robotLocation,
00042 predicateCallbackType predicateCallback,
00043 numericalFluentCallbackType numericalFluentCallback,
00044 geometry_msgs::Pose& robotPose,
00045 std::map<std::string, geometry_msgs::Pose>& movableObjects,
00046 std::map<std::string, std::string>& graspedObjects,
00047 std::map<std::string, std::string>& objectsOnStatic,
00048 std::set<std::string>& openDoors);
00049
00050 bool update_(const geometry_msgs::Pose& robotPose,
00051 const std::map<std::string, geometry_msgs::Pose>& movableObjects,
00052 const std::map<std::string, std::string>& graspedObjects,
00053 const std::set<std::string>& openDoors);
00054
00055 bool fillPoseFromState(geometry_msgs::Pose& pose,
00056 const std::string& poseName,
00057 numericalFluentCallbackType numericalFluentCallback);
00058
00059 std::string logName;
00060 geometry_msgs::Pose defaultAttachPose;
00061 struct Door
00062 {
00063 string name;
00064 geometry_msgs::Pose closedPose;
00065 geometry_msgs::Pose openPose;
00066 Door(string name){this->name = name;}
00067 };
00068 map<string, Door> doors;
00069 void loadDoorPoses(const string& doorLocationFileName);
00070 static TidyupPlanningSceneUpdater* instance;
00071 };
00072
00073 #endif