Added default constructor and Serialization
parent
20830a1534
commit
256c094039
|
@ -12,6 +12,15 @@
|
|||
using namespace std;
|
||||
namespace gtsam{
|
||||
|
||||
/* ************************************************************************* */
|
||||
VSLAMFactor::VSLAMFactor() {
|
||||
/// Arbitrary values
|
||||
cameraFrameNumber_ = 111;
|
||||
landmarkNumber_ = 222;
|
||||
cameraFrameName_ = symbol('x',cameraFrameNumber_);
|
||||
landmarkName_ = symbol('l',landmarkNumber_);
|
||||
K_ = Cal3_S2(444,555,666,777,888);
|
||||
}
|
||||
/* ************************************************************************* */
|
||||
VSLAMFactor::VSLAMFactor(const Point2& z, double sigma, int cn, int ln, const Cal3_S2 &K)
|
||||
: NonlinearFactor<VSLAMConfig>(z.vector(), sigma)
|
||||
|
|
|
@ -21,17 +21,22 @@ class VSLAMConfig;
|
|||
*/
|
||||
class VSLAMFactor : public NonlinearFactor<VSLAMConfig>, Testable<VSLAMFactor>
|
||||
{
|
||||
private:
|
||||
private:
|
||||
|
||||
int cameraFrameNumber_, landmarkNumber_;
|
||||
std::string cameraFrameName_, landmarkName_;
|
||||
Cal3_S2 K_; // Calibration stored in each factor. FD: need to think about this.
|
||||
typedef NonlinearFactor<VSLAMConfig> ConvenientFactor;
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
typedef boost::shared_ptr<VSLAMFactor> shared_ptr; // shorthand for a smart pointer to a factor
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
VSLAMFactor();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param z is the 2 dimensional location of point in image (the measurement)
|
||||
|
@ -71,6 +76,18 @@ class VSLAMFactor : public NonlinearFactor<VSLAMConfig>, Testable<VSLAMFactor>
|
|||
|
||||
int getCameraFrameNumber() const { return cameraFrameNumber_; }
|
||||
int getLandmarkNumber() const { return landmarkNumber_; }
|
||||
|
||||
private:
|
||||
/** Serialization function */
|
||||
friend class boost::serialization::access;
|
||||
template<class Archive>
|
||||
void serialize(Archive & ar, const unsigned int version) {
|
||||
ar & BOOST_SERIALIZATION_NVP(cameraFrameNumber_);
|
||||
ar & BOOST_SERIALIZATION_NVP(landmarkNumber_);
|
||||
ar & BOOST_SERIALIZATION_NVP(cameraFrameName_);
|
||||
ar & BOOST_SERIALIZATION_NVP(landmarkName_);
|
||||
ar & BOOST_SERIALIZATION_NVP(K_);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue