gtsam/cpp/Pose2Config.cpp

31 lines
916 B
C++
Raw Normal View History

/**
* @file Pose2Config.cpp
* @brief Configuration of 2D poses
* @author Frank Dellaert
*/
#include "Pose2Config.h"
#include "LieConfig-inl.h"
using namespace std;
namespace gtsam {
/** Explicit instantiation of templated methods and functions */
2010-01-14 06:25:03 +08:00
template class LieConfig<Symbol<Pose2,'x'>,Pose2>;
template size_t dim(const Pose2Config& c);
template Pose2Config expmap(const Pose2Config& c, const Vector& delta);
template Pose2Config expmap(const Pose2Config& c, const VectorConfig& delta);
2010-01-10 23:46:18 +08:00
/* ************************************************************************* */
2010-01-14 06:25:03 +08:00
Pose2Config pose2Circle(size_t n, double R) {
2010-01-10 23:46:18 +08:00
Pose2Config x;
double theta = 0, dtheta = 2*M_PI/n;
for(size_t i=0;i<n;i++, theta+=dtheta)
2010-01-14 06:25:03 +08:00
x.insert(i, Pose2(cos(theta), sin(theta), M_PI_2 + theta));
2010-01-10 23:46:18 +08:00
return x;
}
/* ************************************************************************* */
} // namespace