73 Base(cref_list_of<1>(key)), key_(key), measured_(measured), keyA_(keyA), keyB_(keyB),
91 std::cout << s <<
"TransformBtwRobotsUnaryFactor(" 92 << keyFormatter(key_) <<
")\n";
93 std::cout <<
"MR between factor keys: " 94 << keyFormatter(keyA_) <<
"," 95 << keyFormatter(keyB_) <<
"\n";
96 measured_.print(
" measured: ");
97 model_->print(
" noise model: ");
103 const This *
t =
dynamic_cast<const This*
> (&
f);
106 return key_ == t->key_ && measured_.
equals(t->measured_);
116 throw(
"something is wrong!");
145 return boost::shared_ptr<gtsam::JacobianFactor>();
149 std::vector<gtsam::Matrix>
A(this->
size());
160 boost::optional<std::vector<gtsam::Matrix>&>
H = boost::none)
const {
162 T orgA_T_currA = valA_.
at<T>(
keyA_);
163 T orgB_T_currB = valB_.
at<T>(
keyB_);
164 T orgA_T_orgB = x.
at<T>(
key_);
166 T currA_T_currB_pred;
168 Matrix H_compose, H_between1;
169 T orgA_T_currB = orgA_T_orgB.compose(orgB_T_currB, H_compose, boost::none);
170 currA_T_currB_pred = orgA_T_currA.between(orgA_T_currB, boost::none, H_between1);
171 (*H)[0] = H_compose * H_between1;
174 T orgA_T_currB = orgA_T_orgB.compose(orgB_T_currB);
175 currA_T_currB_pred = orgA_T_currA.between(orgA_T_currB);
179 Vector error = currA_T_currB_msr.localCoordinates(currA_T_currB_pred);
182 model_->WhitenSystem(*
H, error);
184 model_->whitenInPlace(error);
193 T orgA_T_currA = valA_.
at<T>(
keyA_);
194 T orgB_T_currB = valB_.
at<T>(
keyB_);
195 T orgA_T_orgB = x.
at<T>(
key_);
197 T orgA_T_currB = orgA_T_orgB.compose(orgB_T_currB);
198 T currA_T_currB_pred = orgA_T_currA.between(orgA_T_currB);
201 return currA_T_currB_msr.localCoordinates(currA_T_currB_pred);
206 size_t dim()
const override {
207 return model_->R().rows() + model_->R().cols();
214 template<
class ARCHIVE>
216 ar & boost::serialization::make_nvp(
"NonlinearFactor",
217 boost::serialization::base_object<Base>(*
this));
223 template<
class VALUE>
225 public Testable<TransformBtwRobotsUnaryFactor<VALUE> > {
bool equals(const This &other, double tol=1e-9) const
check equality
Concept check for values that can be used in unit tests.
noiseModel::Diagonal::shared_ptr model
A factor with a quadratic error function - a Gaussian.
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
#define GTSAM_CONCEPT_TESTABLE_TYPE(T)
static const KeyFormatter DefaultKeyFormatter
virtual bool active(const Values &) const
static shared_ptr Create(size_t dim)
const ValueType at(Key j) const
boost::shared_ptr< This > shared_ptr
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
virtual bool equals(const NonlinearFactor &f, double tol=1e-9) const
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Base class and basic functions for Lie types.
#define GTSAM_CONCEPT_LIE_TYPE(T)
boost::shared_ptr< Factor > shared_ptr
A shared_ptr to this class.
Non-linear factor base classes.
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.
noiseModel::Gaussian::shared_ptr SharedGaussian