48 std::vector<boost::shared_ptr<Cal3_S2Stereo> >
K_all_;
52 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
70 const boost::optional<Pose3> body_P_sensor = boost::none) :
71 Base(sharedNoiseModel, params, body_P_sensor) {
84 const boost::shared_ptr<Cal3_S2Stereo> K) {
95 void add(std::vector<StereoPoint2> measurements,
KeyVector poseKeys,
96 std::vector<boost::shared_ptr<Cal3_S2Stereo> > Ks) {
97 Base::add(measurements, poseKeys);
98 for (
size_t i = 0; i < measurements.size(); i++) {
99 K_all_.push_back(Ks.at(i));
110 const boost::shared_ptr<Cal3_S2Stereo> K) {
111 for (
size_t i = 0; i < measurements.size(); i++) {
112 Base::add(measurements.at(i), poseKeys.at(i));
123 DefaultKeyFormatter)
const {
124 std::cout << s <<
"SmartStereoProjectionPoseFactor, z = \n ";
125 for(
const boost::shared_ptr<Cal3_S2Stereo>& K:
K_all_)
126 K->print(
"calibration = ");
133 dynamic_cast<const SmartStereoProjectionPoseFactor*>(&p);
142 if (this->
active(values)) {
150 inline const std::vector<boost::shared_ptr<Cal3_S2Stereo> >
calibration()
const {
166 if (Base::body_P_sensor_)
167 pose = pose.compose(*(Base::body_P_sensor_));
179 template<
class ARCHIVE>
180 void serialize(ARCHIVE & ar,
const unsigned int ) {
181 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
182 ar & BOOST_SERIALIZATION_NVP(
K_all_);
190 SmartStereoProjectionPoseFactor> {
SmartStereoProjectionFactor: triangulates point and keeps an estimate of it around.
Definition: SmartStereoProjectionFactor.h:52
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print
Definition: SmartStereoProjectionPoseFactor.h:122
double totalReprojectionError(const Cameras &cameras, boost::optional< Point3 > externalPoint=boost::none) const
Calculate the error of the factor.
Definition: SmartStereoProjectionFactor.h:416
This is the base class for all factor types.
Definition: Factor.h:54
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:70
SmartStereoProjectionPoseFactor This
shorthand for this class
Definition: SmartStereoProjectionPoseFactor.h:58
ValueType at(Key j) const
Retrieve a variable by key j.
Definition: Values-inl.h:342
const ZVector & measured() const
return the measurements
Definition: SmartFactorBase.h:159
void add(const StereoPoint2 measured, const Key poseKey, const boost::shared_ptr< Cal3_S2Stereo > K)
add a new measurement and pose key
Definition: SmartStereoProjectionPoseFactor.h:83
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
virtual double error(const Values &values) const
error calculates the error of the factor.
Definition: SmartStereoProjectionPoseFactor.h:141
Definition: SmartStereoProjectionPoseFactor.h:44
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
void add(std::vector< StereoPoint2 > measurements, KeyVector poseKeys, const boost::shared_ptr< Cal3_S2Stereo > K)
Variant of the previous one in which we include a set of measurements with the same noise and calibra...
Definition: SmartStereoProjectionPoseFactor.h:109
Definition: StereoPoint2.h:32
friend class boost::serialization::access
Serialization function.
Definition: SmartStereoProjectionPoseFactor.h:178
Definition: StereoCamera.h:47
Nonlinear factor base class.
Definition: NonlinearFactor.h:50
void add(std::vector< StereoPoint2 > measurements, KeyVector poseKeys, std::vector< boost::shared_ptr< Cal3_S2Stereo > > Ks)
Variant of the previous one in which we include a set of measurements.
Definition: SmartStereoProjectionPoseFactor.h:95
Smart stereo factor on StereoCameras (pose + calibration)
SmartStereoProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams ¶ms=SmartStereoProjectionParams(), const boost::optional< Pose3 > body_P_sensor=boost::none)
Constructor.
Definition: SmartStereoProjectionPoseFactor.h:68
Definition: SmartFactorParams.h:42
void print(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print
Definition: Factor.cpp:29
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:56
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Base::Cameras cameras(const Values &values) const
Collect all cameras involved in this factor.
Definition: SmartStereoProjectionPoseFactor.h:160
virtual bool active(const Values &) const
Checks whether a factor should be used based on a set of values.
Definition: NonlinearFactor.h:113
const std::vector< boost::shared_ptr< Cal3_S2Stereo > > calibration() const
return the calibration object
Definition: SmartStereoProjectionPoseFactor.h:150
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Definition: SmartStereoProjectionPoseFactor.h:61
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:1072
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:72
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef SmartStereoProjectionFactor Base
shorthand for base class type
Definition: SmartStereoProjectionPoseFactor.h:55
virtual bool equals(const NonlinearFactor &p, double tol=1e-9) const
equals
Definition: SmartStereoProjectionPoseFactor.h:131
virtual ~SmartStereoProjectionPoseFactor()
Virtual destructor.
Definition: SmartStereoProjectionPoseFactor.h:75
std::vector< boost::shared_ptr< Cal3_S2Stereo > > K_all_
shared pointer to calibration object (one for each camera)
Definition: SmartStereoProjectionPoseFactor.h:48
bool equals(const This &other, double tol=1e-9) const
check equality
Definition: Factor.cpp:42