36 typedef boost::shared_ptr<BoundingConstraint1<VALUE> >
shared_ptr;
44 threshold_(threshold), isGreaterThan_(isGreaterThan) {
57 virtual double value(
const X&
x, boost::optional<Matrix&>
H =
58 boost::none)
const = 0;
64 return (isGreaterThan_) ? x <= threshold_ : x >=
threshold_;
68 boost::none)
const override {
72 if (isGreaterThan_) *
H =
D;
77 return (
Vector(1) << error).finished();
86 template<
class ARCHIVE>
88 ar & boost::serialization::make_nvp(
"NoiseModelFactor1",
89 boost::serialization::base_object<Base>(*
this));
90 ar & BOOST_SERIALIZATION_NVP(threshold_);
91 ar & BOOST_SERIALIZATION_NVP(isGreaterThan_);
99 template<
class VALUE1,
class VALUE2>
105 typedef boost::shared_ptr<BoundingConstraint2<VALUE1, VALUE2> >
shared_ptr;
112 : Base(
noiseModel::Constrained::All(1,
mu), key1, key2),
113 threshold_(threshold), isGreaterThan_(isGreaterThan) {}
124 virtual double value(
const X1&
x1,
const X2&
x2,
125 boost::optional<Matrix&> H1 = boost::none,
126 boost::optional<Matrix&> H2 = boost::none)
const = 0;
132 return (isGreaterThan_) ? x <= threshold_ : x >=
threshold_;
136 boost::optional<Matrix&> H1 = boost::none,
137 boost::optional<Matrix&> H2 = boost::none)
const override {
141 if (isGreaterThan_) *H1 = D1;
142 else *H1 = -1.0 * D1;
145 if (isGreaterThan_) *H2 = D2;
146 else *H2 = -1.0 * D2;
150 return (
Vector(1) << error).finished();
158 friend class boost::serialization::access;
159 template<
class ARCHIVE>
161 ar & boost::serialization::make_nvp(
"NoiseModelFactor2",
162 boost::serialization::base_object<Base>(*
this));
163 ar & BOOST_SERIALIZATION_NVP(threshold_);
164 ar & BOOST_SERIALIZATION_NVP(isGreaterThan_);
double error(const Values &c) const override
boost::shared_ptr< BoundingConstraint1< VALUE > > shared_ptr
~BoundingConstraint2() override
friend class boost::serialization::access
BoundingConstraint1(Key key, double threshold, bool isGreaterThan, double mu=1000.0)
flag for greater/less than
NoiseModelFactor2< VALUE1, VALUE2 > Base
void serialize(ARCHIVE &ar, const unsigned int)
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
~BoundingConstraint1() override
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
bool active(const Values &c) const override
const SharedNoiseModel & noiseModel() const
access to the noise model
bool isGreaterThan() const
NoiseModelFactor1< VALUE > Base
const Symbol key1('v', 1)
boost::shared_ptr< BoundingConstraint2< VALUE1, VALUE2 > > shared_ptr
const ValueType at(Key j) const
Vector evaluateError(const X &x, boost::optional< Matrix & > H=boost::none) const override
Base class and basic functions for Lie types.
BoundingConstraint2(Key key1, Key key2, double threshold, bool isGreaterThan, double mu=1000.0)
flag for greater/less than
Vector evaluateError(const X1 &x1, const X2 &x2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
Non-linear factor base classes.
const Symbol key2('v', 2)
bool isGreaterThan() const
void serialize(ARCHIVE &ar, const unsigned int)
bool active(const Values &c) const override
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
std::uint64_t Key
Integer nonlinear key type.
virtual double value(const X &x, boost::optional< Matrix & > H=boost::none) const =0