title: Create Sophus::SE3 object from Eigen Rotation and translation matrix and go back
body: <p>I am using Eigen and Sophus for my project. All I want to do is create Sophus SE3 object from rotation and translation defined in Eigen, and get the rotation and translation from SE3, but I get different matrix.
  Here is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;opencv2/core.hpp&gt;
  #include &lt;Eigen/Core&gt;
  #include &lt;sophus/so3.h&gt;
  #include &lt;sophus/se3.h&gt;
  
  using namespace std;
  using namespace cv;
  using namespace Eigen;
  using namespace Sophus;
  
  int main(int argc, char* argv[]){
      Eigen::Matrix&lt;double, 3, 3&gt; R;
      R  &lt;&lt; 1, 2, 3, 4, 5, 6, 7, 8, 9;
      cout &lt;&lt; "R: " &lt;&lt; endl &lt;&lt; R &lt;&lt; endl;
      Eigen::Matrix&lt;double, 3, 1&gt; t;
      t  &lt;&lt; 1, 2, 3;
      cout &lt;&lt; "t: " &lt;&lt; endl &lt;&lt; t &lt;&lt; endl;
      Sophus::SE3 SE3_Rt(R, t);   // Create Sophus SE3 from R and t
      cout &lt;&lt; "SE3_Rt from R and t: " &lt;&lt; endl &lt;&lt; SE3_Rt &lt;&lt; endl;
  
      // Get rotation and translation matrix from the SE3_Rt
      typedef Eigen::Matrix&lt;double, 6, 1&gt; Vector6d;
      cout &lt;&lt; "R from SE_Rt: " &lt;&lt; endl &lt;&lt; SE3_Rt.rotation_matrix() &lt;&lt; endl;
      cout &lt;&lt; "t from SE_Rt: " &lt;&lt; endl &lt;&lt; SE3_Rt.translation() &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>When I run this program, I get following result.</p>
  
  <pre><code>R: 
  1 2 3
  4 5 6
  7 8 9
  t: 
  1
  2
  3
  SE3_Rt from R and t: 
     0.2426 -0.485199    0.2426
  1 2 3
  
  R from SE_Rt: 
   0.375  -1.25 -1.875
    0.75   0.75  -1.25
   2.125   0.75  0.375
  t from SE_Rt: 
  1
  2
  3
  </code></pre>
  
  <p>I was able to get the translation vector but the rotation matrix is not correct. Could you guys point me to the right direction where I am doing wrong. Thank you.</p>