-
Notifications
You must be signed in to change notification settings - Fork 837
Handling edges with pure rotation in translation averaging #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,16 @@ | |
* @brief Recovering translations in an epipolar graph when rotations are given. | ||
*/ | ||
|
||
#include <map> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Include only what you really need in the header, include others in .cpp only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. std::map is used in line 59 below, for |
||
#include <set> | ||
#include <utility> | ||
#include <vector> | ||
|
||
#include <gtsam/geometry/Unit3.h> | ||
#include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h> | ||
#include <gtsam/nonlinear/Values.h> | ||
#include <gtsam/sfm/BinaryMeasurement.h> | ||
|
||
#include <utility> | ||
#include <vector> | ||
|
||
namespace gtsam { | ||
|
||
// Set up an optimization problem for the unknown translations Ti in the world | ||
|
@@ -52,23 +54,30 @@ class TranslationRecovery { | |
using TranslationEdges = std::vector<BinaryMeasurement<Unit3>>; | ||
|
||
private: | ||
// Translation directions between camera pairs. | ||
TranslationEdges relativeTranslations_; | ||
|
||
// Parameters used by the LM Optimizer. | ||
LevenbergMarquardtParams params_; | ||
|
||
// Map from a key in the graph to a set of keys that share the same | ||
// translation. | ||
std::map<Key, std::set<Key>> sameTranslationNodes_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. document all of these with at least a |
||
|
||
public: | ||
/** | ||
* @brief Construct a new Translation Recovery object | ||
* | ||
* @param relativeTranslations the relative translations, in world coordinate | ||
* frames, vector of BinaryMeasurements of Unit3, where each key of a measurement | ||
* is a point in 3D. | ||
* frames, vector of BinaryMeasurements of Unit3, where each key of a | ||
* measurement is a point in 3D. | ||
* @param lmParams (optional) gtsam::LavenbergMarquardtParams that can be | ||
* used to modify the parameters for the LM optimizer. By default, uses the | ||
* default LM parameters. | ||
* default LM parameters. | ||
*/ | ||
TranslationRecovery(const TranslationEdges &relativeTranslations, | ||
const LevenbergMarquardtParams &lmParams = LevenbergMarquardtParams()) | ||
: relativeTranslations_(relativeTranslations), params_(lmParams) {} | ||
TranslationRecovery( | ||
const TranslationEdges &relativeTranslations, | ||
const LevenbergMarquardtParams &lmParams = LevenbergMarquardtParams()); | ||
|
||
/** | ||
* @brief Build the factor graph to do the optimization. | ||
|
@@ -108,8 +117,8 @@ class TranslationRecovery { | |
* | ||
* @param poses SE(3) ground truth poses stored as Values | ||
* @param edges pairs (a,b) for which a measurement w_aZb will be generated. | ||
* @return TranslationEdges vector of binary measurements where the keys are | ||
* the cameras and the measurement is the simulated Unit3 translation | ||
* @return TranslationEdges vector of binary measurements where the keys are | ||
* the cameras and the measurement is the simulated Unit3 translation | ||
* direction between the cameras. | ||
*/ | ||
static TranslationEdges SimulateMeasurements( | ||
|
Uh oh!
There was an error while loading. Please reload this page.