00001
00002
00003 #ifndef SLAM_SLAM_EVENTS_HPP
00004 #define SLAM_SLAM_EVENTS_HPP
00005
00006 namespace jafar {
00007 namespace slam {
00008
00009
00010 class BaseFeature;
00011 class SlamEkf;
00012
00017 class SlamEventListener {
00018
00019 public:
00020 enum Type {
00021 ADD_LANDMARK = 0,
00022 REMOVE_LANDMARK = 1,
00023 LANDMARK = ADD_LANDMARK | REMOVE_LANDMARK,
00024 BEGIN_PROCESS_OBSERVATIONS = 2,
00025 END_PROCESS_OBSERVATIONS = 4,
00026 PROCESS_OBSERVATIONS = BEGIN_PROCESS_OBSERVATIONS | END_PROCESS_OBSERVATIONS,
00027 ALL = LANDMARK | PROCESS_OBSERVATIONS
00028 };
00029 protected:
00030
00031 virtual ~SlamEventListener() {}
00032
00033 virtual void addLandmark(BaseFeature const& landmark) = 0;
00034 virtual void removeLandmark(BaseFeature const& landmark) = 0;
00035
00036 virtual void beginProcessObservations(unsigned int robotId_) = 0;
00037 virtual void endProcessObservations(unsigned int robotId_) = 0;
00038
00039 friend class SlamEkf;
00040
00041 };
00042
00047 class SlamEventAdapter : public SlamEventListener {
00048
00049 protected:
00050
00051 virtual ~SlamEventAdapter() {}
00052
00053 virtual void addLandmark(BaseFeature const& landmark) {};
00054 virtual void removeLandmark(BaseFeature const& landmark) {};
00055
00056 virtual void beginProcessObservations(unsigned int robotId_) {};
00057 virtual void endProcessObservations(unsigned int robotId_) {};
00058
00059 };
00060
00061
00062 class InitFeature;
00063 class BearingOnlySlam;
00064
00069 class BoSlamEventListener : public SlamEventListener {
00070
00071 protected:
00072
00073 virtual ~BoSlamEventListener() {}
00074
00075 virtual void addTentativeLandmark(InitFeature const& landmark) = 0;
00076 virtual void removeTentativeLandmark(InitFeature const& landmark) = 0;
00077
00078 friend class BearingOnlySlam;
00079
00080 };
00081
00086 class BoSlamEventAdapter : public BoSlamEventListener {
00087
00088 protected:
00089
00090 virtual ~BoSlamEventAdapter() {}
00091
00092 virtual void addLandmark(BaseFeature const& landmark) {};
00093 virtual void removeLandmark(BaseFeature const& landmark) {};
00094 virtual void beginProcessObservations(unsigned int robotId_) {};
00095 virtual void endProcessObservations(unsigned int robotId_) {};
00096 virtual void addTentativeLandmark(InitFeature const& landmark) {};
00097 virtual void removeTentativeLandmark(InitFeature const& landmark) {};
00098
00099 };
00100
00101 }
00102 }
00103
00104 #endif // SLAM_SLAM_EVENTS_HPP