Skip to content

Commit

Permalink
add interface in C++, and helper extractRot2Measurements()
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwlambert authored Jul 9, 2021
1 parent 15478bf commit 3c18233
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gtsam/sfm/ShonanAveraging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,20 @@ ShonanAveraging2::ShonanAveraging2(string g2oFile, const Parameters &parameters)
parameters.getUseHuber()),
parameters) {}

static ShonanAveraging2::Measurements extractRot2Measurements(
const BetweenFactorPose2s &factors) {
ShonanAveraging2::Measurements result;
result.reserve(factors.size());
for (auto f : factors) result.push_back(convert(f));
return result;
}

ShonanAveraging2::ShonanAveraging2(const BetweenFactorPose2s &factors,
const Parameters &parameters)
: ShonanAveraging<3>(maybeRobust(extractRot2Measurements(factors),
parameters.getUseHuber()),
parameters) {}

/* ************************************************************************* */
// Explicit instantiation for d=3
template class ShonanAveraging<3>;
Expand Down

0 comments on commit 3c18233

Please sign in to comment.