21 #include <gtsam/nonlinear/ExpressionFactor.h> 26 template <
typename A1,
typename A2>
34 template <
typename A1,
typename A2 = A1,
typename T =
double>
45 : Base(key1, key2, model,
measured) {
50 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
51 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
52 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
63 void print(
const std::string& s =
"",
65 std::cout << s <<
"RangeFactor" << std::endl;
70 friend class boost::serialization::access;
71 template <
class ARCHIVE>
72 void serialize(ARCHIVE& ar,
const unsigned int ) {
73 ar& boost::serialization::make_nvp(
74 "Base", boost::serialization::base_object<Base>(*
this));
79 template <
typename A1,
typename A2,
typename T>
81 :
public Testable<RangeFactor<A1, A2, T> > {};
87 template <
typename A1,
typename A2 = A1,
102 const A1& body_T_sensor)
103 :
Base(key1, key2, model,
measured), body_T_sensor_(body_T_sensor) {
110 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
111 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
112 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
126 void print(
const std::string& s =
"",
127 const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const {
128 std::cout << s <<
"RangeFactorWithTransform" << std::endl;
129 this->body_T_sensor_.print(
" sensor pose in body frame: ");
136 template <
typename ARCHIVE>
137 void serialize(ARCHIVE& ar,
const unsigned int ) {
138 ar& boost::serialization::make_nvp(
139 "Base", boost::serialization::base_object<Base>(*
this));
140 ar& BOOST_SERIALIZATION_NVP(body_T_sensor_);
145 template <
typename A1,
typename A2,
typename T>
147 :
public Testable<RangeFactorWithTransform<A1, A2, T> > {};
This is the base class for all factor types.
Definition: Factor.h:54
const T & measured() const
return the measurement
Definition: ExpressionFactor.h:67
Definition: RangeFactor.h:35
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
Definition: RangeFactor.h:89
Binary specialization of ExpressionFactor meant as a base class for binary factors.
Definition: ExpressionFactor.h:226
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 initialize(const Expression< T > &expression)
Initialize with constructor arguments.
Definition: ExpressionFactor.h:157
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print contents
Definition: RangeFactor.h:126
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
friend class boost::serialization::access
Serialization function.
Definition: RangeFactor.h:135
Definition: BearingRange.h:39
Expression class that supports automatic differentiation.
Definition: Expression.h:49
virtual Expression< T > expression(Key key1, Key key2) const
Recreate expression from given keys_ and measured_, used in load Needed to deserialize a derived fact...
Definition: RangeFactor.h:56
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print relies on Testable traits being defined for T
Definition: ExpressionFactor.h:70
RangeFactor()
default constructor
Definition: RangeFactor.h:42
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
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: RangeFactor.h:50
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: RangeFactor.h:110
virtual Expression< T > expression(Key key1, Key key2) const
Recreate expression from given keys_ and measured_, used in load Needed to deserialize a derived fact...
Definition: RangeFactor.h:116
void print(const std::string &s="", const KeyFormatter &kf=DefaultKeyFormatter) const
print
Definition: RangeFactor.h:63