8 #ifndef yocs_math_toolkit_SOPHUS_HELPERS_HPP_
9 #define yocs_math_toolkit_SOPHUS_HELPERS_HPP_
19 #include <Eigen/Geometry>
22 #if defined(ECL_CXX11_FOUND)
43 #if defined(ECL_CXX11_FOUND)
44 typedef std::shared_ptr<SE3f> SE3fPtr;
47 Sophus::SE3fPtr points2DToSophusTransform(
float from_x,
float from_y,
float to_x,
float to_y);
55 std::ostream &
operator << ( std::ostream & out,
const SE3<T> & se3 )
59 const Eigen::Matrix<T,3,1> & t = se3.translation();
60 const Eigen::Quaternion<T> & q = se3.unit_quaternion();
61 out << t.transpose() <<
" " << q.x() <<
" " << q.y() <<
" " << q.z() <<
" " << q.w();
66 std::ostream &
operator << ( std::ostream & out,
const SE2<T> & se2 )
69 out << tanget_vector.transpose();
94 Eigen::Matrix3f R = ( Eigen::AngleAxis<float> (
static_cast<float> ( theta ), Eigen::Vector3f::UnitZ ()) ).matrix();
95 Eigen::Quaternionf q(R);
106 void convert(
float theta, Eigen::Quaternionf & q )
108 q.vec() << 0, 0, sin(theta*0.5
f);
109 q.w() = cos(theta*0.5
f);
126 class Converter<
Sophus::
SE3f, Eigen::Vector3f> {