Sophus::SO3

class SO3
{
public:
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
//构造函数
  SO3                        ();
  SO3                        (const SO3 & other);
  explicit
  SO3                        (const Matrix3d & _R);//从旋转矩阵 Matrix3d构造

  explicit
  SO3                        (const Quaterniond & unit_quaternion);//从单位四元数构造

  SO3                        (double rot_x,
                              double rot_y,
                              double rot_z);//从欧拉角构造,注意顺序,依次旋转xyz轴
 //
  void
  operator=                  (const SO3 & so3);

  SO3
  operator*                  (const SO3 & so3) const;

  void
  operator*=                 (const SO3 & so3);

  Vector3d
  operator*                  (const Vector3d & xyz) const;

//常用函数
  SO3
  inverse                    () const;//返回逆

  Matrix3d
  matrix                     () const;//返回对应的3×3旋转矩阵

  Matrix3d
  Adj                        () const;返回对应的伴随矩阵

  Matrix3d
  generator                  (int i);

  Vector3d
  log                        () const;//返回对应的李代数(旋转向量)

//静态函数
  static SO3
  exp                        (const Vector3d & omega);//返回李代数(旋转向量)对应的SO3

  static SO3
  expAndTheta                (const Vector3d & omega,
                              double * theta);
  static Vector3d
  log                        (const SO3 & so3);//返回SO3对应的李代数

  static Vector3d
  logAndTheta                (const SO3 & so3,
                              double * theta);

  static Matrix3d
  hat                        (const Vector3d & omega);//返回旋转向量对应的反对称矩阵

  static Vector3d
  vee                        (const Matrix3d & Omega);//返回反对称矩阵对应的旋转向量

  static Vector3d
  lieBracket                 (const Vector3d & omega1,
                              const Vector3d & omega2);

  static Matrix3d
  d_lieBracketab_by_d_a      (const Vector3d & b);

  void
  setQuaternion              (const Quaterniond& quaternion);

  const Quaterniond & unit_quaternion() const
  {
    return unit_quaternion_;
  }

  static const int DoF = 3;

protected:
  Quaterniond unit_quaternion_;//SO3是以单位四元数的形式保存并执行各类运算的
};

//重载<<输出的是对应的李代数
inline std::ostream& operator <<(std::ostream & out_str,
                                 const SO3 & so3)
{

  out_str << so3.log().transpose() << std::endl;
  return out_str;
}

} // end namespace
/usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::exp(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator=(Sophus::SE3 const&)&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3()&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Sophus::SE3 const&)&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator*(Sophus::SE3 const&) const&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SO3::matrix() const&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator*(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&) const&#39; collect2: error: ld returned 1 exit status make[2]: *** [rpg_vikit/vikit_common/CMakeFiles/test_vk_common_camera.dir/build.make:134: /home/dog/catkin_ws/devel/lib/vikit_common/test_vk_common_camera] Error 1 make[1]: *** [CMakeFiles/Makefile2:575: rpg_vikit/vikit_common/CMakeFiles/test_vk_common_camera.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::exp(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator=(Sophus::SE3 const&)&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3()&#39; /usr/bin/ld: /home/dog/catkin_ws/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Sophus::SE3 const&)&#39;
最新发布
04-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值