Skip to content

Commit

Permalink
Expanded stereofactor python constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
contagon committed May 27, 2024
1 parent e116123 commit d7e2e1c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gtsam/slam/StereoFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ class GenericStereoFactor: public NoiseModelFactorN<POSE, LANDMARK> {
/** return flag for throwing cheirality exceptions */
inline bool throwCheirality() const { return throwCheirality_; }

/** return the (optional) sensor pose with respect to the vehicle frame */
const std::optional<POSE>& body_P_sensor() const {
return body_P_sensor_;
}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
Expand Down
13 changes: 13 additions & 0 deletions gtsam/slam/slam.i
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,22 @@ typedef gtsam::SmartProjectionPoseFactor<gtsam::Cal3_S2>
#include <gtsam/slam/StereoFactor.h>
template <POSE, LANDMARK>
virtual class GenericStereoFactor : gtsam::NoiseModelFactor {
GenericStereoFactor(const gtsam::StereoPoint2& measured,
const gtsam::noiseModel::Base* noiseModel, size_t poseKey,
size_t landmarkKey, const gtsam::Cal3_S2Stereo* K);
GenericStereoFactor(const gtsam::StereoPoint2& measured,
const gtsam::noiseModel::Base* noiseModel, size_t poseKey,
size_t landmarkKey, const gtsam::Cal3_S2Stereo* K,
POSE body_P_sensor);

GenericStereoFactor(const gtsam::StereoPoint2& measured,
const gtsam::noiseModel::Base* noiseModel, size_t poseKey,
size_t landmarkKey, const gtsam::Cal3_S2Stereo* K,
bool throwCheirality, bool verboseCheirality);
GenericStereoFactor(const gtsam::StereoPoint2& measured,
const gtsam::noiseModel::Base* noiseModel, size_t poseKey,
size_t landmarkKey, const gtsam::Cal3_S2Stereo* K,
bool throwCheirality, bool verboseCheirality,
POSE body_P_sensor);
gtsam::StereoPoint2 measured() const;
gtsam::Cal3_S2Stereo* calibration() const;
Expand Down

0 comments on commit d7e2e1c

Please sign in to comment.