24#include <boost/concept/assert.hpp>
32template <
typename A1,
typename A2>
38template <
typename A1,
typename A2>
47template <
typename A1,
typename A2,
58 enum { dimension = dimB + dimR };
64 BearingRange(
const B& b,
const R& r) : bearing_(b), range_(r) {}
71 const B&
bearing()
const {
return bearing_; }
74 const R&
range()
const {
return range_; }
78 const A1& a1,
const A2& a2,
81 typename MakeJacobian<B, A1>::type HB1;
82 typename MakeJacobian<B, A2>::type HB2;
83 typename MakeJacobian<R, A1>::type HR1;
84 typename MakeJacobian<R, A2>::type HR2;
89 if (H1) *H1 << HB1, HR1;
90 if (H2) *H2 << HB2, HR2;
108 void print(
const std::string& str =
"")
const {
113 bool equals(
const BearingRange<A1, A2>& m2,
double tol = 1e-8)
const {
114 return traits<B>::Equals(bearing_, m2.bearing_, tol) &&
115 traits<R>::Equals(range_, m2.range_, tol);
122 inline static size_t Dim() {
return dimension; }
123 inline size_t dim()
const {
return dimension; }
125 typedef Eigen::Matrix<double, dimension, 1> TangentVector;
126 typedef OptionalJacobian<dimension, dimension> ChartJacobian;
150 template <
class ARCHIVE>
151 void serialize(ARCHIVE& ar,
const unsigned int ) {
152 ar& boost::serialization::make_nvp(
"bearing", bearing_);
153 ar& boost::serialization::make_nvp(
"range", range_);
156 friend class boost::serialization::access;
162 NeedsToAlign = (
sizeof(B) % 16) == 0 || (
sizeof(R) % 16) == 0
169template <
typename A1,
typename A2>
178template <
class A1,
typename A2,
class RT>
180 typedef RT result_type;
182 const A1& a1,
const A2& a2,
185 return a1.bearing(a2, H1, H2);
192template <
class A1,
typename A2,
class RT>
194 typedef RT result_type;
196 const A1& a1,
const A2& a2,
199 return a1.range(a2, H1, H2);
#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
This marks a GTSAM object to require alignment.
Definition: types.h:286
Special class for optional Jacobian arguments.
Concept check for values that can be used in unit tests.
Base class and basic functions for Manifold types.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
A helper that implements the traits interface for GTSAM manifolds.
Definition: Manifold.h:95
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
Definition: BearingRange.h:33
Definition: BearingRange.h:39
Bearing-Range product for a particular A1,A2 combination will use the functors above to create a simi...
Definition: BearingRange.h:50
static R MeasureRange(const A1 &a1, const A2 &a2)
Predict range.
Definition: BearingRange.h:100
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.
Definition: BearingRange.h:77
BearingRange retract(const TangentVector &xi) const
Retract delta to manifold.
Definition: BearingRange.h:129
const B & bearing() const
Return bearing measurement.
Definition: BearingRange.h:71
TangentVector localCoordinates(const BearingRange &other) const
Compute the coordinates in the tangent space.
Definition: BearingRange.h:136
const R & range() const
Return range measurement.
Definition: BearingRange.h:74
static B MeasureBearing(const A1 &a1, const A2 &a2)
Predict bearing.
Definition: BearingRange.h:95
Definition: BearingRange.h:179
Definition: BearingRange.h:193