00001 00059 /* 00060 * context.h 00061 * 00062 * Created on: 26.05.2012 00063 * Author: josh 00064 */ 00065 00066 #ifndef CONTEXT_H_ 00067 #define CONTEXT_H_ 00068 00069 #include "path.h" 00070 #include "hypothesis.h" 00071 00072 namespace Slam 00073 { 00074 00078 template<typename KEY, typename NODE> 00079 class Context 00080 { 00081 typedef typename NODE::DOF6 DOF6; 00082 typedef typename NODE::OBJCTXT OBJCTXT; 00083 typedef typename OBJCTXT::OBJECT OBJECT; 00084 typedef typename Slam::Path<NODE> PATH; 00085 typedef typename Slam::Hypothesis<NODE> HYPO; 00086 00087 typedef std::map<typename KEY::TYPE,std::list<typename NODE::Ptr> > MAP; 00088 MAP map_; 00089 00090 PATH path_; 00091 00092 std::vector<HYPO> hypothesis_; 00093 00094 00095 public: 00096 00097 Context(const typename DOF6::TYPE &thr_tr, const typename DOF6::TYPE &thr_rot) 00098 : path_(thr_tr,thr_rot) 00099 { 00100 00101 } 00102 00103 /* 00104 * 1. start frame (reseting local node) 00105 * 2. add all atom-nodes 00106 * 3. finish it, which will add tf-path between last node and local node 00107 */ 00108 void startFrame(const double time_in_sec); 00109 void operator+=(typename OBJECT::Ptr obj); 00110 void finishFrame(); 00111 00112 void operator+=(OBJECT obj) 00113 { 00114 *this += obj.makeShared(); 00115 } 00116 00117 const PATH &getPath() const {return path_;} 00118 PATH &getPath() {return path_;} 00119 }; 00120 00121 #include "impl/context.hpp" 00122 00123 } 00124 00125 00126 #endif /* CONTEXT_H_ */