-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update ModelAligner to handle GPS and custom coords. and more #1371
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
Update ModelAligner to handle GPS and custom coords. and more #1371
Conversation
…NU, ENU -> GPS, ENU -> ECEF).
…rdinates as reference coordinates for alignment. Alignment to pure ENU frame offered as an option. Aligning reconstruction to ref coords. origin offered as an option. Fix the alignment to plane case if no ref or database provided. Documentation added for the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, I left a few comments for you.
src/base/gps_test.cc
Outdated
const auto xyz = gps_tform.ENUToXYZ(enu, lat0, lon0, alt0); | ||
|
||
for (size_t i = 0; i < ell.size(); ++i) { | ||
BOOST_CHECK(std::abs(xyz[i](0) - ref_xyz[i](0)) < 1e-8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be BOOST_CHECK(xyz[i].isApprox(ref_xyz[i], 1e-8))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I ended up doing this for all test functions in gps_test.cc
|
||
std::vector<Eigen::Vector3d> XYZToENU(const std::vector<Eigen::Vector3d>& xyz, | ||
const double lat0, | ||
const double lon0) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this should be a private method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know here. It's not used yet anywhere else yet but might become handy for later use / applications? Also this will give me some troubles for the test functions ^^
… per vector elements checks.
…of the ReadFileCameraLocations and ReadDatabaseCameraLocations functions.
…the ReadDatabaseCameraLocations & ReadFileCameraLocations functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments. Maybe you can also run another clang-format before final commit, as it seems some formatting got messed up in the last changes. Thanks for your PR!
…#1371) * Adding GPS conversions to and from ENU coords. (GPS -> ENU, ECEF -> ENU, ENU -> GPS, ENU -> ECEF). * Update of ModelAligner function. Now handles either GPS or custom coordinates as reference coordinates for alignment. Alignment to pure ENU frame offered as an option. Aligning reconstruction to ref coords. origin offered as an option. Fix the alignment to plane case if no ref or database provided. Documentation added for the function. * Adding const & const ref. * Removing begining / trailing spaces. * Ensure that first image exists when using merge_origins option. * Using Eigen isApprox function in the BOOST_CHECK functions instead of per vector elements checks. * Explicitly give the ref/origin lat/lon coordinates when converting from Ell to ENU. * Add a ConvertCameraLocations function to apply the common conversion of the ReadFileCameraLocations and ReadDatabaseCameraLocations functions. * Directly iterate over the containers in the range-based for loops in the ReadDatabaseCameraLocations & ReadFileCameraLocations functions. * Adding a const and turning output function parameters to pointers.
Update of ModelAligner function: