46 Rt_ = Matrix4d::Identity();
51 Rt_ = Matrix4d::Identity();
52 Rt_.block(0, 0, 3, 3) = R;
53 Rt_.col(3).head(3) = t;
58 Rt_ = Matrix4d::Identity();
59 Rt_.block(0, 0, 3, 4) = Rt;
92 return Rt_.block(0, 0, 3, 3);
97 return Rt_.block(0, 3, 3, 1);
102 Rt_ = transformation;
107 Rt_.block(0, 0, 3, 3) = rotation;
111 Rt_.block(0, 3, 3, 1) = translation;
116 Matrix4d Rt_out =
Rt_ * other.
Rt_;
122 Vector4d proj =
Rt_ * pt3d;
128 Vector4d pt3d_h = Vector4d::Constant(1.0);
129 pt3d_h.head(3) = pt3d;
131 const Vector4d proj_h =
Rt_ * pt3d_h;
132 Vector2d proj = proj_h.head(2);
140 return Rt_.isApprox(other.
Rt_);
151 Matrix4d Rt_inverse =
Rt_.inverse();
152 Pose out(Rt_inverse);
158 return Rt_.block(0, 0, 3, 4);
164 const double angle = acos(0.5 * (
Rt_.trace() - 2.0));
165 Vector3d axis = Vector3d(
Rt_(2, 1) -
Rt_(1, 2),
167 Rt_(1, 0) -
Rt_(0, 1)) * 0.5 / sin(angle);
176 double angle = aa.norm();
177 Vector3d axis = aa / angle;
181 0.0, -axis(2), axis(1),
182 axis(2), 0.0, -axis(0),
183 -axis(1), axis(0), 0.0;
187 axis(0)*axis(0), axis(0)*axis(1), axis(0)*axis(2),
188 axis(0)*axis(1), axis(1)*axis(1), axis(1)*axis(2),
189 axis(0)*axis(2), axis(1)*axis(2), axis(2)*axis(2);
192 cos(angle) * Matrix3d::Identity() +
193 sin(angle) * cross + (1-cos(angle)) * tensor;
194 Rt_.block(0, 0, 3, 3) = R;
249 if (!prefix.empty()) {
250 std::cout << prefix << std::endl;
252 std::cout <<
Rt_ << std::endl;
Vector3d Translation() const
Pose operator*(const Pose &other) const
void SetTranslation(const Vector3d &translation)
Matrix3d Rotation() const
void Set(const Matrix4d &transformation)
Vector2d ProjectTo2D(const Vector3d &)
Vector4d Project(const Vector4d &)
bool IsApprox(const Pose &) const
void TranslateY(double dy)
void Print(const std::string &prefix=std::string()) const
void TranslateZ(double dz)
void SetRotation(const Matrix3d &rotation)
void Compose(const Pose &other)
::Eigen::Matrix< double, 3, 4 > Matrix34d
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Pose()
double & operator()(int i, int j)
Matrix4d FromAxisAngle(const Vector3d &aa)
void TranslateX(double dx)
Pose Delta(const Pose &rhs) const