6#include <Eigen/Geometry>
8#include "detail/macro.hpp"
9#include "detail/se3.hpp"
10#include "lie_group_base.hpp"
15template<
typename Scalar>
62template<
typename _Derived>
71 SMOOTH_INHERIT_TYPEDEFS;
90 Eigen::Map<Eigen::Vector3<Scalar>>
r3()
93 return Eigen::Map<Eigen::Vector3<Scalar>>(
static_cast<_Derived &
>(*this).data());
99 Eigen::Map<const Eigen::Vector3<Scalar>>
r3()
const
101 return Eigen::Map<const Eigen::Vector3<Scalar>>(
static_cast<const _Derived &
>(*this).data());
107 Eigen::Transform<Scalar, 3, Eigen::Isometry>
isometry()
const
109 return Eigen::Translation<Scalar, 3>(
r3()) *
so3().quat();
115 template<
typename EigenDerived>
116 Eigen::Vector3<Scalar>
operator*(
const Eigen::MatrixBase<EigenDerived> &
v)
const
128 template<
typename EigenDerived>
129 Eigen::Matrix<Scalar, 3, 6>
dr_action(
const Eigen::MatrixBase<EigenDerived> &
v)
const
131 Eigen::Matrix<Scalar, 3, 6>
ret;
146template<
typename _Scalar>
151template<
typename _Scalar>
154 static constexpr bool is_mutable =
true;
156 using Impl = SE3Impl<_Scalar>;
159 template<
typename NewScalar>
169template<
typename _Scalar>
174 SMOOTH_GROUP_API(
SE3);
183 template<
typename SO3Derived,
typename T3Derived>
193 explicit SE3(
const Eigen::Transform<Scalar, 3, Eigen::Isometry> &
t)
195 Base::so3() = smooth::SO3<Scalar>(Eigen::Quaternion<Scalar>(
t.rotation()));
201template<
typename _Scalar>
211template<
typename _Scalar>
220template<
typename _Scalar>
223 static constexpr bool is_mutable =
false;
232template<
typename _Scalar>
237 SMOOTH_CONST_MAP_API();
246#if __has_include(<format>)
250template<
class Scalar>
251struct std::formatter<smooth::
SE3<Scalar>>
255 constexpr auto parse(std::format_parse_context & ctx)
258 for (
auto it = ctx.begin(); it != ctx.end(); ++
it) {
261 if (c ==
'}')
return it;
266 auto format(
const smooth::SE3<Scalar> & obj, std::format_context & ctx)
const
268 const auto fmtSting = std::format(
"r3: [{0}, {0}, {0}], so3: [{0}, {0}, {0}, {0}]", m_format);
269 return std::vformat_to(
272 std::make_format_args(
276 obj.so3().quat().w(),
277 obj.so3().quat().x(),
278 obj.so3().quat().y(),
279 obj.so3().quat().z()));
Base class for Lie group types.
static constexpr bool is_mutable
True if underlying storage supports modification.
Eigen::Matrix< Scalar, Dim, Dim > Matrix
Lie group matrix type.
Memory mapping of internal Lie group types.
Storage implementation of SE2 Lie group.
Base class for SE3 Lie group types.
Eigen::Transform< Scalar, 3, Eigen::Isometry > isometry() const
Return as 3D Eigen transform.
Eigen::Map< Eigen::Vector3< Scalar > > r3()
Access R3 part.
Eigen::Vector3< Scalar > operator*(const Eigen::MatrixBase< EigenDerived > &v) const
Tranformation action on 3D vector.
Map< SO3< Scalar > > so3()
Access SO(3) part.
Eigen::Matrix< Scalar, 3, 6 > dr_action(const Eigen::MatrixBase< EigenDerived > &v) const
Jacobian of rotation action w.r.t. group.
Eigen::Map< const Eigen::Vector3< Scalar > > r3() const
Const access R3 part.
SE2< Scalar > project_se2() const
Project to SE2.
Map< const SO3< Scalar > > so3() const
Const access SO(3) part.
Storage implementation of SE3 Lie group.
SE3(const SO3Base< SO3Derived > &so3, const Eigen::MatrixBase< T3Derived > &r3)
Construct from SO3 and translation.
SE3(const Eigen::Transform< Scalar, 3, Eigen::Isometry > &t)
Construct from Eigen transform.
typename traits::man< M >::Scalar Scalar
Manifold scalar type.
typename traits::man< M >::PlainObject PlainObject
Manifold default type.
Type trait that maps a type to Lie group operations.