forked from artivis/manif
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request artivis#295 from mattalvarado/feature/update_to_ce…
…res_manifold Support Ceres 2.2+
- Loading branch information
Showing
12 changed files
with
329 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
#include "manif/constants.h" | ||
|
||
#include <ceres/jet.h> | ||
#include <ceres/version.h> | ||
|
||
namespace manif { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#ifndef _MANIF_MANIF_CERES_MANIFOLD_H_ | ||
#define _MANIF_MANIF_CERES_MANIFOLD_H_ | ||
|
||
#include <Eigen/Core> | ||
|
||
namespace manif { | ||
|
||
/** | ||
* @brief A wrapper for Ceres autodiff local parameterization. | ||
*/ | ||
template <typename _LieGroup> | ||
class CeresManifoldFunctor | ||
{ | ||
using LieGroup = _LieGroup; | ||
using Tangent = typename _LieGroup::Tangent; | ||
|
||
template <typename _Scalar> | ||
using LieGroupTemplate = typename LieGroup::template LieGroupTemplate<_Scalar>; | ||
|
||
template <typename _Scalar> | ||
using TangentTemplate = typename Tangent::template TangentTemplate<_Scalar>; | ||
|
||
public: | ||
|
||
CeresManifoldFunctor() = default; | ||
virtual ~CeresManifoldFunctor() = default; | ||
|
||
template <typename T> | ||
bool Plus(const T* state_raw, | ||
const T* delta_raw, | ||
T* state_plus_delta_raw) const | ||
{ | ||
const Eigen::Map<const LieGroupTemplate<T>> state(state_raw); | ||
const Eigen::Map<const TangentTemplate<T>> delta(delta_raw); | ||
|
||
Eigen::Map<LieGroupTemplate<T>> state_plus_delta(state_plus_delta_raw); | ||
|
||
state_plus_delta = state + delta; | ||
|
||
return true; | ||
} | ||
|
||
template <typename T> | ||
bool Minus(const T* y_raw, | ||
const T* x_raw, | ||
T* y_minus_x_raw) const | ||
{ | ||
const Eigen::Map<const LieGroupTemplate<T>> y(y_raw); | ||
const Eigen::Map<const LieGroupTemplate<T>> x(x_raw); | ||
|
||
Eigen::Map<TangentTemplate<T>> y_minus_x(y_minus_x_raw); | ||
|
||
y_minus_x = y - x; | ||
|
||
return true; | ||
} | ||
}; | ||
|
||
} /* namespace manif */ | ||
|
||
#endif /* _MANIF_MANIF_CERES_MANIFOLD_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
cmake_minimum_required(VERSION 3.5.1) | ||
|
||
find_package(GTest QUIET) | ||
|
||
|
Oops, something went wrong.