Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
landmarkAnchoredHomogeneousPoint.hpp
Go to the documentation of this file.
00001 
00010 #ifndef LANDMARKANCHOREDHOMOGENEOUSPOINT_HPP_
00011 #define LANDMARKANCHOREDHOMOGENEOUSPOINT_HPP_
00012 
00013 #include "boost/shared_ptr.hpp"
00014 #include "rtslam/landmarkAbstract.hpp"
00015 #include "rtslam/quatTools.hpp"
00016 #include "rtslam/ahpTools.hpp"
00017 #include "rtslam/landmarkEuclideanPoint.hpp"
00018 
00023 namespace jafar {
00024   namespace rtslam {
00025 
00026     class LandmarkAnchoredHomogeneousPoint;
00027     typedef boost::shared_ptr<LandmarkAnchoredHomogeneousPoint> ahp_ptr_t;
00028 
00029 
00030 
00035     class LandmarkAnchoredHomogeneousPoint: public LandmarkAbstract {
00036       public:
00037 
00038 
00042         LandmarkAnchoredHomogeneousPoint(const map_ptr_t & mapPtr);
00043         LandmarkAnchoredHomogeneousPoint(const simulation_t dummy, const map_ptr_t & mapPtr);
00044 
00045         virtual ~LandmarkAnchoredHomogeneousPoint() {
00046 //          std::cout << "Deleted landmark: " << id() << ": " << typeName() << std::endl;
00047         }
00048 
00049         virtual std::string typeName() const {
00050           return "Anchored-homogeneous-point";
00051         }
00052 
00053 
00054         static size_t size(void) {
00055           return 7;
00056         }
00057 
00058 
00059         virtual bool needToDie();
00060 
00061         virtual jblas::ind_array nobs() { return ublasExtra::ia_set(6,7); }
00062 
00063         virtual size_t mySize() {return size();}
00064 
00065         virtual size_t reparamSize() {return LandmarkEuclideanPoint::size();}
00066 
00067         virtual jblas::vec3 center() { return reparametrize_func(state.x()); }
00068 
00069         virtual double uncertainty()
00070         {
00071           // max uncertainty of an AHP will almost always be depth uncertainty
00072           double id = state.x()(6);
00073           double ID = 3. * sqrt(state.P()(6,6));
00074           if (id-ID <= 0) return 1e6;
00075                      else return (1./(id-ID) - 1./id);
00076         }
00077 
00078         virtual vec reparametrize_func(const vec & lmk) const {
00079           return lmkAHP::ahp2euc(lmk);
00080         }
00081 
00088         void reparametrize_func(const vec & ahp, vec & euc, mat & EUC_ahp) const {
00089           lmkAHP::ahp2euc(ahp, euc, EUC_ahp);
00090         }
00091 
00092         static unsigned ncreated;
00093 
00094     }; // class LandmarkAnchoredHomogeneousPoint
00095 
00096 
00097   } // namespace rtslam
00098 } // namespace jafar
00099 
00100 #endif /* LANDMARKANCHOREDHOMOGENEOUSPOINT_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:26 for Jafar by doxygen 1.7.6.1
LAAS-CNRS