24 #include <boost/concept/assert.hpp> 32 template <
typename A1,
typename A2,
33 typename B =
typename Bearing<A1, A2>::result_type,
51 : Base({{
key1, key2}},
model,
T(bearingRange)) {
58 : Base({{
key1, key2}},
model,
T(measuredBearing, measuredRange)) {
77 boost::optional<Matrix&> H1 = boost::none,
78 boost::optional<Matrix&> H2 = boost::none)
const 80 std::vector<Matrix> Hs(2);
91 void print(
const std::string&
s =
"",
93 std::cout <<
s <<
"BearingRangeFactor" << std::endl;
100 template <
class ARCHIVE>
102 ar& boost::serialization::make_nvp(
103 "Base", boost::serialization::base_object<Base>(*
this));
108 template <
typename A1,
typename A2,
typename B,
typename R>
110 :
public Testable<BearingRangeFactor<A1, A2, B, R> > {};
double error(const Values &c) const override
BearingRangeFactor< A1, A2 > This
std::array< Key, NARY_EXPRESSION_SIZE > ArrayNKeys
boost::shared_ptr< This > shared_ptr
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print relies on Testable traits being defined for T
Expression< BearingRange< A1, A2 > > expression() const override
Return an expression that predicts the measurement given Values.
BearingRangeFactor(Key key1, Key key2, const B &measuredBearing, const R &measuredRange, const SharedNoiseModel &model)
Construct from separate bearing and range.
noiseModel::Diagonal::shared_ptr model
Rot2 R(Rot2::fromAngle(0.1))
void initialize(const Expression< BearingRange< A1, A2 > > &expression)
Initialize with constructor arguments.
Vector unwhitenedError(const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const override
friend class boost::serialization::access
static const KeyFormatter DefaultKeyFormatter
gtsam::NonlinearFactor::shared_ptr clone() const override
const Symbol key1('v', 1)
void print(const std::string &s="", const KeyFormatter &kf=DefaultKeyFormatter) const override
print
static BearingRange Measure(const A1 &a1, const A2 &a2, OptionalJacobian< dimension, traits< A1 >::dimension > H1=boost::none, OptionalJacobian< dimension, traits< A2 >::dimension > H2=boost::none)
Prediction function that stacks measurements.
boost::shared_ptr< This > shared_ptr
ExpressionFactorN< T, A1, A2 > Base
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Vector evaluateError(const A1 &a1, const A2 &a2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const
pair< size_t, size_t > Range
GenericValue< T > genericValue(const T &v)
const KeyVector & keys() const
Access the factor's involved variable keys.
const Symbol key2('v', 2)
BearingRangeFactor()
Default constructor.
BearingRangeFactor(Key key1, Key key2, const T &bearingRange, const SharedNoiseModel &model)
Construct from BearingRange instance.
std::uint64_t Key
Integer nonlinear key type.
~BearingRangeFactor() override
noiseModel::Base::shared_ptr SharedNoiseModel
void serialize(ARCHIVE &ar, const unsigned int)
Expression< T > expression(const typename Base::ArrayNKeys &keys) const override