made cameras virtual and simplified pose factor (with Frank)
							parent
							
								
									dcce21639f
								
							
						
					
					
						commit
						2d9fddbcaa
					
				|  | @ -142,7 +142,7 @@ public: | |||
|   } | ||||
| 
 | ||||
|   /**
 | ||||
|    * Add a bunch of measurements and uses the same noise model for all of them | ||||
|    * Add a bunch of measurements and use the same noise model for all of them | ||||
|    */ | ||||
|   void add(std::vector<Z>& measurements, std::vector<Key>& cameraKeys, | ||||
|       const SharedNoiseModel& noise) { | ||||
|  | @ -177,7 +177,7 @@ public: | |||
|   } | ||||
| 
 | ||||
|   /// Collect all cameras: important that in key order
 | ||||
|   Cameras cameras(const Values& values) const { | ||||
|   virtual Cameras cameras(const Values& values) const { | ||||
|     Cameras cameras; | ||||
|     BOOST_FOREACH(const Key& k, this->keys_) | ||||
|       cameras.push_back(values.at<CAMERA>(k)); | ||||
|  | @ -214,7 +214,7 @@ public: | |||
|     return e && Base::equals(p, tol) && areMeasurementsEqual; | ||||
|   } | ||||
| 
 | ||||
|   ///Compute reprojection errors [h(x)-z] = [cameras.project(p)-z] and derivatives
 | ||||
|   /// Compute reprojection errors [h(x)-z] = [cameras.project(p)-z] and derivatives
 | ||||
|   template<class POINT> | ||||
|   Vector unwhitenedError(const Cameras& cameras, const POINT& point, | ||||
|       boost::optional<typename Cameras::FBlocks&> Fs = boost::none, //
 | ||||
|  |  | |||
|  | @ -103,24 +103,6 @@ public: | |||
|     return e && Base::equals(p, tol); | ||||
|   } | ||||
| 
 | ||||
|   /**
 | ||||
|    * Linearize to Gaussian Factor | ||||
|    * @param values Values structure which must contain camera poses for this factor | ||||
|    * @return a Gaussian factor | ||||
|    */ | ||||
|   boost::shared_ptr<GaussianFactor> linearizeDamped(const Values& values, | ||||
|       const double lambda = 0.0) const { | ||||
|     // depending on flag set on construction we may linearize to different linear factors
 | ||||
|     typename Base::Cameras cameras = this->cameras(values); | ||||
|     return Base::linearizeDamped(cameras, lambda); | ||||
|   } | ||||
| 
 | ||||
|   /// linearize
 | ||||
|   virtual boost::shared_ptr<GaussianFactor> linearize( | ||||
|       const Values& values) const { | ||||
|     return linearizeDamped(values); | ||||
|   } | ||||
| 
 | ||||
|   /**
 | ||||
|    * error calculates the error of the factor. | ||||
|    */ | ||||
|  | @ -156,15 +138,6 @@ public: | |||
|     return cameras; | ||||
|   } | ||||
| 
 | ||||
|   /**
 | ||||
|    * Triangulate and compute derivative of error with respect to point | ||||
|    * @return whether triangulation worked | ||||
|    */ | ||||
|   bool triangulateAndComputeE(Matrix& E, const Values& values) const { | ||||
|     typename Base::Cameras cameras = this->cameras(values); | ||||
|     return Base::triangulateAndComputeE(E, cameras); | ||||
|   } | ||||
| 
 | ||||
| private: | ||||
| 
 | ||||
|   /// Serialization function
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue