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 #1 from artivis/feature/ceres-2.2
Support Ceres both pre/post 2.2
- Loading branch information
Showing
10 changed files
with
267 additions
and
56 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
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,46 @@ | ||
#ifndef _MANIF_MANIF_CERES_LOCAL_PARAMETRIZATION_H_ | ||
#define _MANIF_MANIF_CERES_LOCAL_PARAMETRIZATION_H_ | ||
|
||
#include <Eigen/Core> | ||
|
||
namespace manif { | ||
|
||
/** | ||
* @brief A wrapper for Ceres autodiff local parameterization. | ||
*/ | ||
template <typename _LieGroup> | ||
class CeresLocalParameterizationFunctor | ||
{ | ||
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: | ||
|
||
CeresLocalParameterizationFunctor() = default; | ||
virtual ~CeresLocalParameterizationFunctor() = default; | ||
|
||
template<typename T> | ||
bool operator()(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; | ||
} | ||
}; | ||
|
||
} /* namespace manif */ | ||
|
||
#endif /* _MANIF_MANIF_CERES_LOCAL_PARAMETRIZATION_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
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.