20#include <gtsam/base/std_optional_serialization.h>
96 Key receiverPositionKey,
Key receiverClockBiasKey,
97 double measuredPseudorange,
const Point3& satellitePosition,
98 double satelliteClockBias = 0.0,
102 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
103 return std::static_pointer_cast<gtsam::NonlinearFactor>(
104 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
113 double tol = 1e-9)
const override;
116 Vector1 evaluateError(
const Point3& receiverPosition,
117 const double& receiverClockBias,
122#if GTSAM_ENABLE_BOOST_SERIALIZATION
124 friend class boost::serialization::access;
125 template <
class ARCHIVE>
126 void serialize(ARCHIVE& ar,
const unsigned int ) {
127 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
128 ar& BOOST_SERIALIZATION_NVP(measurement_);
129 ar& BOOST_SERIALIZATION_NVP(satPos_);
130 ar& BOOST_SERIALIZATION_NVP(satClkBias_);
164class GTSAM_EXPORT UndifferencedPseudorangeFactor
169 double tropoMap_ = 0.0;
170 double ionoCoeff_ = 1.0;
174 typedef std::shared_ptr<UndifferencedPseudorangeFactor> shared_ptr;
175 typedef UndifferencedPseudorangeFactor This;
177 UndifferencedPseudorangeFactor() =
default;
178 virtual ~UndifferencedPseudorangeFactor() =
default;
192 UndifferencedPseudorangeFactor(
193 Key receiverPositionKey,
Key receiverClockBiasKey,
194 Key tropoZenithWetKey,
Key slantIonoKey,
195 double measuredPseudorange,
const Point3& satellitePosition,
196 double tropoWetMapping,
double ionoCoefficient,
197 double satelliteClockBias = 0.0,
200 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
201 return std::static_pointer_cast<gtsam::NonlinearFactor>(
202 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
208 double tol = 1e-9)
const override;
210 Vector evaluateError(
const Point3& receiverPosition,
211 const double& receiverClockBias,
212 const double& tropoZenithWet,
213 const double& slantIono,
219 inline double tropoMapping()
const {
return tropoMap_; }
220 inline double ionoCoefficient()
const {
return ionoCoeff_; }
223#if GTSAM_ENABLE_BOOST_SERIALIZATION
224 friend class boost::serialization::access;
225 template <
class ARCHIVE>
226 void serialize(ARCHIVE& ar,
const unsigned int ) {
227 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
228 ar& BOOST_SERIALIZATION_NVP(measurement_);
229 ar& BOOST_SERIALIZATION_NVP(satPos_);
230 ar& BOOST_SERIALIZATION_NVP(satClkBias_);
231 ar& BOOST_SERIALIZATION_NVP(tropoMap_);
232 ar& BOOST_SERIALIZATION_NVP(ionoCoeff_);
240 :
public Testable<UndifferencedPseudorangeFactor> {};
252class GTSAM_EXPORT UndifferencedPseudorangeFactorArm
258 double tropoMap_ = 0.0;
259 double ionoCoeff_ = 1.0;
263 typedef std::shared_ptr<UndifferencedPseudorangeFactorArm> shared_ptr;
264 typedef UndifferencedPseudorangeFactorArm This;
266 UndifferencedPseudorangeFactorArm()
268 virtual ~UndifferencedPseudorangeFactorArm() =
default;
271 UndifferencedPseudorangeFactorArm(
272 Key poseKey,
Key receiverClockBiasKey,
Key tropoZenithWetKey,
273 Key slantIonoKey,
double measuredPseudorange,
274 const Point3& satellitePosition,
const Point3& leverArm,
275 double tropoWetMapping,
double ionoCoefficient,
276 double satelliteClockBias = 0.0,
280 UndifferencedPseudorangeFactorArm(
281 Key poseKey,
Key receiverClockBiasKey,
Key tropoZenithWetKey,
282 Key slantIonoKey,
double measuredPseudorange,
283 const Point3& satellitePosition,
const Point3& leverArm,
284 const Pose3& ecef_T_nav,
double tropoWetMapping,
double ionoCoefficient,
285 double satelliteClockBias = 0.0,
288 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
289 return std::static_pointer_cast<gtsam::NonlinearFactor>(
290 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
296 double tol = 1e-9)
const override;
298 Vector evaluateError(
const Pose3& pose,
const double& receiverClockBias,
299 const double& tropoZenithWet,
const double& slantIono,
305 inline const Point3& leverArm()
const {
return arm_.
b; }
306 inline const std::optional<Pose3>& ecefTnav()
const {
return arm_.
ecef_T_nav; }
307 inline double tropoMapping()
const {
return tropoMap_; }
308 inline double ionoCoefficient()
const {
return ionoCoeff_; }
311#if GTSAM_ENABLE_BOOST_SERIALIZATION
312 friend class boost::serialization::access;
313 template <
class ARCHIVE>
314 void serialize(ARCHIVE& ar,
const unsigned int ) {
315 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
316 ar& BOOST_SERIALIZATION_NVP(measurement_);
317 ar& BOOST_SERIALIZATION_NVP(satPos_);
318 ar& BOOST_SERIALIZATION_NVP(satClkBias_);
319 ar& boost::serialization::make_nvp(
"bL_", arm_.
b);
320 ar& boost::serialization::make_nvp(
"ecef_T_nav_", arm_.
ecef_T_nav);
321 ar& BOOST_SERIALIZATION_NVP(tropoMap_);
322 ar& BOOST_SERIALIZATION_NVP(ionoCoeff_);
330 :
public Testable<UndifferencedPseudorangeFactorArm> {};
355class GTSAM_EXPORT DifferentialPseudorangeFactor
363 typedef std::shared_ptr<DifferentialPseudorangeFactor> shared_ptr;
364 typedef DifferentialPseudorangeFactor This;
366 DifferentialPseudorangeFactor() =
default;
367 virtual ~DifferentialPseudorangeFactor() =
default;
369 DifferentialPseudorangeFactor(
370 Key receiverPositionKey,
Key receiverClockBiasKey,
371 Key differentialCorrectionKey,
double measuredPseudorange,
372 const Point3& satellitePosition,
double satelliteClockBias = 0.0,
375 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
376 return std::static_pointer_cast<gtsam::NonlinearFactor>(
377 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
383 double tol = 1e-9)
const override;
384 Vector1 evaluateError(
385 const Point3& receiverPosition,
const double& receiverClock_bias,
391#if GTSAM_ENABLE_BOOST_SERIALIZATION
392 friend class boost::serialization::access;
393 template <
class ARCHIVE>
394 void serialize(ARCHIVE& ar,
const unsigned int ) {
395 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
396 ar& BOOST_SERIALIZATION_NVP(measurement_);
397 ar& BOOST_SERIALIZATION_NVP(satPos_);
398 ar& BOOST_SERIALIZATION_NVP(satClkBias_);
406 :
public Testable<DifferentialPseudorangeFactor> {};
464 Key poseKey,
Key receiverClockBiasKey,
465 double measuredPseudorange,
const Point3& satellitePosition,
466 const Point3& leverArm,
double satelliteClockBias = 0.0,
482 Key poseKey,
Key receiverClockBiasKey,
483 double measuredPseudorange,
const Point3& satellitePosition,
485 double satelliteClockBias = 0.0,
489 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
490 return std::static_pointer_cast<gtsam::NonlinearFactor>(
491 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
500 double tol = 1e-9)
const override;
503 Vector1 evaluateError(
const Pose3& pose,
504 const double& receiverClockBias,
512 inline const std::optional<Pose3>&
ecefTnav()
const {
return arm_.ecef_T_nav; }
515#if GTSAM_ENABLE_BOOST_SERIALIZATION
517 friend class boost::serialization::access;
518 template <
class ARCHIVE>
519 void serialize(ARCHIVE& ar,
const unsigned int ) {
520 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
521 ar& BOOST_SERIALIZATION_NVP(measurement_);
522 ar& BOOST_SERIALIZATION_NVP(satPos_);
523 ar& BOOST_SERIALIZATION_NVP(satClkBias_);
524 ar& boost::serialization::make_nvp(
"bL_", arm_.
b);
525 ar& boost::serialization::make_nvp(
"ecef_T_nav_", arm_.
ecef_T_nav);
533 :
public Testable<PseudorangeFactorArm> {};
551class GTSAM_EXPORT DifferentialPseudorangeFactorArm
560 typedef std::shared_ptr<DifferentialPseudorangeFactorArm> shared_ptr;
561 typedef DifferentialPseudorangeFactorArm This;
563 DifferentialPseudorangeFactorArm()
565 virtual ~DifferentialPseudorangeFactorArm() =
default;
567 DifferentialPseudorangeFactorArm(
568 Key poseKey,
Key receiverClockBiasKey,
Key differentialCorrectionKey,
569 double measuredPseudorange,
const Point3& satellitePosition,
570 const Point3& leverArm,
double satelliteClockBias = 0.0,
573 DifferentialPseudorangeFactorArm(
574 Key poseKey,
Key receiverClockBiasKey,
Key differentialCorrectionKey,
575 double measuredPseudorange,
const Point3& satellitePosition,
577 double satelliteClockBias = 0.0,
580 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
581 return std::static_pointer_cast<gtsam::NonlinearFactor>(
582 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
588 double tol = 1e-9)
const override;
589 Vector1 evaluateError(
const Pose3& pose,
590 const double& receiverClockBias,
591 const double& differentialCorrection,
596 inline const Point3& leverArm()
const {
return arm_.
b; }
597 inline const std::optional<Pose3>& ecefTnav()
const {
return arm_.
ecef_T_nav; }
600#if GTSAM_ENABLE_BOOST_SERIALIZATION
601 friend class boost::serialization::access;
602 template <
class ARCHIVE>
603 void serialize(ARCHIVE& ar,
const unsigned int ) {
604 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
605 ar& BOOST_SERIALIZATION_NVP(measurement_);
606 ar& BOOST_SERIALIZATION_NVP(satPos_);
607 ar& BOOST_SERIALIZATION_NVP(satClkBias_);
608 ar& boost::serialization::make_nvp(
"bL_", arm_.
b);
609 ar& boost::serialization::make_nvp(
"ecef_T_nav_", arm_.
ecef_T_nav);
617 :
public Testable<DifferentialPseudorangeFactorArm> {};
647class GTSAM_EXPORT DoubleDifferencePseudorangeFactor
658 typedef std::shared_ptr<DoubleDifferencePseudorangeFactor> shared_ptr;
659 typedef DoubleDifferencePseudorangeFactor This;
661 DoubleDifferencePseudorangeFactor() =
default;
663 virtual ~DoubleDifferencePseudorangeFactor() =
default;
678 DoubleDifferencePseudorangeFactor(
680 double prRovRef,
double prBaseRef,
681 double prRovTarget,
double prBaseTarget,
687 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
688 return std::static_pointer_cast<gtsam::NonlinearFactor>(
689 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
696 double tol = 1e-9)
const override;
698 Vector evaluateError(
const Point3& pos,
702#if GTSAM_ENABLE_BOOST_SERIALIZATION
703 friend class boost::serialization::access;
704 template <
class ARCHIVE>
705 void serialize(ARCHIVE& ar,
const unsigned int ) {
706 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
707 ar& boost::serialization::make_nvp(
"prRovRef_", dd_.
rovRef);
708 ar& boost::serialization::make_nvp(
"prBaseRef_", dd_.
baseRef);
709 ar& boost::serialization::make_nvp(
"prRovTarget_", dd_.
rovTarget);
710 ar& boost::serialization::make_nvp(
"prBaseTarget_", dd_.
baseTarget);
711 ar& boost::serialization::make_nvp(
"satRefRov_", dd_.
satRefRov);
712 ar& boost::serialization::make_nvp(
"satTargetRov_", dd_.
satTargetRov);
713 ar& boost::serialization::make_nvp(
"satRefBase_", dd_.
satRefBase);
714 ar& boost::serialization::make_nvp(
"satTargetBase_", dd_.
satTargetBase);
715 ar& boost::serialization::make_nvp(
"basePos_", dd_.
basePos);
722 :
public Testable<DoubleDifferencePseudorangeFactor> {};
732class GTSAM_EXPORT DoubleDifferencePseudorangeFactorArm
744 typedef std::shared_ptr<DoubleDifferencePseudorangeFactorArm> shared_ptr;
745 typedef DoubleDifferencePseudorangeFactorArm This;
747 DoubleDifferencePseudorangeFactorArm() =
default;
749 virtual ~DoubleDifferencePseudorangeFactorArm() =
default;
751 DoubleDifferencePseudorangeFactorArm(
753 double prRovRef,
double prBaseRef,
754 double prRovTarget,
double prBaseTarget,
760 DoubleDifferencePseudorangeFactorArm(
762 double prRovRef,
double prBaseRef,
763 double prRovTarget,
double prBaseTarget,
767 const Pose3& ecef_T_nav,
770 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
771 return std::static_pointer_cast<gtsam::NonlinearFactor>(
772 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
779 double tol = 1e-9)
const override;
781 Vector evaluateError(
const Pose3& pose,
784 inline const Point3& leverArm()
const {
return arm_.
b; }
785 inline const std::optional<Pose3>& ecefTnav()
const {
return arm_.
ecef_T_nav; }
788#if GTSAM_ENABLE_BOOST_SERIALIZATION
789 friend class boost::serialization::access;
790 template <
class ARCHIVE>
791 void serialize(ARCHIVE& ar,
const unsigned int ) {
792 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
793 ar& boost::serialization::make_nvp(
"prRovRef_", dd_.
rovRef);
794 ar& boost::serialization::make_nvp(
"prBaseRef_", dd_.
baseRef);
795 ar& boost::serialization::make_nvp(
"prRovTarget_", dd_.
rovTarget);
796 ar& boost::serialization::make_nvp(
"prBaseTarget_", dd_.
baseTarget);
797 ar& boost::serialization::make_nvp(
"satRefRov_", dd_.
satRefRov);
798 ar& boost::serialization::make_nvp(
"satTargetRov_", dd_.
satTargetRov);
799 ar& boost::serialization::make_nvp(
"satRefBase_", dd_.
satRefBase);
800 ar& boost::serialization::make_nvp(
"satTargetBase_", dd_.
satTargetBase);
801 ar& boost::serialization::make_nvp(
"basePos_", dd_.
basePos);
802 ar& boost::serialization::make_nvp(
"bL_", arm_.
b);
803 ar& boost::serialization::make_nvp(
"ecef_T_nav_", arm_.
ecef_T_nav);
810 :
public Testable<DoubleDifferencePseudorangeFactorArm> {};
3D Pose manifold SO(3) x R^3 and group SE(3)
Shared constants and utilities for GNSS factors.
Base class for noise model factors with N variables.
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
Matrix * OptionalMatrixType
This typedef will be used everywhere boost::optional<Matrix&> reference was used previously.
Definition NonlinearFactor.h:57
NoiseModelFactorT< Vector, ValueTypes... > NoiseModelFactorN
Noise model factor with N value types and dynamic-sized error vector.
Definition NoiseModelFactorN.h:561
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition Key.h:35
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:846
GnssMeasurementBase PseudorangeBase
Base class storing common members for GNSS-related pseudorange factors.
Definition PseudorangeFactor.h:39
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Template to create a binary predicate.
Definition Testable.h:112
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:42
static shared_ptr Create(size_t dim)
Create a unit covariance noise model.
Definition NoiseModel.h:673
Base class storing common members for GNSS measurement factors.
Definition GnssCommon.h:25
Shared geometry data for double-difference factors.
Definition GnssCommon.h:74
Point3 satRefRov
Ref satellite ECEF at rover time [m].
Definition GnssCommon.h:79
Point3 satRefBase
Ref satellite ECEF at base time [m].
Definition GnssCommon.h:81
Point3 satTargetBase
Target satellite ECEF at base time [m].
Definition GnssCommon.h:82
double baseRef
Base observation for ref satellite [m].
Definition GnssCommon.h:76
Point3 basePos
Base station ECEF position [m].
Definition GnssCommon.h:83
Point3 satTargetRov
Target satellite ECEF at rover time [m].
Definition GnssCommon.h:80
double baseTarget
Base observation for target satellite [m].
Definition GnssCommon.h:78
double rovTarget
Rover observation for target satellite [m].
Definition GnssCommon.h:77
double rovRef
Rover observation for ref satellite [m].
Definition GnssCommon.h:75
Lever-arm helper for GNSS factors that key on a body Pose3.
Definition GnssCommon.h:119
Point3 b
Lever arm in body frame [m].
Definition GnssCommon.h:120
std::optional< Pose3 > ecef_T_nav
Optional ECEF-from-nav transform.
Definition GnssCommon.h:121
Simplified GNSS pseudorange model for basic positioning problems.
Definition PseudorangeFactor.h:65
PseudorangeFactor()=default
default constructor - only use for serialization
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition PseudorangeFactor.h:102
PseudorangeFactor This
Typedef to this class.
Definition PseudorangeFactor.h:77
std::shared_ptr< PseudorangeFactor > shared_ptr
shorthand for a smart pointer to a factor
Definition PseudorangeFactor.h:74
Undifferenced (raw) PPP pseudorange factor.
Definition PseudorangeFactor.h:166
gtsam::NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition PseudorangeFactor.h:200
Undifferenced (raw) PPP pseudorange factor with lever-arm correction.
Definition PseudorangeFactor.h:254
gtsam::NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition PseudorangeFactor.h:288
Definition PseudorangeFactor.h:357
gtsam::NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition PseudorangeFactor.h:375
GNSS pseudorange factor with lever arm correction.
Definition PseudorangeFactor.h:431
const Point3 & leverArm() const
return the lever arm, a position in the body frame
Definition PseudorangeFactor.h:509
const std::optional< Pose3 > & ecefTnav() const
return the optional ecef_T_nav transform
Definition PseudorangeFactor.h:512
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition PseudorangeFactor.h:489
std::shared_ptr< PseudorangeFactorArm > shared_ptr
shorthand for a smart pointer to a factor
Definition PseudorangeFactor.h:442
PseudorangeFactorArm This
Typedef to this class.
Definition PseudorangeFactor.h:445
PseudorangeFactorArm()
default constructor - only use for serialization
Definition PseudorangeFactor.h:448
Differentially-corrected pseudorange factor with lever arm correction.
Definition PseudorangeFactor.h:553
gtsam::NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition PseudorangeFactor.h:580
Double-difference pseudorange factor.
Definition PseudorangeFactor.h:648
gtsam::NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition PseudorangeFactor.h:687
Double-difference pseudorange factor with lever arm correction.
Definition PseudorangeFactor.h:733
gtsam::NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition PseudorangeFactor.h:770
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector1 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Nonlinear factor base class.
Definition NonlinearFactor.h:70