00001
00002
00003 #ifndef SLAM_SEGMENT_INV_DEPTH_INOV_FEATURE_HPP
00004 #define SLAM_SEGMENT_INV_DEPTH_INOV_FEATURE_HPP
00005
00006 #include "jmath/jblas.hpp"
00007
00008 #include "camera/cameraBarreto.hpp"
00009
00010 #include "slam/feature.hpp"
00011 #include "slam/featureModel.hpp"
00012 #include "slam/segmentFeature.hpp"
00013
00014 namespace jafar {
00015 namespace slam {
00016
00017 class SegInvDepthFeatureModel;
00018
00024 class ImageSegInvDepthInovFeatureObserveModel : public FeatureObserveModel {
00025 jblas::mat Jobs1Tmp;
00026 jblas::mat Jobs2Tmp;
00027 protected:
00028
00030 double m_id0;
00032 double m_sigmaId0;
00033
00034 jafar::camera::CameraPinhole camera;
00035
00036 SegInvDepthFeatureModel& segInvDepthFeatureModel;
00037
00038 jblas::vec const& predictObservationInSensorFrame(const jblas::vec& feature_);
00039
00040 void predictObservationInSensorFrameJac(const jblas::vec& feature_);
00041
00042
00043
00044
00045
00046 jblas::vec inverseObservationInSensorFrame(Observation const& obs_);
00047
00048 void inverseObservationInSensorFrameJac(Observation const& obs_);
00049
00051 jblas::sym_mat p_pixCov;
00052
00053 public:
00054
00055 ImageSegInvDepthInovFeatureObserveModel(SegInvDepthFeatureModel& featureModel_, jafar::camera::CameraPinhole const& camera_);
00056
00057 ~ImageSegInvDepthInovFeatureObserveModel();
00058
00059 Observation::ObservationType typeObs() const {return Observation::SEGMENTID_IMAGE;}
00060
00061 void setPixCov(jblas::vec const& pixCov_, double stabilizingFactor = 1.0);
00062
00063
00064
00065
00066
00069 void initInternalState(BaseFeature& feature, jafar::geom::T3DEuler const& robotPose_, Observation const& obs_) const;
00070
00073 void updateInternalState(BaseFeature& feature, jafar::geom::T3DEuler const& robotPose_, Observation const& obs_) const;
00074
00075 void postInitCovariance(jblas::sym_mat_range & P, jblas::mat const& Jfeature);
00076 void predictObservationJac(const jblas::vec_range& robotPose_, const jblas::vec_range& feature_);
00077
00088 void predictExtObs(jblas::vec_range const& pose, jblas::sym_mat_range const& poseCov,
00089 jblas::vec3 const& ext, jblas::sym_mat const& extCov,
00090 jblas::vec& zPredExt, jblas::sym_mat& zPredExtCov);
00096 void predictExtObsJac(jblas::vec_range const& pose, jblas::vec3 const Ext, jblas::vec& eInImage, jblas::mat& JeR, jblas::mat& JeExt);
00097
00098
00100 virtual jblas::vec const& computeInnovation(jblas::vec const& z_, jblas::vec const& zPred_);
00101
00105 static jblas::vec2 extToImageModel(jblas::vec const& ext1,jblas::vec const& ext2);
00106
00111 static void extToImageModelJac(jblas::vec const& ext1, jblas::vec const& ext2, jblas::mat& J);
00112
00113
00116 virtual void computeSensorR(Observation const& obs);
00117
00118 void setup(double id0 = 0.5, double sigmaId0 = 0.5);
00119
00120
00121 };
00122
00123 }}
00124
00125 #endif // SLAM_SEG_INV_DEPTH_FEATURE_HPP