Go to the documentation of this file.00001
00012 #ifndef WORLDABSTRACT_HPP_
00013 #define WORLDABSTRACT_HPP_
00014
00015 #include <boost/thread/mutex.hpp>
00016 #include <boost/thread/condition_variable.hpp>
00017
00018 #include "kernel/threads.hpp"
00019 #include "jmath/jblas.hpp"
00020 #include "rtslam/rtSlam.hpp"
00021 #include "rtslam/objectAbstract.hpp"
00022
00023 #include "rtslam/parents.hpp"
00024
00025 namespace jafar {
00030 namespace rtslam {
00031
00032
00033 class MapAbstract;
00034 namespace display { class ViewerAbstract; }
00035
00036 enum ErrorType { eNoError=0, eParam, eConfig, eDependency, eNotSupported, eNoSensorData, eLargeUncertainty, eCrashed };
00037
00043 class WorldAbstract: public ObjectAbstract, public ParentOf<MapAbstract> {
00044
00045 ENABLE_ACCESS_TO_CHILDREN(MapAbstract,Map,map);
00046 std::vector<display::ViewerAbstract*> display_viewers;
00047
00048 public:
00049
00053 WorldAbstract(): t(0), display_rendered(true), display_t(-1), slam_blocked(false), exit(false), error(eNoError) {}
00054
00058 virtual ~WorldAbstract() {
00059 }
00060
00061
00062 unsigned t;
00063
00064
00065 bool display_rendered;
00066 unsigned display_t;
00067 boost::mutex display_mutex;
00068 boost::condition_variable display_condition;
00069
00070 kernel::VariableMutex<bool> slam_blocked;
00071 kernel::VariableMutex<bool> exit;
00072 ErrorType error;
00073
00074 void addDisplayViewer(display::ViewerAbstract *viewer, unsigned id);
00075 display::ViewerAbstract* getDisplayViewer(unsigned id);
00076 };
00077
00078 }
00079 }
00080
00081 #endif
00082